refactor(util): 重构响应解析和表单验证功能

This commit is contained in:
WangLiZhao
2026-06-23 14:42:59 +08:00
parent 733f0429fe
commit 28a923a8cf
3 changed files with 8 additions and 13 deletions
-11
View File
@@ -1,11 +0,0 @@
{
"tasks": [
{
"id": "1778047497735wxayc",
"title": "Review blocked/reverted work in update.sql",
"category": "Blocked",
"dueDate": null,
"completed": false
}
]
}
-1
View File
@@ -5,7 +5,6 @@ const (
)
const (
TableNameModel = "asynch_models" // 模型表
TableNameComposeTask = "prompts_compose_task" // 拼接提示词任务记录表
TableNameComposeSession = "prompts_compose_session" // 拼接提示词会话记录表
TableNameProviderProtocol = "prompts_provider_protocol"
+8 -1
View File
@@ -9,6 +9,7 @@ import (
"gitea.redpowerfuture.com/red-future/common/beans"
"gitea.redpowerfuture.com/red-future/common/utils"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/grpool"
"github.com/gogf/gf/v2/util/gconv"
"prompts-core/common/util"
@@ -126,7 +127,13 @@ func GetHistoryMessages(ctx context.Context, req *dto.GetHistoryMessagesReq) (*d
// 3) 转换 + 异步回种
rounds := sessionsToHistoryRounds(sessions)
go asyncCacheToRedis(context.WithoutCancel(ctx), user.TenantId, req.SessionId, req.NodeId, rounds)
err = grpool.AddWithRecover(ctx, func(ctx context.Context) {
asyncCacheToRedis(ctx, user.TenantId, req.SessionId, req.NodeId, rounds)
}, nil)
if err != nil {
return nil, err
}
return &dto.GetHistoryMessagesRes{Messages: flattenRounds(rounds)}, nil
}