57 lines
1.7 KiB
Go
57 lines
1.7 KiB
Go
|
package entity
|
||
|
|
||
|
import "wechat-robot/pkg/types"
|
||
|
|
||
|
// Role
|
||
|
// @description: 角色表
|
||
|
type Role struct {
|
||
|
types.BaseDbModel
|
||
|
Name string `json:"name" gorm:"type:varchar(20) not null comment '角色名称'"`
|
||
|
Code string `json:"code" gorm:"type:varchar(20) not null comment '角色代码'"`
|
||
|
Describe string `json:"describe" gorm:"type:varchar(20) not null comment '描述'"`
|
||
|
}
|
||
|
|
||
|
// TableName
|
||
|
// @description: 表名
|
||
|
// @receiver Role
|
||
|
// @return string
|
||
|
func (Role) TableName() string {
|
||
|
return "t_role"
|
||
|
}
|
||
|
|
||
|
// =====================================================================================================================
|
||
|
|
||
|
// RoleMenu
|
||
|
// @description: 角色菜单表
|
||
|
type RoleMenu struct {
|
||
|
types.BaseDbModelWithReal
|
||
|
RoleId string `json:"roleId" gorm:"index:idx_rm_only,unique;type:varchar(32);not null;comment:'角色id'"`
|
||
|
MenuId string `json:"menuId" gorm:"index:idx_rm_only,unique;type:varchar(32);not null;comment:'菜单id'"`
|
||
|
}
|
||
|
|
||
|
// TableName
|
||
|
// @description: 表名
|
||
|
// @receiver RoleMenu
|
||
|
// @return string
|
||
|
func (RoleMenu) TableName() string {
|
||
|
return "t_role_menu"
|
||
|
}
|
||
|
|
||
|
// =====================================================================================================================
|
||
|
|
||
|
// AdminUserRole
|
||
|
// @description: 管理员角色表
|
||
|
type AdminUserRole struct {
|
||
|
types.BaseDbModelWithReal
|
||
|
RoleId string `json:"roleId" gorm:"index:idx_aur_only,unique;type:varchar(32);not null;comment:'角色id'"`
|
||
|
UserId string `json:"menuId" gorm:"index:idx_aur_only,unique;type:varchar(32);not null;comment:'管理员id'"`
|
||
|
}
|
||
|
|
||
|
// TableName
|
||
|
// @description: 表名
|
||
|
// @receiver AdminUserRole
|
||
|
// @return string
|
||
|
func (AdminUserRole) TableName() string {
|
||
|
return "t_admin_user_role"
|
||
|
}
|