model.go 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package model
  2. // ApPushTask struct of table link_push.ap_push_task
  3. type ApPushTask struct {
  4. ID int64 `json:"id"`
  5. Type int `json:"type"`
  6. TargetID int64 `json:"target_id"`
  7. AlertTitle string `json:"alert_title"`
  8. AlertBody string `json:"alert_body"`
  9. MidSource int `json:"mid_source"`
  10. LinkType int `json:"link_type"`
  11. LinkValue string `json:"link_value"`
  12. Total int `json:"total"`
  13. ExpireTime int `json:"expire_time"`
  14. Group string
  15. }
  16. // StartLiveMessage StartLiveNotify-T message
  17. type StartLiveMessage struct {
  18. TargetID int64 `json:"target_id"`
  19. Uname string `json:"uname"`
  20. LinkValue string `json:"link_value"`
  21. ExpireTime int `json:"expire_time"`
  22. RoomTitle string `json:"room_title"`
  23. }
  24. // LiveCommonMessage LivePushCommon-T message
  25. type LiveCommonMessage struct {
  26. Topic string `json:"topic"`
  27. MsgID string `json:"msg_id"`
  28. MsgKey string `json:"msg_key"`
  29. MsgContent LiveCommonMessageContent `json:"msg_content"`
  30. }
  31. // LiveCommonMessageContent LivePushCommon-T message.msg_content
  32. type LiveCommonMessageContent struct {
  33. Business int `json:"business"`
  34. Group string `json:"group"`
  35. Mids string `json:"mids"`
  36. AlertTitle string `json:"alert_title"`
  37. AlertBody string `json:"alert_body"`
  38. LinkValue string `json:"link_value"`
  39. LinkType int `json:"link_type"`
  40. ExpireTime int `json:"expire_time"`
  41. }
  42. // 直播开关DB相关配置
  43. const (
  44. LivePushType = 1001
  45. LivePushSwitchOn = 1
  46. LivePushConfigOn = 1
  47. PushIntervalKey = "push_interval"
  48. PushIntervalDefault = 1800
  49. )
  50. /**
  51. * 推送类型
  52. * 注意:这里复用这个常量定义,1 & 2是hbase中关系链的类型,但是RelationAll=3不是,这里只是个业务概念上的类型
  53. * 表示取所有关注数据
  54. */
  55. const (
  56. // RelationAttention 关注
  57. RelationAttention = iota + 1
  58. // RelationSpecial 特别关注
  59. RelationSpecial
  60. // RelationAll 关注+特别关注
  61. RelationAll
  62. )
  63. // 推送后台策略,DB中的记录
  64. const (
  65. StrategySwitch = "Switch" //开启推送开关
  66. StrategySpecial = "Special" //特别关注
  67. StrategyFans = "Fans" //关注
  68. StrategySwitchSpecial = "SwitchAndSpecial" //开启开关且特别关注
  69. )
  70. // 推送任务标记mid来源,组合来源则取交则可
  71. const (
  72. TaskSourceSwitch = 1
  73. TaskSourceSpecial = 2
  74. TaskSourceFans = 4
  75. TaskSourceSwitchSpe = 8
  76. )
  77. // 开播提醒消息的group信息
  78. const (
  79. AttentionGroup = "follow" // 关注
  80. SpecialGroup = "sfollow" // 特别关注
  81. ActivityAppointment = "activity_appointment" // 预约
  82. )
  83. // 业务business配置
  84. const (
  85. StartLiveBusiness = 1
  86. ActivityBusiness = 111
  87. )