report.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. package response
  2. import (
  3. "time"
  4. )
  5. type ReportDetail struct {
  6. ReportInfo *ReportItem `json:"report_info"`
  7. ReportChapterList []*ReportChapterListItem `json:"report_chapter_list"`
  8. PermissionCheck *PermissionCheckInfo `json:"permission_check"`
  9. AuthOk bool `json:"auth_ok"`
  10. LikeNum int64 `description:"点赞总数" json:"like_num"`
  11. LikeEnabled int8 `description:"是否已点赞: 0-未点赞 1-已点赞" json:"like_enabled"`
  12. ReportShowType int `descritpion:"展示形式:1-列表 2-专栏" json:"report_show_type"`
  13. }
  14. type ReportChapterListItem struct {
  15. ReportChapterId int `json:"report_chapter_id"`
  16. ReportId int `json:"report_id"`
  17. Title string `json:"title"`
  18. TypeId int `json:"type_id"`
  19. TypeName string `json:"type_name"`
  20. Trend string `json:"trend"`
  21. ReportChapterTypeKey string `json:"report_chapter_type_key"`
  22. ReportChapterTypeThumb string `json:"report_chapter_type_thumb"`
  23. ReportChapterTypeName string `json:"report_chapter_type_name"`
  24. Sort int `json:"sort"`
  25. PublishTime time.Time `json:"publish_time"`
  26. }
  27. type ReportItem struct {
  28. ReportId int `json:"report_id"`
  29. ClassifyNameFirst string `description:"一级分类名称" json:"classify_name_first"`
  30. ClassifyNameSecond string `description:"二级分类名称" json:"classify_name_second"`
  31. Title string `description:"标题" json:"title"`
  32. Abstract string `description:"摘要" json:"abstract"`
  33. Author string `description:"作者" json:"author"`
  34. Frequency string `description:"频度" json:"frequency"`
  35. PublishTime time.Time `description:"发布时间" json:"publish_time"`
  36. Stage int `description:"期数" json:"stage"`
  37. Content string `description:"内容" json:"content"`
  38. VideoUrl string `description:"音频文件URL" json:"video_url"`
  39. VideoName string `description:"音频文件名称" json:"video_name"`
  40. VideoSize string `description:"音频文件大小,单位M" json:"video_size"`
  41. VideoPlaySeconds string `description:"音频播放时长" json:"video_play_seconds"`
  42. VideoImg string `description:"音频播放条的图片" json:"video_img"`
  43. ContentSub string `description:"内容前两个章节" json:"content_sub"`
  44. BannerUrl string `description:"详情页banner" json:"banner_url"`
  45. }
  46. type ReportChapterItem struct {
  47. ReportChapterId int `json:"report_chapter_id"`
  48. ReportId int `json:"report_id"`
  49. Title string `json:"title"`
  50. Abstract string `json:"abstract"`
  51. TypeId int `json:"type_id"`
  52. TypeName string `json:"type_name"`
  53. Trend string `json:"trend"`
  54. ReportChapterTypeName string `json:"report_chapter_type_name"`
  55. PublishTime time.Time `json:"publish_time"`
  56. Content string `description:"内容" json:"content"`
  57. ContentSub string `description:"内容前两个章节" json:"content_sub"`
  58. VideoUrl string `json:"video_url"` //音频文件URL
  59. VideoName string `json:"video_name"` //音频文件名称
  60. VideoPlaySeconds string `json:"video_play_seconds"` //音频播放时长
  61. VideoSize string `json:"video_size"`
  62. VideoImg string `description:"音频播放条的图片" json:"video_img"`
  63. Author string `description:"作者" json:"author"`
  64. Stage int `description:"期数" json:"stage"`
  65. ClassifyIdFirst int `description:"一级分类id" json:"classify_id_first"`
  66. ClassifyNameFirst string `description:"一级分类名称" json:"classify_name_first"`
  67. }
  68. type ReportChapterDetail struct {
  69. ReportChapterItem *ReportChapterItem `json:"report_chapter_item"`
  70. PermissionCheck *PermissionCheckInfo `json:"permission_check"`
  71. ReportChapterMenuList []*ReportChapterMenu `json:"report_chapter_menu_list"`
  72. AuthOk bool `json:"auth_ok"`
  73. LikeNum int64 `description:"点赞总数" json:"like_num"`
  74. LikeEnabled int8 `description:"是否已点赞: 0-未点赞 1-已点赞" json:"like_enabled"`
  75. }
  76. type ReportChapterMenu struct {
  77. ReportChapterId int `json:"report_chapter_id"`
  78. ReportId int `json:"report_id"`
  79. ReportChapterTypeName string `json:"report_chapter_type_name"`
  80. ReportChapterTypeThumb string `json:"report_chapter_type_thumb"`
  81. PcSelectedThumb string `json:"pc_selected_thumb"`
  82. PcUnselectedThumb string `json:"pc_unselected_thumb"`
  83. Sort int `json:"sort"`
  84. }
  85. type ReportListItem struct {
  86. ReportId int `description:"报告Id" json:"report_id"`
  87. ClassifyIdFirst int `description:"一级分类id" json:"classify_id_first"`
  88. ClassifyNameFirst string `description:"一级分类名称" json:"classify_name_first"`
  89. ClassifyIdSecond int `description:"二级分类id" json:"classify_id_second"`
  90. ClassifyNameSecond string `description:"二级分类名称" json:"classify_name_second"`
  91. Title string `description:"标题" json:"title"`
  92. Abstract string `description:"摘要" json:"abstract"`
  93. Author string `description:"作者" json:"author"`
  94. ReportImgUrl string `description:"作者头像" json:"report_img_url"`
  95. PublishTime time.Time `description:"发布时间" json:"publish_time"`
  96. Stage int `description:"期数" json:"stage"`
  97. VideoList []*VideoListItem `json:"video_list"`
  98. AuthOk bool `json:"auth_ok"`
  99. TitleInfo string `json:"title_info"`
  100. }
  101. type VideoListItem struct {
  102. VideoUrl string `description:"音频文件URL" json:"video_url"`
  103. Sort int `description:"音频内容排序" json:"sort"`
  104. VideoName string `json:"video_name"` //音频文件名称
  105. VideoPlaySeconds string `json:"video_play_seconds"` //音频播放时长
  106. VideoImg string `json:"video_img"` // 音频播放条前面展示的图片
  107. }
  108. type ReportList struct {
  109. Paging *PagingItem `json:"paging"`
  110. List []*ReportListItem `json:"list"`
  111. }
  112. type ReportCollectListItem struct {
  113. ReportId int `description:"报告Id" json:"report_id"`
  114. ReportChapterId int `json:"report_chapter_id"`
  115. ClassifyIdFirst int `description:"一级分类id" json:"classify_id_first"`
  116. ClassifyNameFirst string `description:"一级分类名称" json:"classify_name_first"`
  117. ClassifyIdSecond int `description:"二级分类id" json:"classify_id_second"`
  118. ClassifyNameSecond string `description:"二级分类名称" json:"classify_name_second"`
  119. ReportChapterTypeId int `json:"report_chapter_type_id"`
  120. PublishTime time.Time `description:"发布时间" json:"publish_time"`
  121. Title string `description:"标题" json:"title"`
  122. ContentSub string `description:"内容前两个章节" json:"content_sub"`
  123. }
  124. type ReportCollectList struct {
  125. Date string `json:"date"`
  126. SubList []*ReportCollectListItem `json:"sub_list"`
  127. }
  128. type ReportCollectResp struct {
  129. Paging *PagingItem `json:"paging"`
  130. List []*ReportCollectList `json:"list"`
  131. }
  132. type ReportSearchResp struct {
  133. Paging *PagingItem `json:"paging"`
  134. List []*ReportCollectListItem `json:"list"`
  135. }
  136. type EsReportItem struct {
  137. Author string `description:"作者"`
  138. BodyContent string `description:"内容"`
  139. Categories string `description:"品种名称"`
  140. ClassifyIdFirst int `description:"一级分类id"`
  141. ClassifyNameFirst string `description:"一级分类名称"`
  142. ClassifyIdSecond int `description:"二级分类id"`
  143. ClassifyNameSecond string `description:"二级分类名称"`
  144. PublishState int `description:"1:未发布,2:已发布"`
  145. PublishTime string `description:"发布时间"`
  146. ReportChapterId int `description:"报告章节Id"`
  147. ReportId int `description:"报告Id"`
  148. Title string `description:"标题"`
  149. Abstract string `description:"摘要"`
  150. StageStr string `description:"期数"`
  151. }
  152. type TickerDataItem struct {
  153. Date string `json:"date"`
  154. Ticker string `json:"ticker"`
  155. BaseColumnName string `json:"base_column_name"`
  156. TickerValue float64 `json:"ticker_value"`
  157. LastValue float64 `json:"last_value"`
  158. DdValue float64 `json:"dd_value"`
  159. WwValue float64 `json:"ww_value"`
  160. MmValue float64 `json:"mm_value"`
  161. }
  162. type TickerTitleData struct {
  163. TickerTitle string `json:"ticker_title"`
  164. ReportChapterTypeId int `json:"report_chapter_type_id"`
  165. ReportChapterTypeName string `json:"report_chapter_type_name"`
  166. DataTableImage string `json:"data_table_image"`
  167. }
  168. type TickerData struct {
  169. List []*TickerDataItem `json:"list"`
  170. TickerTitle *TickerTitleData `json:"ticker_title"`
  171. }
  172. type ReportCollectListResp []*ReportCollectList
  173. func (p ReportCollectListResp) Len() int {
  174. return len(p)
  175. }
  176. func (p ReportCollectListResp) Less(i, j int) bool {
  177. return p[i].Date > p[j].Date
  178. }
  179. func (p ReportCollectListResp) Swap(i, j int) {
  180. p[i], p[j] = p[j], p[i]
  181. }
  182. type ReportChapterList []*ReportChapterListItem
  183. func (r ReportChapterList) Len() int {
  184. return len(r)
  185. }
  186. func (r ReportChapterList) Less(i, j int) bool {
  187. return r[i].Sort < r[j].Sort
  188. }
  189. func (r ReportChapterList) Swap(i, j int) {
  190. r[i], r[j] = r[j], r[i]
  191. }
  192. type ReportChapterMenuList []*ReportChapterMenu
  193. func (rc ReportChapterMenuList) Len() int {
  194. return len(rc)
  195. }
  196. func (rc ReportChapterMenuList) Less(i, j int) bool {
  197. return rc[i].Sort < rc[j].Sort
  198. }
  199. func (rc ReportChapterMenuList) Swap(i, j int) {
  200. rc[i], rc[j] = rc[j], rc[i]
  201. }