statistics.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package model
  2. import "go-common/library/time"
  3. // RatingStatis rating statistics
  4. type RatingStatis struct {
  5. Ups int64
  6. Section int64
  7. Tips string
  8. TotalScore int64
  9. CreativityScore int64
  10. InfluenceScore int64
  11. CreditScore int64
  12. Fans int64
  13. Avs int64
  14. Coin int64
  15. Play int64
  16. CDate time.Time
  17. TagID int64
  18. CType int
  19. }
  20. // Diff rating diff
  21. type Diff struct {
  22. MID int64
  23. MagneticScore int64
  24. CreativityScore int64
  25. InfluenceScore int64
  26. CreditScore int64
  27. MagneticDiff int
  28. CreativityDiff int
  29. InfluenceDiff int
  30. CreditDiff int
  31. TotalAvs int64
  32. Fans int64
  33. TagID int64
  34. CType int
  35. Section int
  36. Tips string
  37. Date time.Time
  38. }
  39. // TopRating top rating
  40. type TopRating struct {
  41. MID int64
  42. CType int
  43. TagID int64
  44. Score int64
  45. Play int64
  46. Fans int64
  47. }
  48. const (
  49. // MAGNETIC magnetic ctype
  50. MAGNETIC = iota
  51. // CREATIVITY creativity ctype
  52. CREATIVITY
  53. // INFLUENCE influence ctype
  54. INFLUENCE
  55. // CREDIT influence ctype
  56. CREDIT
  57. )
  58. // GetScore get score
  59. func (a *Diff) GetScore(ctype int) (score int64) {
  60. switch ctype {
  61. case MAGNETIC:
  62. return a.MagneticScore
  63. case CREATIVITY:
  64. return a.CreativityScore
  65. case INFLUENCE:
  66. return a.InfluenceScore
  67. case CREDIT:
  68. return a.CreditScore
  69. }
  70. return
  71. }