param.go 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. package archive
  2. import (
  3. "encoding/json"
  4. "go-common/library/time"
  5. )
  6. // ArcVideos 稿件及其所属视频
  7. type ArcVideos struct {
  8. Archive *Archive `json:"archive"`
  9. Videos []*Video `json:"videos"`
  10. }
  11. //UpArchives upper主的稿件ID和个数
  12. type UpArchives struct {
  13. Count int64 `json:"count"`
  14. Aids []int64 `json:"aids"`
  15. }
  16. // ArcMissionParam str
  17. type ArcMissionParam struct {
  18. AID int64 `form:"aid" validate:"required"`
  19. MID int64 `form:"mid" validate:"required"`
  20. MissionID int64 `form:"mission_id" validate:"required"`
  21. Tag string `form:"tag"`
  22. }
  23. // ArcDynamicParam str
  24. type ArcDynamicParam struct {
  25. AID int64 `form:"aid" validate:"required"`
  26. MID int64 `form:"mid" validate:"required"`
  27. }
  28. //ArcParam 提交的稿件参数
  29. type ArcParam struct {
  30. Aid int64 `json:"aid"`
  31. Mid int64 `json:"mid"`
  32. Author string `json:"author"`
  33. TypeID int16 `json:"tid"`
  34. Title string `json:"title"`
  35. Cover string `json:"cover"`
  36. Tag string `json:"tag"`
  37. Copyright int8 `json:"copyright"`
  38. Desc string `json:"desc"`
  39. AllowTag int32 `json:"allow_tag"`
  40. NoReprint int32 `json:"no_reprint"`
  41. UGCPay int32 `json:"ugcpay"`
  42. MissionID int64 `json:"mission_id"`
  43. FromIP int64 `json:"from_ip"`
  44. IPv6 []byte `json:"ipv6"`
  45. UpFrom int8 `json:"up_from"`
  46. Source string `json:"source"`
  47. DTime time.Time `json:"dtime"`
  48. Videos []*VideoParam `json:"videos"`
  49. Staffs []*StaffParam `json:"staffs"`
  50. HandleStaff bool `json:"handle_staff"`
  51. CodeMode bool `json:"code_mode"`
  52. OrderID int64 `json:"order_id"`
  53. FlowRemark string `json:"flow_remark"`
  54. Dynamic string `json:"dynamic"`
  55. IsDRM int8 `json:"is_drm"`
  56. DescFormatID int64 `json:"desc_format_id"`
  57. Porder *Porder `json:"porder"`
  58. POI *PoiObj `json:"poi_object"`
  59. Vote *Vote `json:"vote"`
  60. Lang string `json:"lang"`
  61. }
  62. //Porder str
  63. type Porder struct {
  64. // for user operation
  65. FlowID int64 `json:"flow_id"`
  66. IndustryID int64 `json:"industry_id"`
  67. BrandID int64 `json:"brand_id"`
  68. BrandName string `json:"brand_name"`
  69. Official int8 `json:"official"`
  70. ShowType string `json:"show_type"`
  71. // for admin operation
  72. Advertiser string `json:"advertiser"`
  73. Agent string `json:"agent"`
  74. //state 0 自首 1 审核添加
  75. State int8 `json:"state"`
  76. }
  77. //VideoParam 提交的视频参数
  78. type VideoParam struct {
  79. Title string `json:"title"`
  80. Desc string `json:"desc"`
  81. Filename string `json:"filename"`
  82. Cid int64 `json:"cid"`
  83. Sid int64 `json:"sid"`
  84. SrcType string `json:"src_type"`
  85. IsDRM int8 `json:"is_drm"`
  86. Editor *Editor `json:"editor"`
  87. }
  88. // Editor str
  89. type Editor struct {
  90. CID int64 `json:"cid"`
  91. UpFrom int8 `json:"upfrom"` // filled by backend
  92. // ids set
  93. Filters interface{} `json:"filters"` // 滤镜
  94. Fonts interface{} `json:"fonts"` //字体
  95. Subtitles interface{} `json:"subtitles"` //字幕
  96. Bgms interface{} `json:"bgms"` //bgm
  97. Stickers interface{} `json:"stickers"` //3d拍摄贴纸
  98. VideoupStickers interface{} `json:"videoup_stickers"` //2d投稿贴纸
  99. Transitions interface{} `json:"trans"` //视频转场特效
  100. // switch env 0/1
  101. Split int8 `json:"split"` //视频切片
  102. Cut int8 `json:"cut"` //拿时间窗口切子集
  103. VideoRotate int8 `json:"rotate"` //画面坐标轴变换
  104. AudioRecord int8 `json:"audio_record"` //录音
  105. Camera int8 `json:"camera"` //拍摄
  106. Speed int8 `json:"speed"` //变速
  107. Beauty int8 `json:"beauty"` //美颜特效
  108. Flashlight int8 `json:"flashlight"` //闪光灯
  109. CameraRotate int8 `json:"camera_rotate"` //摄像头翻转
  110. CountDown int8 `json:"countdown"` //拍摄倒计时
  111. }
  112. // UnmarshalJSON fn
  113. func (vp *VideoParam) UnmarshalJSON(data []byte) (err error) {
  114. type VpAlias VideoParam
  115. tmp := &VpAlias{SrcType: "vupload"}
  116. if err = json.Unmarshal(data, tmp); err != nil {
  117. return err
  118. }
  119. *vp = VideoParam(*tmp)
  120. return
  121. }
  122. //PubAgentParam 提交的视频参数
  123. type PubAgentParam struct {
  124. Route string `json:"route"`
  125. Timestamp string `json:"timestamp"`
  126. Filename string `json:"filename"`
  127. Xcode int8 `json:"xcode"`
  128. VideoDesign string `json:"video_design"`
  129. Submit int8 `json:"submit"`
  130. }