message.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. package message
  2. import (
  3. "encoding/json"
  4. "go-common/app/job/main/videoup/model/archive"
  5. )
  6. //RouteVideocovers routes.
  7. const (
  8. // bvc
  9. RouteVideocovers = "videocovers"
  10. RouteBFSVideocovers = "bfs_videocovers"
  11. RouteUploadInfo = "upload_info"
  12. RouteXcodeSdFinish = "xcode_sd_finish"
  13. RouteXcodeSDFail = "xcode_sd_fail"
  14. RouteXcodeHDFinish = "xcode_hd_finish"
  15. RouteXcodeHDFail = "xcode_hd_fail"
  16. RouteDispatchRunning = "dispatch_running"
  17. RouteDispatchFinish = "dispatch_finish"
  18. RouteVideoshotpv = "bfs_videoshotpv"
  19. // videoup
  20. RouteSyncCid = "sync_cid"
  21. RouteFirstRound = "first_round"
  22. RouteUGCFirstRound = "ugc_first_round"
  23. RouteSecondRound = "second_round"
  24. RouteAddArchive = "add_archive"
  25. RouteModifyArchive = "modify_archive"
  26. RouteModifyVideo = "modify_video"
  27. RouteDeleteArchive = "delete_archive"
  28. RouteDeleteVideo = "delete_video"
  29. RouteDelayOpen = "delay_open"
  30. RouteAutoOpen = "auto_open"
  31. RouteForceSync = "force_sync"
  32. RouteFirstRoundForbid = "first_round_forbid"
  33. RoutePostFirstRound = "post_first_round"
  34. // bvc video_capable
  35. CanPlay = 0
  36. CanNotPlay = 1
  37. )
  38. // BvcVideo from bvc video info.
  39. type BvcVideo struct {
  40. Route string `json:"route"`
  41. Filename string `json:"filename"`
  42. Timestamp int64 `json:"timestamp"`
  43. // covers
  44. Count int `json:"count,omitempty"`
  45. URLFormat string `json:"url_format,omitempty"`
  46. Deadline int64 `json:"deadline,omitempty"`
  47. // video
  48. Filesize int64 `json:"filesize,omitempty"`
  49. Duration int64 `json:"duration,omitempty"`
  50. Width int64 `json:"width,omitempty"`
  51. Height int64 `json:"height,omitempty"`
  52. Rotate int8 `json:"rotate,omitempty"`
  53. PlayURL string `json:"playurl,omitempty"`
  54. FailInfo string `json:"failinfo,omitempty"`
  55. Resolutions string `json:"resolutions,omitempty"`
  56. BinURL string `json:"bin_url"`
  57. ImgURLs []string `json:"img_urls"`
  58. }
  59. // ArcResult archive result databus message
  60. type ArcResult struct {
  61. Action string `json:"action"`
  62. Table string `json:"table"`
  63. New json.RawMessage `json:"new"`
  64. Old json.RawMessage `json:"old"`
  65. }
  66. // Videoup from videoup api.
  67. type Videoup struct {
  68. Route string `json:"route"`
  69. Filename string `json:"filename"`
  70. Timestamp int64 `json:"timestamp"`
  71. // cid
  72. Cid int64 `json:"cid,omitempty"`
  73. // encode
  74. Xcode int8 `json:"xcode,omitempty"`
  75. EncodePurpose string `json:"encode_purpose,omitempty"`
  76. EncodeRegionID int16 `json:"encode_region_id,omitempty"`
  77. Status int16 `json:"status,omitempty"`
  78. // modify archive
  79. Aid int64 `json:"aid,omitempty"`
  80. EditArchive bool `json:"edit_archive,omitempty"`
  81. EditVideo bool `json:"edit_video,omitempty"`
  82. // second_round
  83. Reply int `json:"reply,omitempty"`
  84. IsSendNotify bool `json:"send_notify,omitempty"`
  85. // ChangeTypeID
  86. ChangeTypeID bool `json:"change_typeid,omitempty"`
  87. // ChangeCopyright
  88. ChangeCopyright bool `json:"change_copyright,omitempty"`
  89. // ChangeCover
  90. ChangeCover bool `json:"change_cover,omitempty"`
  91. // ChangeTitle
  92. ChangeTitle bool `json:"change_title,omitempty"`
  93. MissionID int64 `json:"mission_id,omitempty"`
  94. AdminChange bool `json:"admin_change,omitempty"`
  95. }
  96. // BlogCardMsg 粉丝动态databus消息
  97. type BlogCardMsg struct {
  98. Card *archive.BlogCard `json:"card"`
  99. }
  100. // StatMsg from archive stat.
  101. type StatMsg struct {
  102. Type string
  103. ID int64
  104. Count int
  105. Timestamp int64
  106. }