feat(cache): 添加复合键缓存操作支持 添加了基于 uint32+string 组合键的缓存操作方法,包括 GetByCompoundKey、SetByCompoundKey、DelByCompoundKey 和 ContainsByCompoundKey 方法,用于处理用户ID和会话ID的组合缓存场景 fix(vscode): 添加 cSpell 配置支持 struc 词汇 refactor(session): 移除过时的会话管理方法 移除了基于单一字符串键的会话管理方法,因为已迁移到使用 复合键的缓存操作方式 ```
39 lines
752 B
Go
39 lines
752 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/sun/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
|
|
|
|
}
|