statistics.go 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. package model
  2. import (
  3. arcmodel "go-common/app/service/main/archive/model/archive"
  4. xtime "go-common/library/time"
  5. )
  6. const (
  7. // TopDataLenth .
  8. TopDataLenth int = 5
  9. )
  10. // DataType .
  11. type DataType int8
  12. // DataType 数据类型,1累计,2昨日,3上周,4上月
  13. /* ENUM(
  14. Accumulate = 1
  15. Day = 2
  16. Week = 3
  17. Month = 4
  18. ActiveFans = 5
  19. )*/
  20. const (
  21. // DataTypeAccumulate is a DataType of type Accumulate
  22. DataTypeAccumulate DataType = 1
  23. // DataTypeDay is a DataType of type Day
  24. DataTypeDay DataType = 2
  25. // DataTypeWeek is a DataType of type Week
  26. DataTypeWeek DataType = 3
  27. // DataTypeMonth is a DataType of type Month
  28. DataTypeMonth DataType = 4
  29. // DataTypeActiveFans active fans
  30. DataTypeActiveFans DataType = 5
  31. )
  32. // DataViewTypeSummary .
  33. type DataViewTypeSummary int8
  34. const (
  35. // SignUpsAccumulate signed up accumulate amount.
  36. SignUpsAccumulate DataViewTypeSummary = 1
  37. // FansIncr signed up fans incr amount.
  38. FansIncr DataViewTypeSummary = 2
  39. // VideoUpsIncr signed up videoup incr amount.
  40. VideoUpsIncr DataViewTypeSummary = 3
  41. // PlaysIncr signed up paly incr amount.
  42. PlaysIncr DataViewTypeSummary = 4
  43. )
  44. // DataViewFansTop .
  45. type DataViewFansTop int8
  46. const (
  47. // McnFansIncr .
  48. McnFansIncr DataViewFansTop = 1
  49. // McnFansIncrRate .
  50. McnFansIncrRate DataViewFansTop = 2
  51. // UpFansIncr .
  52. UpFansIncr DataViewFansTop = 3
  53. // UpFansIncrRate .
  54. UpFansIncrRate DataViewFansTop = 4
  55. )
  56. // MCNDataSummary .
  57. type MCNDataSummary struct {
  58. ID int64 `json:"id"`
  59. MCNID int64 `json:"mcn_mid"`
  60. SignID int64 `json:"sign_id"`
  61. UPCount int64 `json:"up_count"`
  62. FansCountAccumulate int64 `json:"fans_count_accumulate"`
  63. FansCountOnline int64 `json:"fans_count_online"`
  64. FansCountReal int64 `json:"fans_count_real"`
  65. FansCountCheat int64 `json:"fans_count_cheat"`
  66. FansCountCheatAccumulate int64 `json:"fans_count_cheat_accumulate"`
  67. FansCountIncreaseDay int64 `json:"fans_count_increase_day"`
  68. PlayCountAccumulate int64 `json:"play_count_accumulate"`
  69. PlayCountIncreaseDay int64 `json:"play_count_increase_day"`
  70. ArchiveCountAccumulate int64 `json:"archive_count_accumulate"`
  71. ArchiveCountIncreaseDay int64 `json:"archive_count_increase_day"`
  72. ActiveTID int64 `json:"active_tid"`
  73. GenerateDate xtime.Time `json:"generate_date"`
  74. Ctime xtime.Time `json:"ctime"`
  75. Mtime xtime.Time `json:"mtime"`
  76. }
  77. // MCNDataUP .
  78. type MCNDataUP struct {
  79. ID int64 `json:"id"`
  80. MCNID int64 `json:"mcn_mid"`
  81. SignID int64 `json:"sign_id"`
  82. UPMID int64 `json:"up_mid"`
  83. DataType int8 `json:"data_type"`
  84. FansCountAll int64 `json:"fans_count_all"`
  85. FansCountActive int64 `json:"fans_count_active"`
  86. FansIncreaseAccumulate int64 `json:"fans_increase_accumulate"`
  87. ArchiveCount int64 `json:"archive_count"`
  88. PlayCount int64 `json:"play_count"`
  89. FansIncreaseMonth int64 `json:"fans_increase_month"`
  90. GenerateDate xtime.Time `json:"generate_date"`
  91. Ctime xtime.Time `json:"ctime"`
  92. Mtime xtime.Time `json:"mtime"`
  93. }
  94. // MCNDataArchiveRank .
  95. type MCNDataArchiveRank struct {
  96. ID int64 `json:"id"`
  97. MCNID int64 `json:"mcn_mid"`
  98. SignID int64 `json:"sign_id"`
  99. ArchiveID int64 `json:"archive_id"`
  100. ArchiveTitle string `json:"archive_title"`
  101. UPMID int64 `json:"up_mid"`
  102. LikeCountAccumulate int64 `json:"like_count_accumulate"`
  103. LikeCountIncrease int64 `json:"like_count_increase"`
  104. PlayCountIncrease int64 `json:"play_count_increase"`
  105. DataType int8 `json:"data_type"`
  106. TID int64 `json:"tid"`
  107. CtimeArchive xtime.Time `json:"ctime_archive"`
  108. Ctime xtime.Time `json:"ctime"`
  109. Mtime xtime.Time `json:"mtime"`
  110. }
  111. // RankDataBase 基本排行信息
  112. type RankDataBase struct {
  113. Tid int16 `json:"tid"`
  114. DataType DataType `json:"data_type"`
  115. }
  116. // TidnameInfo tid name
  117. type TidnameInfo struct {
  118. Tid int16 `json:"tid"`
  119. Name string `json:"name"`
  120. }
  121. // RankArchiveLikeInfo archive like rank info
  122. type RankArchiveLikeInfo struct {
  123. RankDataBase
  124. ArchiveID int64 `json:"archive_id"` // 稿件ID
  125. ArchiveTitle string `json:"archive_title"`
  126. Pic string `json:"pic"` // 封面
  127. TidName string `json:"tid_name"`
  128. LikesIncrease int64 `json:"likes_increase"`
  129. LikesAccumulate int64 `json:"likes_accumulate"`
  130. PlayIncrease int64 `json:"play_increase"`
  131. PlayAccumulate int64 `json:"play_accumulate"`
  132. Ctime xtime.Time `json:"ctime"`
  133. Stat arcmodel.Stat3 `json:"stat"` // 统计信息
  134. Author arcmodel.Author3 `json:"author"` // up主信息
  135. }
  136. // TotalMcnDataInfo .
  137. type TotalMcnDataInfo struct {
  138. BaseInfo *McnDataOverview `json:"base_info"`
  139. TopInfo *McnDataTopInfo `json:"top_info"`
  140. TypesInfo *McnDataTypesInfo `json:"types_info"`
  141. }
  142. // McnDataTopInfo .
  143. type McnDataTopInfo struct {
  144. McnFansIncr []*FansRankIncr `json:"mcn_fans_incr"`
  145. McnFansRateIncr []*FansRankIncr `json:"mcn_fans_rate_incr"`
  146. UpFansIncr []*FansRankIncr `json:"up_fans_incr"`
  147. UpFansRateIncr []*FansRankIncr `json:"up_fans_rate_incr"`
  148. ArcLikesIncr []*LikesRankIncr `json:"arc_likes_incr"`
  149. }
  150. // FansRankIncr .
  151. type FansRankIncr struct {
  152. SignID int64 `json:"sign_id"`
  153. Mid int64 `json:"mid"`
  154. Name string `json:"name"`
  155. Rank int16 `json:"rank"`
  156. FansIncr int64 `json:"fans_incr"`
  157. Fans int64 `json:"fans"`
  158. RateIncr int64 `json:"rate_incr"`
  159. }
  160. // LikesRankIncr .
  161. type LikesRankIncr struct {
  162. McnMid int64 `json:"mcn_mid"`
  163. McnName string `json:"mcn_name"`
  164. UpMid int64 `json:"up_mid"`
  165. UpName string `json:"up_name"`
  166. AVID int64 `json:"avid"`
  167. AVTitle string `json:"av_title"`
  168. TID int16 `json:"tid"`
  169. TypeName string `json:"type_name"`
  170. LikesIncr int64 `json:"likes_incr"`
  171. PlayIncr int64 `json:"play_incr"`
  172. SignID int64 `json:"sign_id"`
  173. }
  174. // McnDataTypesInfo .
  175. type McnDataTypesInfo struct {
  176. SignUps []*DataTypes `json:"sign_ups"`
  177. FansIncr []*DataTypes `json:"fans_incr"`
  178. VideoupIncr []*DataTypes `json:"videoup_incr"`
  179. PlayIncr []*DataTypes `json:"play_incr"`
  180. }
  181. // DataTypes .
  182. type DataTypes struct {
  183. TID int16 `json:"tid"`
  184. TypeName string `json:"type_name"`
  185. Total int64 `json:"total"`
  186. Amount int64 `json:"amount"`
  187. Rate int64 `json:"rate"`
  188. }
  189. // McnDataOverview base data.
  190. type McnDataOverview struct {
  191. Mcns int64 `json:"mcns"`
  192. SignUps int64 `json:"sign_ups"`
  193. SignUpsIncr int64 `json:"sign_ups_incr"`
  194. Fans50 int64 `json:"fans_50"`
  195. Fans10 int64 `json:"fans_10"`
  196. Fans1 int64 `json:"fans_1"`
  197. FansIncr50 int64 `json:"fans_incr_50"`
  198. FansIncr10 int64 `json:"fans_incr_10"`
  199. FansIncr1 int64 `json:"fans_incr_1"`
  200. }
  201. // McnRankFansOverview top5 data.
  202. type McnRankFansOverview struct {
  203. ID int64 `json:"id"`
  204. SignID int64 `json:"sign_id"`
  205. Mid int64 `json:"mid"`
  206. DataView int8 `json:"data_view"`
  207. DataType int8 `json:"data_type"`
  208. Rank int16 `json:"rank"`
  209. FansIncr int64 `json:"fans_incr"`
  210. Fans int64 `json:"fans"`
  211. GenerateDate xtime.Time `json:"generate_date"`
  212. Ctime xtime.Time `json:"ctime"`
  213. Mtime xtime.Time `json:"mtime"`
  214. }
  215. // McnDataTypeSummary tids data.
  216. type McnDataTypeSummary struct {
  217. ID int64 `json:"id"`
  218. Tid int16 `json:"tid"`
  219. DataView int8 `json:"data_view"`
  220. DataType int8 `json:"data_type"`
  221. Amount int64 `json:"amount"`
  222. GenerateDate xtime.Time `json:"generate_date"`
  223. Ctime xtime.Time `json:"ctime"`
  224. Mtime xtime.Time `json:"mtime"`
  225. }
  226. // McnRankArchiveLikesOverview total mcn arc rank likes top
  227. type McnRankArchiveLikesOverview struct {
  228. ID int64 `json:"id"`
  229. McnMid int64 `json:"mcn_mid"`
  230. UpMid int64 `json:"up_mid"`
  231. SignID int64 `json:"sign_id"`
  232. Avid int64 `json:"avid"`
  233. Tid int16 `json:"tid"`
  234. Rank int16 `json:"rank"`
  235. DataType int8 `json:"data_type"`
  236. Likes int64 `json:"likes"`
  237. Plays int64 `json:"plays"`
  238. GenerateDate xtime.Time `json:"generate_date"`
  239. Ctime xtime.Time `json:"ctime"`
  240. Mtime xtime.Time `json:"mtime"`
  241. }