web.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. package model
  2. import (
  3. bcmdl "go-common/app/service/main/broadcast/api/grpc/v1"
  4. )
  5. // Coin add type.
  6. const (
  7. CoinAddArcType = 1
  8. CoinAddArtType = 2
  9. CoinArcBusiness = "archive"
  10. CoinArtBusiness = "article"
  11. )
  12. var (
  13. // RankType rank type params
  14. RankType = map[int]string{
  15. 1: "all",
  16. 2: "origin",
  17. 3: "rookie",
  18. }
  19. // DayType day params
  20. DayType = map[int]int{
  21. 1: 1,
  22. 3: 3,
  23. 7: 7,
  24. 30: 30,
  25. }
  26. // ArcType arc params type all:0 and recent:1
  27. ArcType = map[int]int{
  28. 0: 0,
  29. 1: 1,
  30. }
  31. // IndexDayType rank index day type
  32. IndexDayType = []int{
  33. 1,
  34. 3,
  35. 7,
  36. }
  37. // OriType original or not
  38. OriType = []string{
  39. 0: "",
  40. 1: "_origin",
  41. }
  42. // AllType all or origin type
  43. AllType = []string{
  44. 0: "all",
  45. 1: "origin",
  46. }
  47. // TagIDs feedback tag ids
  48. TagIDs = []int64{
  49. 300, //播放卡顿
  50. 301, //进度条君无法调戏
  51. 302, //画音不同步
  52. 303, //弹幕无法加载/弹幕延迟
  53. 304, //出现浮窗广告
  54. 305, //无限小电视
  55. 306, //黑屏
  56. 307, //其他
  57. 354, //校园网无法访问
  58. }
  59. // LimitTypeIDs view limit type id
  60. LimitTypeIDs = []int16{13, 32, 33, 94, 120}
  61. // RecSpecTypeName recommend data special type name
  62. RecSpecTypeName = map[int32]string{
  63. 28: "原创",
  64. 30: "V家",
  65. 31: "翻唱",
  66. 59: "演奏",
  67. }
  68. // LikeType thumbup like type
  69. LikeType = map[int8]string{
  70. 1: "like",
  71. 2: "like_cancel",
  72. 3: "dislike",
  73. 4: "dislike_cancel",
  74. }
  75. // NewListRid new list need more rids
  76. NewListRid = map[int32]int32{
  77. 177: 37,
  78. 23: 147,
  79. 11: 185,
  80. }
  81. // DefaultServer broadcst servers default value.
  82. DefaultServer = &bcmdl.ServerListReply{
  83. Domain: "broadcast.chat.bilibili.com",
  84. TcpPort: 7821,
  85. WsPort: 7822,
  86. WssPort: 7823,
  87. Heartbeat: 30,
  88. Nodes: []string{"broadcast.chat.bilibili.com"},
  89. Backoff: &bcmdl.Backoff{
  90. MaxDelay: 300,
  91. BaseDelay: 3,
  92. Factor: 1.8,
  93. Jitter: 0.3,
  94. },
  95. HeartbeatMax: 3,
  96. }
  97. )
  98. // CheckFeedTag check if tagID in TagIDs
  99. func CheckFeedTag(tagID int64) bool {
  100. check := false
  101. for _, id := range TagIDs {
  102. if tagID == id {
  103. check = true
  104. break
  105. }
  106. }
  107. return check
  108. }