org_models.go 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package models
  2. type Org struct {
  3. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"` // 机构 ID
  4. Creator int64 `json:"creator"` // 创建者,即管理员用户的 id
  5. OrgName string `gorm:"column:org_name" json:"org_name"`
  6. OrgShortName string `gorm:"column:org_short_name" json:"org_short_name"` // 简称
  7. OrgLogo string `gorm:"column:org_logo" json:"org_logo"`
  8. OrgIntroduction string `gorm:"column:org_introduction" json:"org_introduction"`
  9. Province int64 `json:"province"` // 省,代号,下面的市、区也一样
  10. City int64 `json:"city"`
  11. District int64 `json:"district"`
  12. Address string `json:"address"` // 详细地址
  13. Illness string `json:"illness"` // 服务病种 多个并用“,”隔开
  14. Status int8 `json:"status"` // 状态 0.无效 1.有效 2.禁用
  15. CreateTime int64 `gorm:"column:ctime" json:"ctime"` // 创建时间
  16. ModifyTime int64 `gorm:"column:mtime" json:"mtime"` // 修改时间
  17. OrgType int64 `gorm:"column:org_type" json:"org_type"`
  18. Evaluate float64 `gorm:"column:evaluate" json:"evaluate"`
  19. Comments int64 `gorm:"column:comments" json:"comments"`
  20. OperatingState int64 `gorm:"column:operating_state" json:"operating_state"`
  21. Claim int64 `gorm:"column:claim" json:"claim"`
  22. Telephone string `gorm:"column:telephone" json:"telephone"`
  23. BusinessWeek string `gorm:"column:business_week" json:"business_week"`
  24. BusinessTime string `gorm:"column:business_time" json:"business_time"`
  25. Gallery string `gorm:"column:gallery" json:"gallery"`
  26. ContactName string `gorm:"column:contact_name" json:"contact_name"`
  27. OrgGallery []*OrgGallery `gorm:"ForeignKey:OrgId" json:"org_gallery"`
  28. }
  29. func (Org) TableName() string {
  30. return "sgj_user_org"
  31. }
  32. type OrgGallery struct {
  33. ID int64 `gorm:"column:id" json:"id" form:"id"`
  34. Url string `gorm:"column:url" json:"url" form:"url"`
  35. Type int64 `gorm:"column:type" json:"type" form:"type"`
  36. OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
  37. UserId int64 `gorm:"column:user_id" json:"user_id" form:"user_id"`
  38. Status int64 `gorm:"column:status" json:"status" form:"status"`
  39. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  40. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  41. }
  42. func (OrgGallery) TableName() string {
  43. return "sgj_user_org_gallery"
  44. }
  45. type OrgApp struct {
  46. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"` // ID
  47. AppType int `gorm:"column:app_type" json:"app_type"` // 应用类型 1.病友经营;2.科普号;3.血透经营;4.慢病管理
  48. Creator int `json:"creator"` // 创建者,即管理员用户的 id
  49. OrgId int `gorm:"column:org_id" json:"org_id"`
  50. OpenStatus int `gorm:"column:open_status" json:"open_status"`
  51. Status int8 `json:"status"` // 状态 0.无效 1.有效 2.禁用
  52. CreateTime int64 `gorm:"column:ctime" json:"ctime"` // 创建时间
  53. ModifyTime int64 `gorm:"column:mtime" json:"mtime"` // 修改时间
  54. }
  55. func (OrgApp) TableName() string {
  56. return "sgj_user_org_app"
  57. }
  58. type OrgBan struct {
  59. ID int64 `gorm:"column:id" json:"id"`
  60. OrgId int64 `gorm:"column:org_id" json:"org_id"`
  61. Reason string `gorm:"column:reason" json:"reason"`
  62. Ctime int64 `gorm:"column:ctime" json:"ctime"`
  63. BanTime int64 `gorm:"column:ban_time" json:"ban_time"`
  64. Status int64 `gorm:"column:status" json:"status"`
  65. Mtime int64 `gorm:"column:mtime" json:"mtime"`
  66. }
  67. func (OrgBan) TableName() string {
  68. return "sgj_user_admin_org_ban"
  69. }
  70. type OrgType struct {
  71. ID int64 `gorm:"column:id" json:"id" form:"id"`
  72. Name string `gorm:"column:name" json:"name" form:"name"`
  73. ShortName string `gorm:"column:short_name" json:"short_name" form:"short_name"`
  74. Pid int64 `gorm:"column:pid" json:"pid" form:"pid"`
  75. Status int64 `gorm:"column:status" json:"status" form:"status"`
  76. CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
  77. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
  78. SortNo int64 `gorm:"column:sort_no" json:"sort_no" form:"sort_no"`
  79. }
  80. func (OrgType) TableName() string {
  81. return "sgj_user_org_type"
  82. }
  83. type Illness struct {
  84. ID int64 `gorm:"column:id" json:"id"`
  85. IllnessName string `gorm:"column:illness_name" json:"illness_name"`
  86. Status int64 `gorm:"column:status" json:"status"`
  87. CreatedTime int64 `gorm:"column:created_time" json:"created_time"`
  88. UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time"`
  89. }
  90. func (Illness) TableName() string {
  91. return "sgj_user_illness"
  92. }