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.

25 lines
1.1 KiB

  1. package model
  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 string `json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;size:90"`
  10. AuthorityName string `json:"authorityName" gorm:"comment:'角色名'"`
  11. ParentId string `json:"parentId" gorm:"comment:'父角色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. }
  16. func SysAuthorityData() []SysAuthority {
  17. return []SysAuthority{
  18. {CreatedAt: time.Now(), UpdatedAt: time.Now(), AuthorityId: "888", AuthorityName: "普通用户", ParentId: "0"},
  19. {CreatedAt: time.Now(), UpdatedAt: time.Now(), AuthorityId: "8881", AuthorityName: "普通用户子角色", ParentId: "888"},
  20. {CreatedAt: time.Now(), UpdatedAt: time.Now(), AuthorityId: "9528", AuthorityName: "测试角色", ParentId: "0"},
  21. }
  22. }