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") f5.RspErr(c, 401, "params parse error")
return return
} }
err, heroList := GetCacheMgr().GetIngameHero("") openId := c.MustGet("open_id").(string)
accountId := openId
err, heroList := GetCacheMgr().GetIngameHero(accountId)
if err != nil { if err != nil {
f5.RspErr(c, 500, "server internal error") f5.RspErr(c, 500, "server internal error")
return return

View File

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