引包目录名调整

This commit is contained in:
2026-04-27 14:02:43 +08:00
parent 6ba2262a17
commit 11bf15e72b
48 changed files with 56 additions and 58 deletions

View File

@@ -0,0 +1,30 @@
package controller
import (
"context"
"ai-agent/digital-human/model/dto"
"ai-agent/digital-human/service"
"github.com/gogf/gf/v2/util/gconv"
)
type asyncTask struct{}
// AsyncTask 异步任务同步控制器(供定时任务服务调用)
var AsyncTask = new(asyncTask)
// SyncAsyncTasks 扫描待处理任务并同步状态/转移结果
func (c *asyncTask) SyncAsyncTasks(ctx context.Context, req *dto.SyncAsyncTasksReq) (res *dto.SyncAsyncTasksRes, err error) {
// 从上下文获取用户信息gfdb Hook 会自动填充)
if ctx.Value("userId") == nil {
ctx = context.WithValue(ctx, "userId", gconv.String(1))
}
if ctx.Value("userName") == nil {
ctx = context.WithValue(ctx, "userName", "admin")
}
if ctx.Value("tenantId") == nil {
ctx = context.WithValue(ctx, "tenantId", uint64(1))
}
return service.AsyncTask.Sync(ctx, req)
}