databus.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package archive
  2. import "encoding/json"
  3. const (
  4. //RouteFirstRound 一转
  5. RouteFirstRound = "first_round"
  6. //RouteUGCFirstRound 一转
  7. RouteUGCFirstRound = "ugc_first_round"
  8. //RouteSecondRound 二转
  9. RouteSecondRound = "second_round"
  10. //RouteAddArchive 新增稿件
  11. RouteAddArchive = "add_archive"
  12. //RouteModifyArchive 稿件编辑
  13. RouteModifyArchive = "modify_archive"
  14. //RouteAutoOpen 自动开放
  15. RouteAutoOpen = "auto_open"
  16. //RouteDelayOpen 定时开放
  17. RouteDelayOpen = "delay_open"
  18. //RoutePostFirstRound first_round后续处理
  19. RoutePostFirstRound = "post_first_round"
  20. )
  21. // Message databus message
  22. type Message struct {
  23. Action string `json:"action"`
  24. Table string `json:"table"`
  25. New json.RawMessage `json:"new"`
  26. Old json.RawMessage `json:"old"`
  27. }
  28. //VideoupMsg msg
  29. type VideoupMsg struct {
  30. Route string `json:"route"`
  31. Filename string `json:"filename"`
  32. Timestamp int64 `json:"timestamp"`
  33. // cid
  34. Cid int64 `json:"cid,omitempty"`
  35. DMIndex string `json:"dm_index,omitempty"`
  36. SendEmail bool `json:"send_email"`
  37. // encode
  38. Xcode int8 `json:"xcode"`
  39. EncodePurpose string `json:"encode_purpose,omitempty"`
  40. EncodeRegionID int16 `json:"encode_region_id,omitempty"`
  41. EncodeTypeID int16 `json:"encode_type_id,omitempty"`
  42. VideoDesign *VideoDesign `json:"video_design,omitempty"`
  43. Status int16 `json:"status,omitempty"`
  44. // add or modify archive
  45. Aid int64 `json:"aid,omitempty"`
  46. EditArchive bool `json:"edit_archive,omitempty"`
  47. EditVideo bool `json:"edit_video,omitempty"`
  48. // ChangeTypeID
  49. ChangeTypeID bool `json:"change_typeid"`
  50. // ChangeCopyright
  51. ChangeCopyright bool `json:"change_copyright"`
  52. // ChangeCover
  53. ChangeCover bool `json:"change_cover"`
  54. // ChangeTitle
  55. ChangeTitle bool `json:"change_title"`
  56. // Notify
  57. Notify bool `json:"send_notify"`
  58. // MissionID
  59. MissionID int64 `json:"mission_id,omitempty"`
  60. // AdminChange
  61. AdminChange bool `json:"admin_change,omitempty"`
  62. FromList string `json:"from_list"`
  63. TagChange bool `json:"tag_change,omitempty"`
  64. AddVideos bool `json:"add_videos,omitempty"`
  65. }
  66. //VideoDesign 自定义马赛克和水印
  67. type VideoDesign struct {
  68. Mosaic []*Mosaic `json:"mosaic,omitempty"`
  69. WaterMark []*WaterMark `json:"watermark,omitempty"`
  70. }
  71. //Mosaic 马赛克
  72. type Mosaic struct {
  73. X int64 `json:"x"`
  74. Y int64 `json:"y"`
  75. W int64 `json:"w"`
  76. H int64 `json:"h"`
  77. Start int64 `json:"start"`
  78. End int64 `json:"end"`
  79. }
  80. //WaterMark 水印
  81. type WaterMark struct {
  82. LOC int8 `json:"loc,omitempty"`
  83. URL string `json:"url,omitempty"`
  84. MD5 string `json:"md5,omitempty"`
  85. Start int64 `json:"start,omitempty"`
  86. End int64 `json:"end,omitempty"`
  87. X int64 `json:"x,omitempty"`
  88. Y int64 `json:"y,omitempty"`
  89. }