research_report.go 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package research_report
  2. import "time"
  3. // ResearchReport 研究报告表
  4. type ResearchReport struct {
  5. ResearchReportID uint64 `gorm:"primaryKey;column:research_report_id;type:bigint(20) unsigned;not null" json:"-"` // 研究报告id
  6. ResearchReportName string `gorm:"index:research_report_name;column:research_report_name;type:varchar(128)" json:"researchReportName"` // 研究报告名称
  7. ResearchReportTitle string `gorm:"index:research_report_title;column:research_report_title;type:varchar(128)" json:"researchReportTitle"` // 研究报告标题
  8. ResearchReportImg string `gorm:"column:research_report_img;type:varchar(128)" json:"researchReportImg"` // 报告缩略图URL
  9. ResearchReportDate time.Time `gorm:"column:research_report_date;type:date;not null" json:"researchReportDate"` // 报告日期
  10. Type string `gorm:"column:type;type:varchar(32);default:day" json:"type"` // day 晨报 week 周报 twoweek双周报 month 月报
  11. Author string `gorm:"column:author;type:varchar(100)" json:"author"` // 报告作者
  12. ReportVariety string `gorm:"column:report_variety;type:varchar(30)" json:"reportVariety"` // 研究报告的品种,双周报和月报有标识
  13. IsHasMenu int8 `gorm:"column:is_has_menu;type:tinyint(1);default:0" json:"isHasMenu"` // 报告是否含有目录
  14. IsSendedMsg int8 `gorm:"column:is_sended_msg;type:tinyint(1);default:0" json:"isSendedMsg"` // 是否发送过模板消息
  15. Periods int `gorm:"column:periods;type:int(8)" json:"periods"` // 期数
  16. Status string `gorm:"column:status;type:varchar(20);not null" json:"status"` // 状态,draft:草稿,
  17. Enabled int8 `gorm:"index:enabled;column:enabled;type:tinyint(1);default:1" json:"enabled"` // 报告状态
  18. CreatedTime time.Time `gorm:"index:created_time;column:created_time;type:datetime;default:CURRENT_TIMESTAMP" json:"createdTime"` // 创建时间
  19. LastUpdatedTime time.Time `gorm:"index:last_updated_time;column:last_updated_time;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"lastUpdatedTime"`
  20. Viewers int `gorm:"column:viewers;type:int(8);default:0" json:"viewers"` // H5观看用户数
  21. }
  22. // TableName get sql table name.获取数据库表名
  23. func (m *ResearchReport) TableName() string {
  24. return "research_report"
  25. }
  26. // ResearchReportColumns get sql column name.获取数据库列名
  27. var ResearchReportColumns = struct {
  28. ResearchReportID string
  29. ResearchReportName string
  30. ResearchReportTitle string
  31. ResearchReportImg string
  32. ResearchReportDate string
  33. Type string
  34. Author string
  35. ReportVariety string
  36. IsHasMenu string
  37. IsSendedMsg string
  38. Periods string
  39. Status string
  40. Enabled string
  41. CreatedTime string
  42. LastUpdatedTime string
  43. Viewers string
  44. }{
  45. ResearchReportID: "research_report_id",
  46. ResearchReportName: "research_report_name",
  47. ResearchReportTitle: "research_report_title",
  48. ResearchReportImg: "research_report_img",
  49. ResearchReportDate: "research_report_date",
  50. Type: "type",
  51. Author: "author",
  52. ReportVariety: "report_variety",
  53. IsHasMenu: "is_has_menu",
  54. IsSendedMsg: "is_sended_msg",
  55. Periods: "periods",
  56. Status: "status",
  57. Enabled: "enabled",
  58. CreatedTime: "created_time",
  59. LastUpdatedTime: "last_updated_time",
  60. Viewers: "viewers",
  61. }