param.go 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. package param
  2. import (
  3. "github.com/mhaya/game/game_cluster/internal/data"
  4. )
  5. type LoginReq struct {
  6. Pid int `json:"pid"`
  7. OpenID string `json:"openid"`
  8. NickName string `json:"nickName"`
  9. IP string `json:"ip"`
  10. }
  11. type LoginResp struct {
  12. UserName string `json:"userName" bson:"userName"`
  13. OpenId string `json:"openId" bson:"openId"`
  14. TargetPath string `json:"targetPath" bson:"-"`
  15. }
  16. type GuideReq struct {
  17. Close int `json:"close"`
  18. CloseReward int `json:"closeReward"`
  19. Status int32 `json:"status"`
  20. }
  21. type GuideResp struct {
  22. Guide int `json:"guide"`
  23. FirstReward int `json:"firstReward"`
  24. Rolled int `json:"rolled"`
  25. FollowChannel int32 `json:"followChannel"`
  26. AddItem map[int]*data.ItemReward `json:"addItem"`
  27. SubItem map[int]*data.ItemReward `json:"subItem"`
  28. }
  29. type RollReq struct {
  30. Multi int `json:"multi"`
  31. }
  32. type RollResp struct {
  33. ChangeData
  34. Multi int `json:"multi"`
  35. Xcode string `json:"xcode"`
  36. Rolls []Roll `json:"rolls"`
  37. }
  38. type DrawResp struct {
  39. ChangeData
  40. Multi int `json:"multi"`
  41. Draws []*DrawConfig `json:"draws"`
  42. }
  43. type GetRankReq struct {
  44. Id int `json:"id"` //排行榜ID
  45. Tp int `json:"tp"` //是否是上一期榜单1是0否
  46. }
  47. type GetRankResp struct {
  48. Ranks map[int]*PlayerBase `json:"ranks"`
  49. Self *PlayerBase `json:"self"`
  50. }
  51. type DrawConfig struct {
  52. ID int `json:"id"`
  53. ItemID int `json:"itemId"`
  54. Num int `json:"num"`
  55. }
  56. type GetRankRewardReq struct {
  57. Id int `json:"id"` //排行榜ID
  58. }
  59. type DrawReq struct {
  60. Tp int `json:"tp"` //1单抽2 10连抽
  61. }
  62. type ShareReq struct {
  63. Tp int `json:"tp"` //1 每日抽奖分享
  64. }
  65. type JumpReq struct {
  66. Tp int `json:"tp"` //1 关注推特 2 加入TG频道 3 关注Yutube账号 4 加入DC频道
  67. }
  68. type SaveXReq struct {
  69. Twitter string `json:"twitter"`
  70. }
  71. type SaveTonWallReq struct {
  72. TonWall string `json:"tonWall"`
  73. }
  74. type InviteReq struct {
  75. ParentName string `json:"parentName"`
  76. Type int `json:"type"` //2普通邀请3VIP邀请
  77. }
  78. type GetLevelResp struct {
  79. NowLevel int `json:"nowLevel"`
  80. NextLevel int `json:"nextLevel"`
  81. NextRoll int `json:"nextRoll"`
  82. NextInvite int `json:"nextInvite"`
  83. NowRoll int `json:"nowRoll"`
  84. NowInvite int `json:"nowInvite"`
  85. }
  86. type ClaimReq struct {
  87. Tp int `json:"tp"` //类型 1榜单奖励 2邀请奖励 3成就奖励 4日常奖励
  88. Id int `json:"id"`
  89. }
  90. type PlayerBase struct {
  91. UserName string `json:"userName"`
  92. OpenId string `json:"openId"`
  93. UserNameMaybe string `json:"userNameMaybe"`
  94. NickName string `json:"nickName"`
  95. IsLeader int `json:"-"`
  96. Rank int `json:"rank"`
  97. Score int `json:"score"`
  98. Avatar string `json:"avatar"`
  99. IsClaim int `json:"isClaim"`
  100. Reward []data.ItemReward `json:"reward"`
  101. }
  102. type RollOnce struct {
  103. IsLevelUp bool `json:"isLevelUp"`
  104. IsDailyTask bool `json:"isDaily"`
  105. Roll
  106. }
  107. type ChangeData struct {
  108. IsLevelUp bool `json:"isLevelUp"`
  109. IsDailyTask bool `json:"isDaily"`
  110. IsAchieveTask bool `json:"isAchieveTask"`
  111. AddItem map[int]*data.ItemReward `json:"addItem"`
  112. SubItem map[int]*data.ItemReward `json:"subItem"`
  113. }
  114. type Draw struct {
  115. ID int `json:"id"`
  116. CurID int `json:"-"`
  117. Reward []data.ItemReward `json:"reward"`
  118. }
  119. type Roll struct {
  120. Score int `json:"score"`
  121. RollType int `json:"rollType"`
  122. Rand map[int]int32 `json:"rand"`
  123. }