Commit afd7d6f2926af1ba171f2f4ee1ec7c8d588cb0f1
1 parent
d5ff2efa
Exists in
master
and in
1 other branch
feat✨:房间排行活动:配置接口
Showing
2 changed files
with
15 additions
and
2 deletions
Show diff stats
models/roomrank.go
| ... | ... | @@ -8,8 +8,13 @@ type ReqRoomRankGetConfig struct { |
| 8 | 8 | |
| 9 | 9 | // RspRoomRankGetConfig 返回 活动配置 |
| 10 | 10 | type RspRoomRankGetConfig struct { |
| 11 | - ActivityId int64 `form:"activity_id" json:"activity_id"` // 活动配置 0=无活动 | |
| 12 | - Config any `form:"config" json:"config"` // 活动配置对象 | |
| 11 | + ActivityId int64 `form:"activity_id" json:"activity_id"` // 活动配置 0=无活动 | |
| 12 | + PrepareTime int64 `form:"prepare_time" json:"prepare_time"` // 活动预告时间 | |
| 13 | + StartTime int64 `form:"start_time" json:"start_time"` // 活动开始时间 | |
| 14 | + EndTime int64 `form:"end_time" json:"end_time"` // 活动结束时间 | |
| 15 | + ReleaseTime int64 `form:"release_time" json:"release_time"` // 结算发奖时间 | |
| 16 | + OpenLevel int `form:"open_level" json:"open_level"` // 开启等级 | |
| 17 | + Config any `form:"config" json:"config"` // 活动配置对象 | |
| 13 | 18 | } |
| 14 | 19 | |
| 15 | 20 | // RoomRankInfo 房间排行信息 | ... | ... |
service/roomrank/handle.go
| ... | ... | @@ -4,6 +4,7 @@ import ( |
| 4 | 4 | "apigame/configs/confroomrank" |
| 5 | 5 | "apigame/models" |
| 6 | 6 | "apigame/service/code-msg" |
| 7 | + "fmt" | |
| 7 | 8 | ) |
| 8 | 9 | |
| 9 | 10 | // HandleGetConfig 活动配置 |
| ... | ... | @@ -19,6 +20,11 @@ func HandleGetConfig(req *models.ReqRoomRankGetConfig) (code string, rsp models. |
| 19 | 20 | return |
| 20 | 21 | } |
| 21 | 22 | rsp.ActivityId = config.Id |
| 23 | + rsp.PrepareTime = config.PreviewTime | |
| 24 | + rsp.StartTime = config.StartTime | |
| 25 | + rsp.EndTime = config.EndTime | |
| 26 | + rsp.ReleaseTime = config.ReleaseTime | |
| 27 | + rsp.OpenLevel = config.OpenLevel | |
| 22 | 28 | |
| 23 | 29 | rsp.Config = config.Client |
| 24 | 30 | |
| ... | ... | @@ -68,5 +74,7 @@ func HandleInfo(req *models.ReqRoomRankInfo) (code string, rsp models.RspRoomRan |
| 68 | 74 | SaveRoom(gameId, room) |
| 69 | 75 | } |
| 70 | 76 | |
| 77 | + fmt.Println("dwjw🐸 len(room.Details.Players) 1:", len(room.Details.Players)) | |
| 78 | + | |
| 71 | 79 | return |
| 72 | 80 | } | ... | ... |