coin.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. package model
  2. import (
  3. "go-common/app/service/main/archive/api"
  4. "go-common/library/time"
  5. )
  6. var (
  7. // TypeNone none type
  8. TypeNone = 0
  9. // TypeSend send type
  10. TypeSend = 1
  11. // TypeReceive receive type
  12. TypeReceive = 2
  13. // ReportType 上报business
  14. ReportType = 21
  15. )
  16. // Record coin added record.
  17. type Record struct {
  18. Aid int64
  19. Mid int64
  20. Up int64
  21. Timestamp int64
  22. Multiply int64
  23. AvType int64
  24. Business string
  25. IP uint32
  26. IPV6 string
  27. }
  28. // AddedArchive archive info.
  29. type AddedArchive struct {
  30. *api.Arc
  31. IP string `json:"ip"`
  32. Time int64 `json:"time"`
  33. Coins int64 `json:"coins"`
  34. }
  35. // DataBus databus msg.
  36. type DataBus struct {
  37. Mid int64 `json:"mid"` // user id
  38. Avid int64 `json:"avid"` // archive id
  39. AvType int8 `json:"avtp"` // archive type
  40. UpID int64 `json:"upper_id"` // upper id
  41. Multiply int64 `json:"multiply"` // multiply
  42. Time time.Time `json:"time"` // archive pub date
  43. IP string `json:"ip"` // userip
  44. TypeID int16 `json:"rid"` // zone id
  45. Tags string `json:"tags"` // tag ids
  46. Ctime int64 `json:"ctime"` // add coin time
  47. MsgID string `json:"msg_id"` // unique msg id
  48. }
  49. // CoinSettle .
  50. type CoinSettle struct {
  51. ID int64 `json:"id"`
  52. Mid int64 `json:"mid"`
  53. Aid int64 `json:"aid"`
  54. CoinCount int64 `json:"coin_count"`
  55. ExpTotal int64 `json:"exp_total"`
  56. ExpSub int64 `json:"exp_sub"`
  57. State int `json:"state"`
  58. Describe string `json:"describe"`
  59. ITime time.Time `json:"itime"`
  60. CTime time.Time `json:"ctime"`
  61. MTime time.Time `json:"mtime"`
  62. }
  63. // CoinSettlePeriod .
  64. type CoinSettlePeriod struct {
  65. ID int64 `json:"id"`
  66. FromYear int `json:"from_year"`
  67. FromMonth int `json:"from_month"`
  68. FromDay int `json:"from_day"`
  69. ToYear int `json:"to_year"`
  70. ToMonth int `json:"to_month"`
  71. ToDay int `json:"to_day"`
  72. CTime time.Time `json:"ctime"`
  73. MTime time.Time `json:"mtime"`
  74. }
  75. // AddCoins .
  76. type AddCoins struct {
  77. Count int64 `json:"count"`
  78. }
  79. // Log coins log.
  80. type Log struct {
  81. From float64 `json:"from"`
  82. To float64 `json:"to"`
  83. IP string `json:"ip"`
  84. Desc string `json:"desc"`
  85. TimeStamp int64 `json:"timestamp"`
  86. }
  87. // LogExp log exp
  88. type LogExp struct {
  89. List []*Exp `json:"list"`
  90. Count int `json:"count"`
  91. }
  92. // Exp exp
  93. type Exp struct {
  94. Delta float64 `json:"delta"`
  95. Time string `json:"time"`
  96. Reason string `json:"reason"`
  97. }
  98. // List define coin added list.
  99. type List struct {
  100. Aid int64 `json:"aid,omitempty"`
  101. Multiply int64 `json:"multiply,omitempty"`
  102. Ts int64 `json:"ts,omitempty"`
  103. IP uint32 `json:"ip,omitempty"`
  104. }
  105. // Business .
  106. type Business struct {
  107. ID int64
  108. Name string
  109. AddCoinReason string
  110. AddCoinUpperReason string
  111. AddExpReason string
  112. }