report_chapter.go 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // ReportChapter 报告章节
  7. type ReportChapter struct {
  8. ReportChapterId int `orm:"column(report_chapter_id);pk" description:"报告章节ID"`
  9. ReportId int `description:"报告ID"`
  10. ReportType string `description:"报告类型 day-晨报 week-周报"`
  11. ClassifyIdFirst int `description:"一级分类id"`
  12. ClassifyNameFirst string `description:"一级分类名称"`
  13. TypeId int `description:"品种ID"`
  14. TypeName string `description:"品种名称"`
  15. Title string `description:"标题"`
  16. Abstract string `description:"摘要"`
  17. AddType int `description:"新增方式:1:新增报告,2:继承报告"`
  18. Author string `description:"作者"`
  19. Content string `description:"内容"`
  20. ContentSub string `description:"内容前两个章节"`
  21. Stage int `description:"期数"`
  22. Trend string `description:"趋势观点"`
  23. Sort int `description:"排序: 数值越小越靠前"`
  24. IsEdit int `description:"是否已编辑 0-待编辑 1-已编辑"`
  25. PublishState int `description:"发布状态 1-待发布,2-已发布"`
  26. PublishTime time.Time `description:"发布时间"`
  27. VideoUrl string `description:"音频文件URL"`
  28. VideoName string `description:"音频文件名称"`
  29. VideoPlaySeconds string `description:"音频播放时长"`
  30. VideoSize string `description:"音频文件大小,单位M"`
  31. VideoKind int `description:"音频生成方式:1,手动上传,2:自动生成"`
  32. CreateTime string `description:"创建时间"`
  33. ModifyTime time.Time `description:"修改时间"`
  34. OriginalVideoUrl string `description:"原始音频文件URL"`
  35. }
  36. type ReportChapterResp struct {
  37. ReportChapterId int `description:"报告章节ID"`
  38. ReportId int `description:"报告ID"`
  39. ReportType string `description:"报告类型 day-晨报 week-周报"`
  40. TypeId int `description:"品种ID"`
  41. TypeName string `description:"品种名称"`
  42. TypeEditImg string `description:"后台编辑时的图片"`
  43. Title string `description:"标题"`
  44. Abstract string `description:"摘要"`
  45. Author string `description:"作者"`
  46. Content string `description:"内容"`
  47. ContentSub string `description:"内容前两个章节"`
  48. Stage int `description:"期数"`
  49. Trend string `description:"趋势观点"`
  50. Sort int `description:"排序: 数值越小越靠前"`
  51. IsEdit int `description:"是否已编辑 0-待编辑 1-已编辑"`
  52. PublishState int `description:"发布状态 1-待发布,2-已发布"`
  53. VideoUrl string `description:"音频文件URL"`
  54. VideoName string `description:"音频文件名称"`
  55. VideoPlaySeconds string `description:"音频播放时长"`
  56. VideoSize string `description:"音频文件大小,单位M"`
  57. VideoKind int `description:"音频生成方式:1,手动上传,2:自动生成"`
  58. PublishTime string `description:"发布时间"`
  59. CreateTime string `description:"创建时间"`
  60. ModifyTime string `description:"修改时间"`
  61. }
  62. // ReportChapterReq 报告章节id
  63. type ReportChapterReq struct {
  64. ReportChapterId int `description:"报告章节ID"`
  65. }
  66. // GetReportChapterInfoById 根据主键获取报告章节
  67. func GetReportChapterInfoById(reportChapterId int) (item *ReportChapter, err error) {
  68. o := orm.NewOrmUsingDB("rddp")
  69. sql := ` SELECT * FROM report_chapter WHERE report_chapter_id = ? `
  70. err = o.Raw(sql, reportChapterId).QueryRow(&item)
  71. return
  72. }
  73. // UpdateChapter 更新报表章节
  74. func (chapterInfo *ReportChapter) UpdateChapter(cols []string) (err error) {
  75. o := orm.NewOrmUsingDB("rddp")
  76. _, err = o.Update(chapterInfo, cols...)
  77. return
  78. }