role_models.go 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. package models
  2. type Role struct {
  3. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
  4. RoleName string `gorm:"column:role_name" json:"name"`
  5. RoleIntro string `gorm:"column:role_introduction" json:"intro"`
  6. Creator int64 `json:"-"`
  7. OrgId int64 `gorm:"column:org_id" json:"-"`
  8. AppId int64 `gorm:"column:app_id" json:"-"`
  9. IsSuperAdmin bool `gorm:"column:is_super_admin" json:"is_super_admin"`
  10. Status int8 `json:"status"` // 状态 0.无效 1.有效 2.禁用
  11. CreateTime int64 `gorm:"column:ctime" json:"-"` // 创建时间
  12. ModifyTime int64 `gorm:"column:mtime" json:"-"` // 修改时间
  13. StaffNumber int64 `gorm:"-" json:"staff_number"`
  14. }
  15. func (Role) TableName() string {
  16. return "sgj_user_role"
  17. }
  18. type App_Roles struct {
  19. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
  20. AdminUserId int64 `gorm:"column:admin_user_id" json:"admin_user_id"`
  21. OrgId int64 `gorm:"column:org_id" json:"org_id"`
  22. AppId int64 `gorm:"column:app_id" json:"app_id"`
  23. RoleId int64 `gorm:"column:role_id" json:"role_id"`
  24. Avatar string `json:"avatar" json:"avatar"`
  25. UserName string `gorm:"column:user_name" json:"user_name"` // 用户名称
  26. Intro string `json:"intro"` // 简介
  27. UserType int8 `gorm:"column:user_type" json:"user_type"` // 用户类型(1.管理员;2.医生;3.护士;4.运营)
  28. UserTitle int8 `gorm:"column:user_title" json:"user_title"` // 用户职称(1.医士;2.医师;3.住院医师;4.主治医师;5.副主任医师;6.主任医师;7.护士;8.护师;9.主管护师;10.副主任护师;11.主任护师;12.运营专员;13.运营主管)
  29. Status int8 `json:"status"` // 状态 0.无效 1.有效
  30. CreateTime int64 `gorm:"column:ctime" json:"ctime"` // 创建时间
  31. ModifyTime int64 `gorm:"column:mtime" json:"mtime"` // 修改时间
  32. Url string `gorm:"column:url" json:"url" form:"url"`
  33. }
  34. type App_Role struct {
  35. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
  36. AdminUserId int64 `gorm:"column:admin_user_id" json:"admin_user_id"`
  37. OrgId int64 `gorm:"column:org_id" json:"org_id"`
  38. AppId int64 `gorm:"column:app_id" json:"app_id"`
  39. RoleId int64 `gorm:"column:role_id" json:"role_id"`
  40. Avatar string `json:"avatar" json:"avatar"`
  41. UserName string `gorm:"column:user_name" json:"user_name"` // 用户名称
  42. Intro string `json:"intro"` // 简介
  43. UserType int8 `gorm:"column:user_type" json:"user_type"` // 用户类型(1.管理员;2.医生;3.护士;4.运营)
  44. UserTitle int8 `gorm:"column:user_title" json:"user_title"` // 用户职称(1.医士;2.医师;3.住院医师;4.主治医师;5.副主任医师;6.主任医师;7.护士;8.护师;9.主管护师;10.副主任护师;11.主任护师;12.运营专员;13.运营主管)
  45. Status int8 `json:"status"` // 状态 0.无效 1.有效
  46. CreateTime int64 `gorm:"column:ctime" json:"ctime"` // 创建时间
  47. ModifyTime int64 `gorm:"column:mtime" json:"mtime"` // 修改时间UserTitleName string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
  48. UserTitleName string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
  49. RoleIds string `gorm:"column:role_ids" json:"role_ids" form:"role_ids"`
  50. AdminUser AdminUser `gorm:"ForeignKey:ID;AssociationForeignKey:AdminUserId" json:"admin"`
  51. Message string `gorm:"column:message" json:"message" form:"message"`
  52. Sex int64 `gorm:"column:sex" json:"sex" form:"sex"`
  53. Birthday int64 `gorm:"column:birthday" json:"birthday" form:"birthday"`
  54. }
  55. func (App_Role) TableName() string {
  56. return "sgj_user_admin_role"
  57. }
  58. var UserType = map[int]string{
  59. 1: "管理员",
  60. 2: "医生",
  61. 3: "护士",
  62. 4: "运营",
  63. }
  64. var UserTitle = map[int]string{
  65. 1: "医士",
  66. 2: "医师",
  67. 3: "住院医师",
  68. 4: "主治医师",
  69. 5: "副主任医师",
  70. 6: "主任医师",
  71. 7: "护士",
  72. 8: "护师",
  73. 9: "主管护师",
  74. 10: "副主任护师",
  75. 11: "主任护师",
  76. 12: "运营专员",
  77. 13: "运营主管",
  78. }
  79. type SgjUserRoleFuncPurview struct {
  80. ID int64 `gorm:"column:id" json:"id" form:"id"`
  81. OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
  82. AppId int64 `gorm:"column:app_id" json:"app_id" form:"app_id"`
  83. RoleId int64 `gorm:"column:role_id" json:"role_id" form:"role_id"`
  84. PurviewIds string `gorm:"column:purview_ids" json:"purview_ids" form:"purview_ids"`
  85. Status int64 `gorm:"column:status" json:"status" form:"status"`
  86. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  87. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  88. }
  89. func (SgjUserRoleFuncPurview) TableName() string {
  90. return "sgj_user_role_func_purview"
  91. }
  92. type Roles struct {
  93. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
  94. RoleName string `gorm:"column:role_name" json:"role_name"`
  95. RoleIntro string `gorm:"column:role_introduction" json:"intro"`
  96. Creator int64 `json:"-"`
  97. OrgId int64 `gorm:"column:org_id" json:"-"`
  98. AppId int64 `gorm:"column:app_id" json:"-"`
  99. IsSuperAdmin bool `gorm:"column:is_super_admin" json:"is_super_admin"`
  100. Status int8 `json:"status"` // 状态 0.无效 1.有效 2.禁用
  101. CreateTime int64 `gorm:"column:ctime" json:"-"` // 创建时间
  102. ModifyTime int64 `gorm:"column:mtime" json:"-"` // 修改时间
  103. StaffNumber int64 `gorm:"-" json:"staff_number"`
  104. }
  105. func (Roles) TableName() string {
  106. return "sgj_user_role"
  107. }