viewer.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. package datamodel
  2. //for fan manager top mids.
  3. const (
  4. //Total 粉丝管理-累计数据
  5. Total = iota
  6. //Seven 粉丝管理-7日数据
  7. Seven
  8. //Thirty 粉丝管理-30日数据
  9. Thirty
  10. //Ninety 粉丝管理-90日数据
  11. Ninety
  12. //PlayDuration 播放时长
  13. PlayDuration = "video_play"
  14. //VideoAct 视频互动
  15. VideoAct = "video_act"
  16. //DynamicAct 动态互动
  17. DynamicAct = "dynamic_act"
  18. )
  19. /* ------------- */
  20. //ViewerTypeData type's play count
  21. type ViewerTypeData struct {
  22. Tid int `json:"tid"`
  23. Name string `json:"name"`
  24. Play int64 `json:"play"`
  25. }
  26. //ViewerTagData viewer tag struct
  27. type ViewerTagData struct {
  28. Idx int `json:"idx"`
  29. TagID int `json:"tag_id"`
  30. Name string `json:"name"`
  31. }
  32. //ViewerTypeTagInfo struct for viewer type and tag
  33. type ViewerTypeTagInfo struct {
  34. Type []*ViewerTypeData `json:"type"`
  35. Tag []*ViewerTagData `json:"tag"`
  36. }
  37. // ViewerTrendInfo struct for viewer trend
  38. type ViewerTrendInfo struct {
  39. Fans *ViewerTypeTagInfo `json:"fans"`
  40. Guest *ViewerTypeTagInfo `json:"guest"`
  41. }
  42. /* ------------- */
  43. //ViewerAreaData viewer area data
  44. type ViewerAreaData struct {
  45. Area string `json:"area"`
  46. Viewers int64 `json:"viewers"`
  47. }
  48. //ViewerAreaInfo viewer area info
  49. type ViewerAreaInfo struct {
  50. Fans []ViewerAreaData `json:"fans"`
  51. Guest []ViewerAreaData `json:"guest"`
  52. }
  53. /* ------------- */
  54. //ViewerBaseData base data
  55. //f:plat0 web-pc播放
  56. //f:plat1 web-h5播放
  57. //f:plat2 站外播放
  58. //f:plat3 ios播放
  59. //f:plat4 android播放
  60. type ViewerBaseData struct {
  61. Male int64 `json:"male"`
  62. Female int64 `json:"female"`
  63. Age1 int64 `json:"age_1"` //0~16岁
  64. Age2 int64 `json:"age_2"` // 16~25
  65. Age3 int64 `json:"age_3"` //25~40
  66. Age4 int64 `json:"age_4"` // 40+
  67. PlatPC int64 `json:"plat_pc"` // pc
  68. PlatH5 int64 `json:"plat_h5"` // h5
  69. PlatOut int64 `json:"plat_out"` // 站外播放
  70. PlatIOS int64 `json:"plat_ios"` // ios播放
  71. PlatAndroid int64 `json:"plat_android"` // android播放
  72. PlatOtherApp int64 `json:"plat_other_app"` // 其他播放
  73. }
  74. //ViewerBaseInfo base info
  75. type ViewerBaseInfo struct {
  76. Fans *ViewerBaseData `json:"fans"`
  77. Guest *ViewerBaseData `json:"guest"`
  78. }
  79. /* ------------- */
  80. //FanSummaryData fans summary data
  81. type FanSummaryData struct {
  82. Total int32 `json:"total" family:"f" qualifier:"all"` // 粉丝总数
  83. Active int32 `json:"active" family:"f" qualifier:"act"` // 活跃粉丝数
  84. Inc int32 `json:"inc" family:"f" qualifier:"inc"` // 新增粉丝
  85. Medal int32 `json:"medal" family:"f" qualifier:"mdl"` // 领取勋章粉丝
  86. Elec int32 `json:"elec" family:"f" qualifier:"elec"` //充电粉丝
  87. MedalDiff int32 `json:"medal_diff" family:"f" qualifier:"mdl_diff"` //活跃粉丝(增量)
  88. ActiveDiff int32 `json:"active_diff" family:"f" qualifier:"act_diff"` //领取勋章粉丝(增量)
  89. ElecDiff int32 `json:"elec_diff" family:"f" qualifier:"elec_diff"` //充电粉丝(增量)
  90. Inter int32 `json:"inter" family:"f" qualifier:"inter"` //观看活跃度*10000
  91. ViewPercent int32 `json:"view_percent" family:"f" qualifier:"v"` //播放粉丝占比*10000
  92. DmPercent int32 `json:"dm_percent" family:"f" qualifier:"da"` //弹幕粉丝占比*10000
  93. ReplyPercent int32 `json:"reply_percent" family:"f" qualifier:"re"` //评论粉丝占比*10000
  94. CoinPercent int32 `json:"coin_percent" family:"f" qualifier:"co"` //投币粉丝占比*10000
  95. FavorPercent int32 `json:"favor_percent" family:"f" qualifier:"fv"` //收藏粉丝占比*10000
  96. SharePercent int32 `json:"share_percent" family:"f" qualifier:"sh"` //分享粉丝占比*10000
  97. LikePercent int32 `json:"like_percent" family:"f" qualifier:"lk"` //点赞粉丝占比*10000
  98. }
  99. //FanInfo fans info
  100. type FanInfo struct {
  101. Summary FanSummaryData `json:"summary"`
  102. }
  103. //RelationFanHistoryData data for relation fans follow and unfollow
  104. type RelationFanHistoryData struct {
  105. FollowData map[string]int `family:"a"`
  106. UnfollowData map[string]int `family:"u"`
  107. }