data.go 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. package data
  2. import (
  3. xtime "go-common/library/time"
  4. "go-common/app/interface/main/creative/model/medal"
  5. )
  6. // Stat info
  7. type Stat struct {
  8. FanLast int64 `json:"fan_last"`
  9. Fan int64 `json:"fan"`
  10. DmLast int64 `json:"dm_last"`
  11. Dm int64 `json:"dm"`
  12. CommentLast int64 `json:"comment_last"`
  13. Comment int64 `json:"comment"`
  14. Play int64 `json:"play"`
  15. PlayLast int64 `json:"play_last"`
  16. Fav int64 `json:"fav"`
  17. FavLast int64 `json:"fav_last"`
  18. Like int64 `json:"like"`
  19. LikeLast int64 `json:"like_last"`
  20. Day30 map[string]int `json:"30,omitempty"`
  21. Arcs map[string][]*Arc `json:"arcs"`
  22. }
  23. // Arc Arcs info.
  24. type Arc struct {
  25. Aid int64 `json:"aid"`
  26. Title string `json:"title"`
  27. Click int64 `json:"click"`
  28. }
  29. // Tags Arcs info
  30. type Tags struct {
  31. Tags []string `json:"tags"`
  32. }
  33. // CheckedTag tags with checked
  34. type CheckedTag struct {
  35. Tag string `json:"tag"`
  36. Checked int `json:"checked"`
  37. }
  38. // AppStat arc stat.
  39. type AppStat struct {
  40. Date string `json:"date"`
  41. Num int64 `json:"num"`
  42. }
  43. // AppStatList for arc stat list.
  44. type AppStatList struct {
  45. Danmu []*AppStat `json:"danmu"`
  46. View []*AppStat `json:"view"`
  47. Fans []*AppStat `json:"fans"`
  48. Comment []*AppStat `json:"comment"`
  49. Show int8 `json:"show"`
  50. }
  51. // ViewerTrend for up trend data.
  52. type ViewerTrend struct {
  53. Tag map[int]string `json:"tag"`
  54. Ty map[string]int64 `json:"ty"`
  55. }
  56. // ViewerIncr for up increment data.
  57. type ViewerIncr struct {
  58. Arcs []*ArcInc `json:"arc_inc"`
  59. TotalIncr int `json:"total_inc"`
  60. TyRank map[string]int `json:"type_rank"`
  61. }
  62. // ArcInc for archive increment data.
  63. type ArcInc struct {
  64. AID int64 `json:"aid"`
  65. Incr int `json:"incr"`
  66. Title string `json:"title"`
  67. PTime xtime.Time `json:"ptime"`
  68. }
  69. // PeriodTip period tip for data.
  70. type PeriodTip struct {
  71. ModuleOne string `json:"module_one"`
  72. ModuleTwo string `json:"module_two"`
  73. ModuleThree string `json:"module_three"`
  74. ModuleFour string `json:"module_four"`
  75. }
  76. // AppViewerIncr for up increment data.
  77. type AppViewerIncr struct {
  78. DateKey int64 `json:"date_key"`
  79. Arcs []*ArcInc `json:"arc_inc"`
  80. TotalIncr int `json:"total_inc"`
  81. TyRank []*Rank `json:"type_rank"`
  82. }
  83. // ThirtyDay for 30 days data.
  84. type ThirtyDay struct {
  85. DateKey int64 `json:"date_key"`
  86. TotalIncr int64 `json:"total_inc"`
  87. }
  88. // Rank type rank for up data.
  89. type Rank struct {
  90. Name string `json:"name"`
  91. Rank int `json:"rank"`
  92. }
  93. // CreatorDataShow for display archive/article data module.
  94. type CreatorDataShow struct {
  95. Archive int `json:"archive"`
  96. Article int `json:"article"`
  97. }
  98. // AppFan for stat.
  99. type AppFan struct {
  100. Summary map[string]int64 `json:"summary"`
  101. }
  102. //for fan manager top mids.
  103. const (
  104. //Total 粉丝管理-累计数据
  105. Total = iota
  106. //Seven 粉丝管理-7日数据
  107. Seven
  108. //Thirty 粉丝管理-30日数据
  109. Thirty
  110. //Ninety 粉丝管理-90日数据
  111. Ninety
  112. //PlayDuration 播放时长
  113. PlayDuration = "video_play"
  114. //VideoAct 视频互动
  115. VideoAct = "video_act"
  116. //DynamicAct 动态互动
  117. DynamicAct = "dynamic_act"
  118. )
  119. // WebFan for stat.
  120. type WebFan struct {
  121. RankMap map[string]map[string]int32 `json:"-"`
  122. Summary map[string]int32 `json:"summary"`
  123. RankList map[string][]*RankInfo `json:"rank_list"`
  124. RankMedal map[string][]*medal.FansRank `json:"rank_medal"`
  125. Source map[string]int32 `json:"source"`
  126. }
  127. // RankInfo str
  128. type RankInfo struct {
  129. MID int64 `json:"mid"`
  130. Uname string `json:"uname"`
  131. Photo string `json:"photo"`
  132. }
  133. // PlaySource for play soucre.
  134. type PlaySource struct {
  135. PlayProportion map[string]int32 `json:"play_proportion"`
  136. PageSource map[string]int32 `json:"page_source"`
  137. }
  138. // ArchivePlay for archive play.
  139. type ArchivePlay struct {
  140. AID int64 `json:"aid"`
  141. View int32 `json:"view"`
  142. Rate int32 `json:"rate"`
  143. CTime int32 `json:"ctime"`
  144. Duration int64 `json:"duration"`
  145. AvgDuration int64 `json:"avg_duration"`
  146. Title string `json:"title"`
  147. }
  148. //ArchivePlayList for arc play list.
  149. type ArchivePlayList struct {
  150. ArcPlayList []*ArchivePlay `json:"arc_play_list"`
  151. }