refactor: 重构提示词构建逻辑并移除不再使用的文件处理服务
This commit is contained in:
@@ -14,7 +14,7 @@ type prompt struct{}
|
||||
// Prompt 提示词配置控制器
|
||||
var Prompt = new(prompt)
|
||||
|
||||
// ComposeMessages 调用 model-gateway 异步任务并同步等待结果
|
||||
// ComposeMessages 调用 model-gateway 异步任务并同步等待结果,
|
||||
func (c *prompt) ComposeMessages(ctx context.Context, req *dto.ComposeMessagesReq) (res *dto.ComposeMessagesRes, err error) {
|
||||
return service.Prompt.ComposeMessages(ctx, req)
|
||||
}
|
||||
@@ -58,23 +58,7 @@ func (c *prompt) GetPrompt(ctx context.Context, req *dto.GetPromptReq) (res *dto
|
||||
|
||||
// ListPrompt 配置列表
|
||||
func (c *prompt) ListPrompt(ctx context.Context, req *dto.ListPromptReq) (res *dto.ListPromptRes, err error) {
|
||||
pageNum, pageSize := 1, 10
|
||||
if req != nil && req.Page != nil {
|
||||
if req.Page.PageNum > 0 {
|
||||
pageNum = int(req.Page.PageNum)
|
||||
}
|
||||
if req.Page.PageSize > 0 {
|
||||
pageSize = int(req.Page.PageSize)
|
||||
}
|
||||
}
|
||||
var modelTypeID *int
|
||||
modelType := ""
|
||||
if req != nil {
|
||||
modelTypeID = req.ModelTypeId
|
||||
modelType = req.ModelType
|
||||
}
|
||||
|
||||
list, total, err := service.Prompt.List(ctx, pageNum, pageSize, modelTypeID, modelType)
|
||||
list, total, err := service.Prompt.List(ctx, int(req.Page.PageNum), int(req.Page.PageSize), req.ModelTypeId, req.ModelType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user