Files
bl/modules/player/controller/admin/pvp.go
昔念 2dbbc9713c
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
fix(player): 修复PVP控制器数据返回错误

修改了admin/pvp.go文件中的Get方法,将返回数据从alltitile.RankInfo
改为alltitile,确保正确返回完整的PVP信息而不是仅返回排名信息。
```
2026-03-20 18:09:25 +08:00

44 lines
909 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package admin
import (
"blazing/cool"
"blazing/modules/player/service"
"context"
"github.com/gogf/gf/v2/frame/g"
)
type PVPController struct {
*cool.Controller
}
func init() {
var task_info_controller = &PVPController{
&cool.Controller{
Prefix: "/admin/game/pvp",
Api: []string{"Delete", "Update", "Info", "List", "Page"},
Service: service.NewPVPService(0), //因为page已经过滤所以这里需要改成0
},
}
// 注册路由
cool.RegisterController(task_info_controller)
}
type GetPVPReq struct {
g.Meta `path:"/get" method:"POST"`
}
func (c *PVPController) Get(ctx context.Context, req *GetPVPReq) (res *cool.BaseRes, err error) {
res = &cool.BaseRes{}
//var ret []TitleRes
var (
admin = cool.GetAdmin(ctx)
//r = g.RequestFromCtx(ctx)
)
alltitile := service.NewPVPService(uint32(admin.UserId)).Get(uint32(admin.UserId))
res.Data = alltitile
return
}