```
feat(cache): 添加复合键缓存操作支持 添加了基于 uint32+string 组合键的缓存操作方法,包括 GetByCompoundKey、SetByCompoundKey、DelByCompoundKey 和 ContainsByCompoundKey 方法,用于处理用户ID和会话ID的组合缓存场景 fix(vscode): 添加 cSpell 配置支持 struc 词汇 refactor(session): 移除过时的会话管理方法 移除了基于单一字符串键的会话管理方法,因为已迁移到使用 复合键的缓存操作方式 ```
This commit is contained in:
50
modules/player/controller/admin/title.go
Normal file
50
modules/player/controller/admin/title.go
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* @Author: 昔念 12574910+72wo@users.noreply.github.com
|
||||
* @Date: 2026-01-18 11:55:13
|
||||
* @LastEditors: 昔念 12574910+72wo@users.noreply.github.com
|
||||
* @LastEditTime: 2026-01-18 11:59:32
|
||||
* @FilePath: \sun\modules\blazing\controller\admin\title.go
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
package admin
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/player/service"
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type TitleController struct {
|
||||
*cool.Controller
|
||||
}
|
||||
|
||||
func init() {
|
||||
var task_info_controller = &TitleController{
|
||||
&cool.Controller{
|
||||
Prefix: "/admin/game/title",
|
||||
Api: []string{"Delete", "Update", "Info", "List", "Page"},
|
||||
Service: service.NewItemService(0), //因为page已经过滤,所以这里需要改成0
|
||||
},
|
||||
}
|
||||
// 注册路由
|
||||
cool.RegisterController(task_info_controller)
|
||||
}
|
||||
|
||||
type GetReq struct {
|
||||
g.Meta `path:"/get" method:"POST"`
|
||||
ID uint32 `json:"id"`
|
||||
}
|
||||
|
||||
func (c *TitleController) Get(ctx context.Context, req *GetReq) (res *cool.BaseRes, err error) {
|
||||
res = &cool.BaseRes{}
|
||||
var (
|
||||
admin = cool.GetAdmin(ctx)
|
||||
//r = g.RequestFromCtx(ctx)
|
||||
)
|
||||
|
||||
res.Data = service.NewUserService(uint32(admin.UserId)).Title.Get()
|
||||
return
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user