解决冲突

This commit is contained in:
苏尹岚
2020-09-27 09:52:07 +08:00
7 changed files with 79 additions and 13 deletions

View File

@@ -226,3 +226,57 @@ func (v *UserMember) TableIndex() [][]string {
[]string{"CreatedAt"},
}
}
type Role struct {
ModelIDCULD
Name string `json:"name"` //角色名
}
func (*Role) TableUnique() [][]string {
return [][]string{
[]string{"Name"},
}
}
type UserRole struct {
ModelIDCULD
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 {
ModelIDCULD
Name string `json:"name"` //功能名
URL string `orm:"column(url)" json:"url"` //路径
ImgURL string `orm:"column(img_url)" json:"imgURL"` //图标
Level int `json:"level"` //级别
ParentID int `orm:"column(parent_id)" json:"parentID"` //父功能ID
}
func (*Function) TableUnique() [][]string {
return [][]string{
[]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"},
}
}