score.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package model
  2. import (
  3. "time"
  4. )
  5. // ScoreType .
  6. type ScoreType int8
  7. // ScoreType enums
  8. const (
  9. Magnetic ScoreType = iota
  10. Creativity
  11. Influence
  12. Credit
  13. )
  14. // RatingListArg .
  15. type RatingListArg struct {
  16. ScoreDate string `form:"score_date"` // 年月 "2006-01"
  17. Mid int64 `form:"mid"` // up id
  18. Tags []int64 `form:"tag_ids,split" validate:"required"` // 分区
  19. ScoreType ScoreType `form:"score_type" default:"0"` // 分数段类型
  20. ScoreMin int64 `form:"score_min"` // 左闭右开
  21. ScoreMax int64 `form:"score_max"` // 左闭右开
  22. From int64 `form:"from" default:"0" validate:"min=0"`
  23. Limit int64 `form:"limit" default:"20" validate:"min=1"`
  24. }
  25. // RatingListResp .
  26. type RatingListResp struct {
  27. Result []*RatingInfo `json:"result"`
  28. }
  29. // RatingInfo .
  30. type RatingInfo struct {
  31. Mid int64 `json:"mid"`
  32. TagID int `json:"tag_id"`
  33. ScoreDate time.Time `json:"-"`
  34. Date string `json:"date"`
  35. NickName string `json:"nickname"`
  36. TotalFans int64 `json:"total_fans"`
  37. TotalAvs int64 `json:"total_avs"`
  38. CreativityScore int64 `json:"creativity_score"`
  39. InfluenceScore int64 `json:"influence_score"`
  40. CreditScore int64 `json:"credit_score"`
  41. MagneticScore int64 `json:"magnetic_score"`
  42. }
  43. // Paging .
  44. type Paging struct {
  45. Ps int64 `json:"page_size"`
  46. Total int64 `json:"total"`
  47. }
  48. // UpRatingHistoryArg .
  49. type UpRatingHistoryArg struct {
  50. Mid int64 `form:"mid" validate:"required"`
  51. Month int `form:"month" default:"0" validate:"min=0"`
  52. ScoreType ScoreType `form:"score_type" default:"0"`
  53. }
  54. // UpRatingHistoryResp .
  55. type UpRatingHistoryResp struct {
  56. Data []*UpScoreHistory `json:"score_data"`
  57. }
  58. // UpScoreHistory .
  59. type UpScoreHistory struct {
  60. ScoreType ScoreType `json:"type"`
  61. Date []int64 `json:"date"`
  62. Score []int64 `json:"score"`
  63. }
  64. // ScoreCurrentResp .
  65. type ScoreCurrentResp struct {
  66. Date int64 `json:"date"`
  67. Credit *ScoreCurrent `json:"credit_score"`
  68. Influence *ScoreCurrent `json:"influence_score"`
  69. Creativity *ScoreCurrent `json:"creativity_score"`
  70. }
  71. // ScoreCurrent .
  72. type ScoreCurrent struct {
  73. Current int64 `json:"current"`
  74. Diff int64 `json:"diff"`
  75. }