Commit 4c71839e6583d3e6af92d238b9ccd59b8c859e1a
1 parent
71944952
Exists in
master
feat✨:排行榜功能 发送已结算的排行榜信息
Showing
2 changed files
with
8 additions
and
5 deletions
Show diff stats
models/roomrank.go
| ... | ... | @@ -64,11 +64,12 @@ type ReqRoomRankGetSettleAward struct { |
| 64 | 64 | |
| 65 | 65 | // RspRoomRankGetSettleAward 返回 领取上期结算奖励 |
| 66 | 66 | type RspRoomRankGetSettleAward struct { |
| 67 | - SettleRank int `form:"settle_rank" json:"settle_rank"` // 结算名次 | |
| 68 | - SettleScore int64 `form:"settle_score" json:"settle_score"` // 结算分数 | |
| 69 | - UserClass int `form:"user_class" json:"user_class"` // 用户评级 | |
| 70 | - AwardText string `form:"award_text" json:"award_text"` // 上期结算奖励内容 | |
| 71 | - Tops []RoomRankTopNode `form:"tops" json:"tops"` // 排行榜数据列表 | |
| 67 | + SettleRank int `form:"settle_rank" json:"settle_rank"` // 结算名次 | |
| 68 | + SettleScore int64 `form:"settle_score" json:"settle_score"` // 结算分数 | |
| 69 | + UserClass int `form:"user_class" json:"user_class"` // 用户评级 | |
| 70 | + AwardText string `form:"award_text" json:"award_text"` // 上期结算奖励内容 | |
| 71 | + RobotAvatarPath string `form:"robot_avatar_path" json:"robot_avatar_path"` // 机器人头像路径 | |
| 72 | + Tops []RoomRankTopNode `form:"tops" json:"tops"` // 排行榜数据列表 | |
| 72 | 73 | } |
| 73 | 74 | |
| 74 | 75 | // ReqRoomRankAddScore 请求 房间排行增加积分 | ... | ... |
service/roomrank/handle.go
| ... | ... | @@ -3,6 +3,7 @@ package roomrank |
| 3 | 3 | import ( |
| 4 | 4 | "apigame/configs-db/confroomrank" |
| 5 | 5 | "apigame/models" |
| 6 | + "apigame/service-common/svcommon" | |
| 6 | 7 | "apigame/service/code-msg" |
| 7 | 8 | "apigame/util/util-lx/lxtime" |
| 8 | 9 | "apigame/util/zredislock" |
| ... | ... | @@ -163,6 +164,7 @@ func HandleGetSettleAward(req *models.ReqRoomRankGetSettleAward) (code string, r |
| 163 | 164 | |
| 164 | 165 | // 尝试发送已结算的排行榜信息 |
| 165 | 166 | { |
| 167 | + rsp.RobotAvatarPath = svcommon.GetAvatarPath(gameId) | |
| 166 | 168 | confActivity, hasConfActivity := confroomrank.GetConfig(gameId, player.ActivityId) |
| 167 | 169 | if hasConfActivity { |
| 168 | 170 | // 查找玩家所在的房间 | ... | ... |