| 1234567891011121314151617181920 |
- package dao
- // Role 角色
- type Role struct {
- ID int64 `gorm:"primary_key" json:"id"` //编号
- TenantId string `gorm:"type:varchar(12);default '000000'" json:"tenantId"` //租户id
- ParentId int64 `gorm:"type:bigint" json:"parentId"` //父主键
- RoleName string `gorm:"type:varchar(255)" json:"roleName"` //角色别名
- Sort int `gorm:"type:int" json:"sort"` //排序
- RoleAlias string `gorm:"type:varchar(255)" json:"roleAlias"` //角色别名
- IsDeleted int `gorm:"type:int" json:"isDeleted"` //是否删除
- }
- func (Role) TableName() string {
- return "role"
- }
- func (c *Role) GetRole() error {
- return Db.Model(&c).Where("id = ?", c.ID).Find(&c).Error
- }
|