sys_role.go 600 B

12345678910111213141516171819202122232425
  1. package system
  2. import (
  3. "go_server/model/common"
  4. )
  5. type Role struct {
  6. common.GormFullModel
  7. Name string `json:"name" gorm:"column:name;type:varchar(100);comment:角色名称"`
  8. Apis string `json:"auths" gorm:"column:apis;type:text;comment:Api权限"`
  9. Menus string `json:"menus" gorm:"column:menus;type:text;comment:menu权限"`
  10. Desc string `json:"desc" gorm:"column:desc;type:varchar(200);comment:角色权限描述;"`
  11. }
  12. func (*Role) TableName() string {
  13. return common.ModelPrefix + "role"
  14. }
  15. func NewRole() *Role {
  16. return &Role{}
  17. }
  18. func (*Role) Comment() string {
  19. return "角色表"
  20. }