This commit is contained in:
aozhiwei 2024-07-16 19:53:34 +08:00
parent 78462ed1a1
commit 46a03910a7
2 changed files with 10 additions and 3 deletions

View File

@ -34,7 +34,9 @@ func (this *InGameApi) HeroList(c *gin.Context) {
f5.RspErr(c, 401, "params parse error")
return
}
err, heroList := GetCacheMgr().GetIngameHero("")
openId := c.MustGet("open_id").(string)
accountId := openId
err, heroList := GetCacheMgr().GetIngameHero(accountId)
if err != nil {
f5.RspErr(c, 500, "server internal error")
return

View File

@ -3,12 +3,17 @@ package ingame
import (
"f5"
"main/api/v1"
"main/middleware"
)
type IngameRouter struct{}
func (this *IngameRouter) InitRouter() {
api := v1.ApiGroupApp.InGameApiGroup
f5.GetApp().GetGinEngine().GET("/api/ingame/asset/hero/list", api.InGameApi.HeroList)
f5.GetApp().GetGinEngine().POST("/api/ingame/asset/hero/mint", api.InGameApi.HeroMint)
f5.GetApp().GetGinEngine().POST("/api/ingame/asset/hero/list",
middleware.JwtAuth,
api.InGameApi.HeroList)
f5.GetApp().GetGinEngine().POST("/api/ingame/asset/hero/mint",
middleware.JwtAuth,
api.InGameApi.HeroMint)
}