12345678910111213141516171819202122232425 |
- package model
- import (
- "time"
- )
- type SysAuthority struct {
- CreatedAt time.Time
- UpdatedAt time.Time
- DeletedAt *time.Time `sql:"index"`
- AuthorityId string `json:"authorityId" gorm:"not null;unique;primary_key;comment:'角色ID';size:90"`
- AuthorityName string `json:"authorityName" gorm:"comment:'角色名'"`
- ParentId string `json:"parentId" gorm:"comment:'父角色ID'"`
- DataAuthorityId []SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id"`
- Children []SysAuthority `json:"children" gorm:"-"`
- SysBaseMenus []SysBaseMenu `json:"menus" gorm:"many2many:sys_authority_menus;"`
- }
- func SysAuthorityData() []SysAuthority {
- return []SysAuthority{
- {CreatedAt: time.Now(), UpdatedAt: time.Now(), AuthorityId: "888", AuthorityName: "普通用户", ParentId: "0"},
- {CreatedAt: time.Now(), UpdatedAt: time.Now(), AuthorityId: "8881", AuthorityName: "普通用户子角色", ParentId: "888"},
- {CreatedAt: time.Now(), UpdatedAt: time.Now(), AuthorityId: "9528", AuthorityName: "测试角色", ParentId: "0"},
- }
- }
|