sysAuthority.go 951 B

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