You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.9 KiB
39 lines
1.9 KiB
package models
|
|
|
|
import "key_performance_indicators/overall"
|
|
|
|
type SystemRole struct {
|
|
Id int64 `json:"id" gorm:"column:r_id;type:bigint(20) unsigned;not null;comment:Id"`
|
|
Title string `json:"title" gorm:"column:r_title;type:varchar(36);not null;comment:角色名称"`
|
|
State int `json:"state" gorm:"column:r_set;type:tinyint(1) unsigned;default:1;not null;comment:是否启用(1:启用;2:禁用;3:删除)"`
|
|
Attribute int64 `json:"attribute" gorm:"column:r_attribute;type:bigint(20) unsigned;default:0;not null;comment:属性"`
|
|
Gode int `json:"gode" gorm:"column:r_gode;type:tinyint(1) unsigned;default:1;not null;comment:继承属性(1:系统管理员;2:分厂管理员)"`
|
|
Time int64 `json:"time" gorm:"column:r_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
|
|
UserId int64 `json:"userId" gorm:"column:r_user_id;type:bigint(50) unsigned;default:0;not null;comment:写入人"`
|
|
Jurisdiction string `json:"jurisdiction" gorm:"column:r_jurisdiction;type:text;not null;comment:权限"`
|
|
MenuOper string `json:"menuoper" gorm:"column:r_menu_oper;type:text;not null;comment:权限"`
|
|
Wand int `json:"wand" gorm:"column:r_wand;type:tinyint(2) unsigned;default:0;not null;comment:权杖"`
|
|
Group int64 `json:"group" gorm:"column:r_group;type:bigint(20) unsigned;not null;default:3;comment:归属集团"`
|
|
}
|
|
|
|
func (SystemRole *SystemRole) TableName() string {
|
|
return "system_role"
|
|
}
|
|
|
|
//获取详情
|
|
func (cont *SystemRole) GetCont(where interface{}, filed ...string) error {
|
|
gormDb := overall.CONSTANT_DB_Master.Where(where)
|
|
if len(filed) > 0 {
|
|
for _, v := range filed {
|
|
gormDb = gormDb.Select(v)
|
|
}
|
|
}
|
|
err := gormDb.First(&cont).Error
|
|
return err
|
|
}
|
|
|
|
//编辑内容
|
|
func (cont *SystemRole) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
|
|
err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error
|
|
return
|
|
}
|
|
|