权限表
This commit is contained in:
@@ -226,7 +226,14 @@ func (*Role) TableUnique() [][]string {
|
|||||||
type UserRole struct {
|
type UserRole struct {
|
||||||
ModelIDCULD
|
ModelIDCULD
|
||||||
|
|
||||||
Name string `json:"name"` //角色名
|
UserID string `orm:"column(user_id)" json:"userID"` //用户ID
|
||||||
|
RoleID int `orm:"column(role_id)" json:"roleID"` //角色ID
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UserRole) TableUnique() [][]string {
|
||||||
|
return [][]string{
|
||||||
|
[]string{"UserID", "RoleID"},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Function struct {
|
type Function struct {
|
||||||
@@ -244,3 +251,16 @@ func (*Function) TableUnique() [][]string {
|
|||||||
[]string{"Name"},
|
[]string{"Name"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RoleFunction struct {
|
||||||
|
ModelIDCULD
|
||||||
|
|
||||||
|
RoleID int `orm:"column(role_id)" json:"roleID"` //角色ID
|
||||||
|
FunctionID int `orm:"column(function_id)" json:"functionID"` //功能ID
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*RoleFunction) TableUnique() [][]string {
|
||||||
|
return [][]string{
|
||||||
|
[]string{"FunctionID", "RoleID"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ func Init() {
|
|||||||
|
|
||||||
orm.RegisterModel(&model.FakeJdThingMap{})
|
orm.RegisterModel(&model.FakeJdThingMap{})
|
||||||
|
|
||||||
|
//权限
|
||||||
|
// orm.RegisterModel(&model)
|
||||||
// create table
|
// create table
|
||||||
orm.RunSyncdb("default", false, true)
|
orm.RunSyncdb("default", false, true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user