sso

org_models.go 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. package models
  2. type Org struct {
  3. Id int `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"` // 机构 ID
  4. Creator int `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 int `json:"province"` // 省,代号,下面的市、区也一样
  10. City int `json:"city"`
  11. District int `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. BusinessTime string `gorm:"column:business_time" json:"business_time"`
  24. BusinessWeek string `gorm:"column:business_week" json:"business_week"`
  25. Gallery string `gorm:"column:gallery" json:"gallery"`
  26. OrgGallery []*OrgGallery `gorm:"ForeignKey:OrgId" json:"org_gallery"`
  27. }
  28. func (Org) TableName() string {
  29. return "sgj_user_org"
  30. }
  31. type Illness struct {
  32. Id int `gorm:"PRIMARY_KEY;AUTO_INCREMENT"`
  33. IllnessName string `gorm:"colunm:illness_name"`
  34. Status int8 // 状态 0.无效 1.有效 2.禁用
  35. CreateTime int64 `gorm:"column:created_time"` // 创建时间
  36. ModifyTime int64 `gorm:"column:updated_time"` // 修改时间
  37. }
  38. func (Illness) TableName() string {
  39. return "sgj_user_illness"
  40. }
  41. type OrgType struct {
  42. ID int64 `gorm:"column:id" json:"id" form:"id"`
  43. Name string `gorm:"column:name" json:"name" form:"name"`
  44. ShortName string `gorm:"column:short_name" json:"short_name" form:"short_name"`
  45. Pid int64 `gorm:"column:pid" json:"-"`
  46. Status int64 `gorm:"column:status" json:"-"`
  47. CreatedTime int64 `gorm:"column:created_time" json:"-"`
  48. UpdatedTime int64 `gorm:"column:updated_time" json:"-"`
  49. }
  50. func (OrgType) TableName() string {
  51. return "sgj_user_org_type"
  52. }
  53. type ServeSubscibe struct {
  54. ID int64 `gorm:"column:id" json:"id"`
  55. OrgId int64 `gorm:"column:org_id" json:"org_id"`
  56. PeriodStart int64 `gorm:"column:period_start" json:"period_start"`
  57. PeriodEnd int64 `gorm:"column:period_end" json:"period_end"`
  58. Status int64 `gorm:"column:status" json:"status"`
  59. CreatedTime int64 `gorm:"column:created_time" json:"-"`
  60. UpdatedTime int64 `gorm:"column:updated_time" json:"-"`
  61. State int64 `gorm:"column:state" json:"state" form:"statstateus"`
  62. }
  63. func (ServeSubscibe) TableName() string {
  64. return "sgj_serve_subscibe"
  65. }
  66. type OrgGallery struct {
  67. ID int64 `gorm:"column:id" json:"id" form:"id"`
  68. Url string `gorm:"column:url" json:"url" form:"url"`
  69. Type int64 `gorm:"column:type" json:"type" form:"type"`
  70. OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
  71. UserId int64 `gorm:"column:user_id" json:"user_id" form:"user_id"`
  72. Status int64 `gorm:"column:status" json:"status" form:"status"`
  73. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  74. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  75. }
  76. func (OrgGallery) TableName() string {
  77. return "sgj_user_org_gallery"
  78. }