改名
This commit is contained in:
@@ -252,7 +252,7 @@ func (*UserRole) TableUnique() [][]string {
|
||||
}
|
||||
}
|
||||
|
||||
type Function struct {
|
||||
type Menu struct {
|
||||
ModelIDCULD
|
||||
|
||||
Name string `json:"name"` //功能名
|
||||
@@ -262,21 +262,21 @@ type Function struct {
|
||||
ParentID int `orm:"column(parent_id)" json:"parentID"` //父功能ID
|
||||
}
|
||||
|
||||
func (*Function) TableUnique() [][]string {
|
||||
func (*Menu) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"Name"},
|
||||
}
|
||||
}
|
||||
|
||||
type RoleFunction struct {
|
||||
type RoleMenu struct {
|
||||
ModelIDCULD
|
||||
|
||||
RoleID int `orm:"column(role_id)" json:"roleID"` //角色ID
|
||||
FunctionID int `orm:"column(function_id)" json:"functionID"` //功能ID
|
||||
MenuID int `orm:"column(menu_id)" json:"menuID"` //功能ID
|
||||
}
|
||||
|
||||
func (*RoleFunction) TableUnique() [][]string {
|
||||
func (*RoleMenu) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"FunctionID", "RoleID"},
|
||||
[]string{"MenuID", "RoleID"},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ func Init() {
|
||||
//权限
|
||||
orm.RegisterModel(&model.Role{})
|
||||
orm.RegisterModel(&model.UserRole{})
|
||||
orm.RegisterModel(&model.Function{})
|
||||
orm.RegisterModel(&model.RoleFunction{})
|
||||
orm.RegisterModel(&model.Menu{})
|
||||
orm.RegisterModel(&model.RoleMenu{})
|
||||
// create table
|
||||
orm.RunSyncdb("default", false, true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user