friend.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. package msg
  2. // 0未添加 1已申请未通过 2已是好友
  3. const (
  4. FriendStatusNotAdded int64 = iota // 未添加
  5. FriendStatusPendingApproval // 已申请未通过
  6. FriendStatusAlreadyFriends // 已是好友
  7. )
  8. // GetFriendList 获取好友列表信息
  9. type GetFriendList struct {
  10. PlayerId int64 `json:"userId"`
  11. }
  12. type ResponseGetFriendList struct {
  13. ErrCode int `json:"errCode"`
  14. Msg string `json:"msg,omitempty"`
  15. Data FriendStatus `json:"data"`
  16. }
  17. type FriendStatus struct {
  18. Friends []*PlayerNickImg `json:"friends"`
  19. GiveTimes int `json:"give"` // 已赠送次数
  20. ReceiveTimes int `json:"receive"` // 已领取次数
  21. }
  22. type PlayerNickImg struct {
  23. PlayerId int64 `json:"playerId"`
  24. HeadId int64 `json:"headId"` //头像
  25. FrameId int64 `json:"frameId"` //头像框
  26. Nick string `json:"nick"` //昵称
  27. Level int64 `json:"level"` //等级
  28. ServerId int64 `json:"serverId"` //服务器id
  29. Online int64 `json:"online"` //在线状态
  30. LastLoginTick int64 `json:"lastLoginTick"` //上次登录时间
  31. Give int64 `json:"give"` //赠送状态
  32. Receive int64 `json:"receive"` //领取状态
  33. }
  34. // RequestAddFriend 添加好友请求
  35. type RequestAddFriend struct {
  36. PlayerId int64 `json:"userId"`
  37. Recipients []int64 `json:"recipients"`
  38. }
  39. type ResponseRequestAddFriend struct {
  40. ErrCode int `json:"errCode"`
  41. Msg string `json:"msg,omitempty"`
  42. Data []int64 `json:"data"`
  43. }
  44. // ReviewAddFriend 审批好友请求
  45. type ReviewAddFriend struct {
  46. PlayerId int64 `json:"userId"`
  47. Agrees []int64 `json:"agrees"`
  48. Rejects []int64 `json:"rejects"`
  49. }
  50. type ResponseReviewAddFriend struct {
  51. ErrCode int `json:"errCode"`
  52. Msg string `json:"msg,omitempty"`
  53. Data ReviewAddFriendData `json:"data"`
  54. }
  55. type ReviewAddFriendData struct {
  56. Agrees []int64 `json:"agrees"`
  57. Rejects []int64 `json:"rejects"`
  58. }
  59. // GiveStamina 赠送体力
  60. type GiveStamina struct {
  61. PlayerId int64 `json:"userId"`
  62. FriendIds []int64 `json:"friendIds"` // 赠送的好友Id
  63. }
  64. type ResponseGiveStamina struct {
  65. ErrCode int `json:"errCode"`
  66. Msg string `json:"msg,omitempty"`
  67. Data GiveStaminaData `json:"data"`
  68. }
  69. type GiveStaminaData struct {
  70. GivePlayerIds []int64 `json:"givePlayerIds"` // 赠送的好友Id
  71. GiveCount int `json:"giveCount"` // 赠送次数
  72. }
  73. // ReceiveStamina 获取体力
  74. type ReceiveStamina struct {
  75. PlayerId int64 `json:"userId"`
  76. Friends []int64 `json:"friendIds"` // 赠送的好友Id
  77. }
  78. type ResponseReceiveStamina struct {
  79. ErrCode int `json:"errCode"`
  80. Msg string `json:"msg,omitempty"`
  81. Data *ReceiveStaminaData `json:"data"`
  82. }
  83. type ReceiveStaminaData struct {
  84. Friends []int64 `json:"friendIds"` // 赠送的好友Id
  85. Materials map[int64]int64 `json:"materials"` // 体力
  86. }
  87. // FriendRequestList 获取申请列表信息
  88. type FriendRequestList struct {
  89. PlayerId int64 `json:"userId"`
  90. }
  91. type ResponseFriendRequestList struct {
  92. ErrCode int `json:"errCode"`
  93. Msg string `json:"msg,omitempty"`
  94. Data []*ApplyInfo `json:"data"`
  95. }
  96. type ApplyInfo struct {
  97. PlayerId int64 `json:"playerId"`
  98. CreateTs int64 `json:"createTs"`
  99. HeadId int64 `json:"headId"` //头像
  100. FrameId int64 `json:"frameId"` //头像框
  101. Nick string `json:"nick"` //昵称
  102. Level int64 `json:"level"` //等级
  103. ServerId int64 `json:"serverId"` //服务器id
  104. }
  105. // RefreshCandidateFriends 刷新待选好友列表
  106. type RefreshCandidateFriends struct {
  107. PlayerId int64 `json:"userId"`
  108. }
  109. type ResponseRefreshCandidateFriends struct {
  110. ErrCode int `json:"errCode"`
  111. Msg string `json:"msg,omitempty"`
  112. Data []*CandidateFriend `json:"data"`
  113. }
  114. type RefreshCandidateFriendsData struct {
  115. CreateTs int64 `json:"createTs"` // 申请时间
  116. PlayerId int64 `json:"playerId"`
  117. HeadId int64 `json:"headId"` //头像
  118. FrameId int64 `json:"frameId"` //头像框
  119. Nick string `json:"nick"` //昵称
  120. Level int64 `json:"level"` //等级
  121. ServerId int64 `json:"serverId"` //服务器id
  122. Online int64 `json:"online"` //在线状态
  123. }
  124. // SearchCandidateFriends 查找玩家
  125. type SearchCandidateFriends struct {
  126. PlayerId int64 `json:"userId"`
  127. Search string `json:"search"`
  128. }
  129. type ResponseSearchCandidateFriends struct {
  130. ErrCode int `json:"errCode"`
  131. Msg string `json:"msg,omitempty"`
  132. Data []*CandidateFriend `json:"data"`
  133. }
  134. type CandidateFriend struct {
  135. PlayerId int64 `json:"playerId"`
  136. HeadId int64 `json:"headId"` //头像
  137. FrameId int64 `json:"frameId"` //头像框
  138. Nick string `json:"nick"` //昵称
  139. Level int64 `json:"level"` //等级
  140. ServerId int64 `json:"serverId"` //服务器id
  141. Online int64 `json:"online"` //在线状态
  142. LastLoginTick int64 `json:"lastLoginTick"` //上次登录时间
  143. FriendStatus int64 `json:"friendStatus"` // 0未添加 1已申请未通过 2已是好友
  144. }
  145. // DeleteFriend 删除好友
  146. type DeleteFriend struct {
  147. PlayerId int64 `json:"userId"`
  148. FriendId int64 `json:"friendId"`
  149. }
  150. type ResponseDeleteFriend struct {
  151. ErrCode int `json:"errCode"`
  152. Msg string `json:"msg,omitempty"`
  153. Data int64 `json:"data"`
  154. }