role_models.go 6.0KB

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