topic.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package v1
  2. import topic "go-common/app/service/bbq/topic/api"
  3. // TopicVideo 话题视频的结构
  4. type TopicVideo struct {
  5. *VideoResponse
  6. CursorValue string `json:"cursor_value"` // 透传给客户端,标记在列表中的位置
  7. HotType int64 `json:"hot_type"` // 热门类型,直接用topic给的数据
  8. }
  9. //TopicDetail 话题详情页,可作为详情页回包,也可作为发现页话题列表的item
  10. type TopicDetail struct {
  11. HasMore bool `json:"has_more"`
  12. TopicInfo *topic.TopicInfo `json:"topic_info,omitempty"`
  13. List []*TopicVideo `json:"list,omitempty"`
  14. }
  15. // DiscoveryRes 发现页返回结构
  16. type DiscoveryRes struct {
  17. BannerList []*Banner `json:"banner_list"`
  18. HotWords []string `json:"hot_words"`
  19. TopicList []*TopicDetail `json:"topic_list"`
  20. HasMore bool `json:"has_more"`
  21. }
  22. // Banner Banner结构
  23. type Banner struct {
  24. ID int64 `json:"id"`
  25. Name string `json:"name"`
  26. Type int16 `json:"type"`
  27. Scheme string `json:"scheme"`
  28. PIC string `json:"pic"`
  29. }
  30. //DiscoveryReq 发现页请求
  31. type DiscoveryReq struct {
  32. Page int32 `form:"page" validate:"gt=0,required"`
  33. }
  34. // TopicSearchReq 话题搜索请求
  35. type TopicSearchReq struct {
  36. Page int32 `form:"page" validate:"gt=0,required"`
  37. Keyword string `from:"keyword"`
  38. }
  39. // TopicSearchResponse 话题搜索回包
  40. type TopicSearchResponse struct {
  41. HasMore bool `json:"has_more"`
  42. List []*topic.TopicInfo `json:"list,omitempty"`
  43. }