entity.go 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. package yb_community_question
  2. import (
  3. "time"
  4. )
  5. const (
  6. // 回复状态
  7. ReplyStatusDitribute = 1
  8. ReplyStatusWait = 2
  9. ReplyStatusDone = 3
  10. ReplyStatusStop = 4
  11. )
  12. // YbCommunityQuestion 研报-问答社区表
  13. type YbCommunityQuestion struct {
  14. CommunityQuestionID int `gorm:"primaryKey;column:community_question_id;type:int(10) unsigned;not null" json:"-"`
  15. UserID int `gorm:"index:idx_user_id;column:user_id;type:int(10) unsigned;not null;default:0" json:"userId"` // 提问用户ID
  16. UserOpenid string `gorm:"column:user_openid;type:varchar(32);not null;default:''" json:"userOpenid"` // 提问人openid
  17. Mobile string `gorm:"column:mobile;type:varchar(20);not null;default:''" json:"mobile"` // 用户手机号
  18. RealName string `gorm:"column:real_name;type:varchar(100);not null;default:''" json:"realName"` // 用户名
  19. QuestionContent string `gorm:"column:question_content;type:varchar(255);not null;default:''" json:"questionContent"` // 问题描述
  20. ReplierUserID int `gorm:"index:idx_replier_user_id;column:replier_user_id;type:int(10) unsigned;not null;default:0" json:"replierUserId"` // 回复人的user_id
  21. ReplierOpenid string `gorm:"column:replier_openid;type:varchar(32);not null;default:''" json:"replierOpenid"` // 回复人openid
  22. ReplierAdminID int `gorm:"column:replier_admin_id;type:int(10) unsigned;not null;default:0" json:"replierAdminId"` // 回复人关联的admin_id
  23. ReplierRealName string `gorm:"column:replier_real_name;type:varchar(30);not null;default:''" json:"replierRealName"` // 回复人姓名
  24. ReplierAvatar string `gorm:"column:replier_avatar;type:varchar(255);not null;default:''" json:"replierAvatar"` // 回复人头像
  25. ResearchGroupFirstID int `gorm:"column:research_group_first_id;type:int(10) unsigned;not null;default:0" json:"researchGroupFirstId"` // 回复人研究方向一级分组ID
  26. ResearchGroupSecondID int `gorm:"column:research_group_second_id;type:int(10) unsigned;not null;default:0" json:"researchGroupSecondId"` // 回复人研究方向二级分组ID
  27. ResearchGroupFirstName string `gorm:"column:research_group_first_name;type:varchar(100);not null;default:''" json:"researchGroupFirstName"` // 研究方向一级分组名称
  28. ResearchGroupSecondName string `gorm:"column:research_group_second_name;type:varchar(100);not null;default:''" json:"researchGroupSecondName"` // 研究方向二级分组名称
  29. DistributeAdminID int `gorm:"column:distribute_admin_id;type:int(10) unsigned;not null;default:0" json:"distributeAdminId"` // 分配人admin_id
  30. DistributeTime time.Time `gorm:"column:distribute_time;type:datetime" json:"distributeTime"` // 分配时间
  31. VarietyTagID int `gorm:"index:idx_variety_tag_id;column:variety_tag_id;type:int(10) unsigned;not null;default:0" json:"varietyTagId"` // 标签ID
  32. VarietyTagName string `gorm:"column:variety_tag_name;type:varchar(100);not null;default:''" json:"varietyTagName"` // 标签名称
  33. IsRead int `gorm:"column:is_read;type:tinyint(4) unsigned;not null;default:0" json:"isRead"` // 用户是否已读 0-未读 1-已读
  34. ReplierIsRead int `gorm:"column:replier_is_read;type:tinyint(4) unsigned;not null;default:0" json:"replierIsRead"` // 回复者是否已读 0-未读 1-已读
  35. ReplyStatus int `gorm:"column:reply_status;type:tinyint(4) unsigned;not null;default:0" json:"replyStatus"` // 回复状态 1-待分配 2-待回答 3-已回答 4-已终止
  36. MsgSendStatus int `gorm:"column:msg_send_status;type:tinyint(4) unsigned;not null;default:0" json:"msgSendStatus"` // 消息推送进度 0-待推送 1-已推送回答人 2-已推送提问人
  37. ReplyTime time.Time `gorm:"column:reply_time;type:datetime" json:"replyTime"` // 回复时间
  38. CreateTime time.Time `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP" json:"createTime"` // 提问时间
  39. ModifyTime time.Time `gorm:"column:modify_time;type:datetime;default:CURRENT_TIMESTAMP" json:"modifyTime"` // 修改时间
  40. IsDeleted int `gorm:"column:is_deleted;type:tinyint(4) unsigned;not null;default:0" json:"isDeleted"` // 是否已删除 0-否 1-是
  41. DeleteTime time.Time `gorm:"column:delete_time;type:datetime" json:"deleteTime"` // 删除时间
  42. StopReason string `gorm:"column:stop_reason;type:varchar(255);not null;default:''" json:"stopReason"` // 终止原因
  43. }
  44. // TableName get sql table name.获取数据库表名
  45. func (m *YbCommunityQuestion) TableName() string {
  46. return "yb_community_question"
  47. }
  48. // YbCommunityQuestionColumns get sql column name.获取数据库列名
  49. var YbCommunityQuestionColumns = struct {
  50. CommunityQuestionID string
  51. UserID string
  52. UserOpenid string
  53. Mobile string
  54. RealName string
  55. QuestionContent string
  56. ReplierUserID string
  57. ReplierOpenid string
  58. ReplierAdminID string
  59. ReplierRealName string
  60. ReplierAvatar string
  61. ResearchGroupFirstID string
  62. ResearchGroupSecondID string
  63. ResearchGroupFirstName string
  64. ResearchGroupSecondName string
  65. DistributeAdminID string
  66. DistributeTime string
  67. VarietyTagID string
  68. VarietyTagName string
  69. IsRead string
  70. ReplierIsRead string
  71. ReplyStatus string
  72. MsgSendStatus string
  73. ReplyTime string
  74. CreateTime string
  75. ModifyTime string
  76. IsDeleted string
  77. DeleteTime string
  78. }{
  79. CommunityQuestionID: "community_question_id",
  80. UserID: "user_id",
  81. UserOpenid: "user_openid",
  82. Mobile: "mobile",
  83. RealName: "real_name",
  84. QuestionContent: "question_content",
  85. ReplierUserID: "replier_user_id",
  86. ReplierOpenid: "replier_openid",
  87. ReplierAdminID: "replier_admin_id",
  88. ReplierRealName: "replier_real_name",
  89. ReplierAvatar: "replier_avatar",
  90. ResearchGroupFirstID: "research_group_first_id",
  91. ResearchGroupSecondID: "research_group_second_id",
  92. ResearchGroupFirstName: "research_group_first_name",
  93. ResearchGroupSecondName: "research_group_second_name",
  94. DistributeAdminID: "distribute_admin_id",
  95. DistributeTime: "distribute_time",
  96. VarietyTagID: "variety_tag_id",
  97. VarietyTagName: "variety_tag_name",
  98. IsRead: "is_read",
  99. ReplierIsRead: "replier_is_read",
  100. ReplyStatus: "reply_status",
  101. MsgSendStatus: "msg_send_status",
  102. ReplyTime: "reply_time",
  103. CreateTime: "create_time",
  104. ModifyTime: "modify_time",
  105. IsDeleted: "is_deleted",
  106. DeleteTime: "delete_time",
  107. }