Files
bl/modules/player/controller/admin/player.go
昔念 922f7c3622
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
1
2026-02-20 21:34:27 +08:00

39 lines
753 B
Go

package admin
import (
"blazing/cool"
"blazing/modules/player/service"
"context"
"github.com/gogf/gf/v2/frame/g"
)
type PlayerController struct {
*cool.Controller
}
func init() {
var task_info_controller = &PlayerController{
&cool.Controller{
Prefix: "/admin/game/player",
Api: []string{"Add", "Delete", "Update", "Info", "List", "Page"},
Service: service.NewInfoService(0),
},
}
// 注册路由
cool.RegisterController(task_info_controller)
}
type KickReq struct {
g.Meta `path:"/kick" method:"POST"`
ID uint32 `json:"id"`
}
func (c *PlayerController) Kick(ctx context.Context, req *KickReq) (res *cool.BaseRes, err error) {
res = &cool.BaseRes{}
service.NewUserService(0).Info.Kick(uint32(req.ID))
return
}