sv.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package v1
  2. import (
  3. "go-common/app/interface/bbq/app-bbq/model"
  4. user "go-common/app/service/bbq/user/api"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. // SvListReq 列表参数
  8. type SvListReq struct {
  9. MID int64
  10. Base *Base
  11. RemoteIP string
  12. PageSize int64 `form:"pagesize" validate:"gt=0,max=20,required"`
  13. }
  14. // SvDetailReq 视频详情参数
  15. type SvDetailReq struct {
  16. SVID int64 `form:"svid" validate:"gt=0,required"`
  17. }
  18. // SvDetailResponse 视频详情返回
  19. type SvDetailResponse struct {
  20. IsLike bool `json:"is_like"`
  21. }
  22. //PlayListReq 批量获取playurl接口
  23. type PlayListReq struct {
  24. CIDs string `form:"cids" validate:"required"`
  25. MID int64
  26. Device *bm.Device
  27. RemoteIP string
  28. }
  29. // VideoResponse 返回视频结构
  30. type VideoResponse struct {
  31. model.SvInfo
  32. model.SvStInfo
  33. SVID int64 `json:"svid"`
  34. Tag string `json:"tag"` // 首选标签
  35. Tags []VideoTag `json:"tags,omitempty"` // 所有标签
  36. UserInfo user.UserBase `json:"user_info,omitempty"` // 用户信息
  37. Play VideoPlay `json:"play,omitempty"` // 播放信息
  38. IsLike bool `json:"is_like"` // 是否点赞
  39. QueryID string `json:"query_id"` // 推荐播放埋点字段,勿删!
  40. Extension string `json:"extension"` // 扩展字段,如title_extra等
  41. }
  42. //VideoTag 视屏标签
  43. type VideoTag struct {
  44. ID int64 `json:"id"`
  45. Name string `json:"name"`
  46. Type int16 `json:"type"`
  47. }
  48. // VideoPlay playinfo
  49. type VideoPlay struct {
  50. SVID int64 `json:"svid"`
  51. ExpireTime int64 `json:"expire_time"` //过期时间
  52. FileInfo []*FileInfo `json:"file_info"` //分片信息
  53. Quality int64 `json:"quality"` //清晰度
  54. SupportQuality []int64 `json:"support_quality"` //支持清晰度
  55. URL string `json:"url"` //基础url
  56. CurrentTime int64 `json:"current_time"` //当前时间戳
  57. }
  58. // CVideo bvc playurl结构
  59. type CVideo struct {
  60. CID int64 `json:"cid"`
  61. ExpireTime int64 `json:"expire_time"`
  62. FileInfo map[string][]*FileInfo `json:"file_info,omitempty"`
  63. Fnval int64 `json:"fnval"`
  64. Fnver int64 `json:"fnver"`
  65. Quality int64 `json:"quality"`
  66. SupportDescription []string `json:"support_description,omitempty"`
  67. SupportFormats []string `json:"support_formats,omitempty"`
  68. SupportQuality []int64 `json:"support_quality,omitempty"`
  69. URL string `json:"url"`
  70. VideoCodeCID int64 `json:"video_codecid"`
  71. VideoProject bool `json:"video_project"`
  72. }
  73. // FileInfo bvc fileinfo
  74. type FileInfo struct {
  75. Ahead string `json:"ahead"`
  76. FileSize int64 `json:"filesize"`
  77. TimeLength int64 `json:"timelength"`
  78. Vhead string `json:"vhead"`
  79. Path string `json:"path"`
  80. URL string `json:"url"`
  81. URLBc string `json:"url_bc"`
  82. }
  83. // SvStatRes 视频统计数据返回
  84. type SvStatRes struct {
  85. model.SvStInfo
  86. IsLike bool `json:"is_like"`
  87. FollowState int8 `json:"follow_state"`
  88. }
  89. //SvRelReq 相关推荐请求
  90. type SvRelReq struct {
  91. SVID int64 `form:"svid"`
  92. QueryID string `form:"query_id"`
  93. MID int64
  94. APP string
  95. APPVersion string
  96. Limit int32
  97. Offset int32
  98. BUVID string
  99. }