1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-14 00:02:28 +08:00
parent e5c75f7359
commit 7cdf7a0890
2 changed files with 20 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ func NewTaskService() *TaskService {
&cool.Service{
Model: model.NewTaskConfig(),
PageQueryOp: &cool.QueryOp{
FieldEQ: []string{"task_type"},
FieldEQ: []string{"task_type", "task_id"},
KeyWordField: []string{"remark"},
},
//UniqueKey: map[string]string{"task_id": "索引不能重复"},

View File

@@ -1,15 +1,8 @@
/*
* @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"
dict "blazing/modules/dict/service"
"blazing/modules/player/service"
"context"
@@ -39,12 +32,29 @@ type GetReq struct {
func (c *TitleController) Get(ctx context.Context, req *GetReq) (res *cool.BaseRes, err error) {
res = &cool.BaseRes{}
var ret []TitleRes
var (
admin = cool.GetAdmin(ctx)
//r = g.RequestFromCtx(ctx)
)
alltitile := service.NewUserService(uint32(admin.UserId)).Title.Get()
titles := dict.NewDictInfoService().GetData("achieve")
for _, v := range alltitile {
ret = append(ret, TitleRes{
res.Data = service.NewUserService(uint32(admin.UserId)).Title.Get()
ID: v,
Name: titles[v].Name,
Desc: *titles[v].Remark,
})
}
res.Data = ret
return
}
type TitleRes struct {
ID uint32 `json:"id"`
Name string `json:"name"`
Desc string `json:"desc"`
}