role_models.go 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. //AdminUser AdminUser `gorm:"ForeignKey:ID;AssociationForeignKey:AdminUserId" json:"admin"`
  54. IsSubSuperAdmin bool `gorm:"-" json:"is_sub_super_admin" form:"is_sub_super_admin"`
  55. Message string `gorm:"column:message" json:"message" form:"message"`
  56. Sex int64 `gorm:"column:sex" json:"sex" form:"sex"`
  57. Birthday int64 `gorm:"column:birthday" json:"birthday" form:"birthday"`
  58. Sort int64 `gorm:"column:sort" json:"sort" form:"sort"`
  59. IsSort int64 `gorm:"column:is_sort" json:"is_sort" form:"is_sort"`
  60. DepartmentId int64 `gorm:"column:department_id" json:"department_id" form:"department_id"`
  61. Department string `gorm:"column:department" json:"department" form:"department"`
  62. Age int64 `gorm:"column:age" json:"age" form:"age"`
  63. Nation string `gorm:"column:nation" json:"nation" form:"nation"`
  64. CardType int64 `gorm:"column:card_type" json:"card_type" form:"card_type"`
  65. IdCard string `gorm:"column:id_card" json:"id_card" form:"id_card"`
  66. Education int64 `gorm:"column:education" json:"education" form:"education"`
  67. StudyMajorName string `gorm:"column:study_major_name" json:"study_major_name" form:"study_major_name"`
  68. WorkMajorName string `gorm:"column:work_major_name" json:"work_major_name" form:"work_major_name"`
  69. RoleType int64 `gorm:"column:role_type" json:"role_type" form:"role_type"`
  70. MedicalCode string `gorm:"column:medical_code" json:"medical_code" form:"medical_code"`
  71. DoctorCode string `gorm:"column:doctor_code" json:"doctor_code" form:"doctor_code"`
  72. Licensing int64 `gorm:"column:licensing" json:"licensing" form:"licensing"`
  73. JobNumber string `gorm:"column:job_number" json:"job_number" form:"job_number"`
  74. PrescriptionQualificationIdentification int64 `gorm:"column:prescription_qualification_identification" json:"prescription_qualification_identification" form:"prescription_qualification_identification"`
  75. IdentificationOutpatients int64 `gorm:"column:identification_outpatients" json:"identification_outpatients" form:"identification_outpatients"`
  76. StartTime int64 `gorm:"column:start_time" json:"start_time" form:"start_time"`
  77. MedicalRangeCode int64 `gorm:"column:medical_range_code" json:"medical_range_code" form:"medical_range_code"`
  78. MedicalLevel int64 `gorm:"column:medical_level" json:"medical_level" form:"medical_level"`
  79. MedicalTypeJob int64 `gorm:"column:medical_type_job" json:"medical_type_job" form:"medical_type_job"`
  80. PharmacistRegistrationNumber string `gorm:"column:pharmacist_registration_number" json:"pharmacist_registration_number" form:"pharmacist_registration_number"`
  81. DoctorRangeCode int64 `gorm:"column:doctor_range_code" json:"doctor_range_code" form:"doctor_range_code"`
  82. DoctorLevel int64 `gorm:"column:doctor_level" json:"doctor_level" form:"doctor_level"`
  83. DoctorTypeJob int64 `gorm:"column:doctor_type_job" json:"doctor_type_job" form:"doctor_type_job"`
  84. DoctorNumber string `gorm:"column:doctor_number" json:"doctor_number" form:"doctor_number"`
  85. OutpatientIllnesscategory string `gorm:"column:outpatient_illness_category" json:"outpatient_illness_category" form:"outpatient_illness_category"`
  86. IsActive int64 `gorm:"column:is_active" json:"is_active" form:"is_active"`
  87. ActiveStatus int64 `gorm:"column:active_status" json:"active_status" form:"active_status"`
  88. }
  89. func (App_Role) TableName() string {
  90. return "sgj_user_admin_role"
  91. }
  92. var UserType = map[int]string{
  93. 1: "管理员",
  94. 2: "医生",
  95. 3: "护士",
  96. 4: "运营",
  97. }
  98. var UserTitle = map[int]string{
  99. 1: "医士",
  100. 2: "医师",
  101. 3: "住院医师",
  102. 4: "主治医师",
  103. 5: "副主任医师",
  104. 6: "主任医师",
  105. 7: "护士",
  106. 8: "护师",
  107. 9: "主管护师",
  108. 10: "副主任护师",
  109. 11: "主任护师",
  110. 12: "运营专员",
  111. 13: "运营主管",
  112. }
  113. type SgjUserRoleFuncPurview struct {
  114. ID int64 `gorm:"column:id" json:"id" form:"id"`
  115. OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
  116. AppId int64 `gorm:"column:app_id" json:"app_id" form:"app_id"`
  117. RoleId int64 `gorm:"column:role_id" json:"role_id" form:"role_id"`
  118. PurviewIds string `gorm:"column:purview_ids" json:"purview_ids" form:"purview_ids"`
  119. Status int64 `gorm:"column:status" json:"status" form:"status"`
  120. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  121. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  122. }
  123. func (SgjUserRoleFuncPurview) TableName() string {
  124. return "sgj_user_role_func_purview"
  125. }
  126. type Roles struct {
  127. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
  128. RoleName string `gorm:"column:role_name" json:"role_name"`
  129. RoleIntro string `gorm:"column:role_introduction" json:"intro"`
  130. Creator int64 `json:"-"`
  131. OrgId int64 `gorm:"column:org_id" json:"-"`
  132. AppId int64 `gorm:"column:app_id" json:"-"`
  133. IsSuperAdmin bool `gorm:"column:is_super_admin" json:"is_super_admin"`
  134. Status int8 `json:"status"` // 状态 0.无效 1.有效 2.禁用
  135. CreateTime int64 `gorm:"column:ctime" json:"-"` // 创建时间
  136. ModifyTime int64 `gorm:"column:mtime" json:"-"` // 修改时间
  137. StaffNumber int64 `gorm:"-" json:"staff_number"`
  138. Number int64 `gorm:"column:number" json:"number" form:"number"`
  139. IsSystem int64 `gorm:"column:is_system" json:"is_system" form:"is_system"`
  140. }
  141. func (Roles) TableName() string {
  142. return "sgj_user_role"
  143. }