sys_authority.go 1.1 KB

1234567891011121314151617181920212223
  1. package system
  2. import (
  3. "time"
  4. )
  5. type SysAuthority struct {
  6. CreatedAt time.Time // 创建时间
  7. UpdatedAt time.Time // 更新时间
  8. DeletedAt *time.Time `sql:"index"`
  9. AuthorityId uint `json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;size:90"` // 角色ID
  10. AuthorityName string `json:"authorityName" gorm:"comment:角色名"` // 角色名
  11. ParentId *uint `json:"parentId" gorm:"comment:父角色ID"` // 父角色ID
  12. DataAuthorityId []*SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id;"`
  13. Children []SysAuthority `json:"children" gorm:"-"`
  14. SysBaseMenus []SysBaseMenu `json:"menus" gorm:"many2many:sys_authority_menus;"`
  15. Users []SysUser `json:"-" gorm:"many2many:sys_user_authority;"`
  16. DefaultRouter string `json:"defaultRouter" gorm:"comment:默认菜单;default:dashboard"` // 默认菜单(默认dashboard)
  17. }
  18. func (SysAuthority) TableName() string {
  19. return "sys_authorities"
  20. }