Files
prompts-core/model/dto/prompt_dto.go

64 lines
3.3 KiB
Go
Raw Permalink Normal View History

2026-05-12 13:59:15 +08:00
package dto
import (
"gitea.com/red-future/common/beans"
"github.com/gogf/gf/v2/frame/g"
)
// CreatePromptReq 添加提示词配置(默认启用)
type CreatePromptReq struct {
g.Meta `path:"/createPrompt" method:"post" tags:"提示词管理" summary:"创建提示词配置" dc:"创建新的模型提示词配置(默认启用)"`
ModelTypeId int `p:"modelTypeId" json:"modelTypeId" v:"required#modelTypeId不能为空" dc:"模型分类ID"`
ModelType string `p:"modelType" json:"modelType" v:"required#modelType不能为空" dc:"模型类别/模型类型"`
PromptInfo any `p:"promptInfo" json:"promptInfo" v:"required#promptInfo不能为空" dc:"数据库定义的表单规则数据JSON"`
ResponseJsonSchema any `p:"responseJsonSchema" json:"responseJsonSchema" v:"required#responseJsonSchema不能为空" dc:"模型返回表单 JSON 格式约束"`
// Version 预留字段:先不使用,但表结构保留
Version string `p:"version" json:"version" dc:"版本号(预留)"`
}
type CreatePromptRes struct {
ID int64 `json:"id,string" dc:"配置ID"`
}
// UpdatePromptReq 更新提示词配置
type UpdatePromptReq struct {
g.Meta `path:"/updatePrompt" method:"put" tags:"提示词管理" summary:"更新提示词配置" dc:"更新指定ID的提示词配置"`
ID int64 `p:"id" json:"id,string" v:"required#id不能为空" dc:"配置ID"`
ModelTypeId *int `p:"modelTypeId" json:"modelTypeId" dc:"模型分类ID可选更新"`
ModelType *string `p:"modelType" json:"modelType" dc:"模型类别/模型类型(可选更新)"`
PromptInfo any `p:"promptInfo" json:"promptInfo" dc:"数据库定义的表单规则数据JSON可选更新"`
ResponseJsonSchema any `p:"responseJsonSchema" json:"responseJsonSchema" dc:"模型返回表单 JSON 格式约束(可选更新)"`
Enabled *int `p:"enabled" json:"enabled" dc:"是否启用0-禁用1-启用(可选更新)"`
Version *string `p:"version" json:"version" dc:"版本号(预留,可选更新)"`
}
// DeletePromptReq 删除提示词配置
type DeletePromptReq struct {
g.Meta `path:"/deletePrompt" method:"delete" tags:"提示词管理" summary:"删除提示词配置" dc:"删除指定ID的提示词配置"`
ID int64 `p:"id" json:"id,string" v:"required#id不能为空" dc:"配置ID"`
}
// GetPromptReq 获取提示词配置详情
type GetPromptReq struct {
g.Meta `path:"/getPrompt" method:"get" tags:"提示词管理" summary:"获取提示词配置" dc:"根据ID获取提示词配置详情"`
ID int64 `p:"id" json:"id,string" v:"required#id不能为空" dc:"配置ID"`
}
type GetPromptRes struct {
Prompt any `json:"prompt" dc:"提示词配置详情"`
}
// ListPromptReq 配置列表
type ListPromptReq struct {
g.Meta `path:"/listPrompt" method:"post" tags:"提示词管理" summary:"提示词配置列表" dc:"分页获取提示词配置列表"`
Page *beans.Page `p:"page" json:"page" dc:"分页参数"`
ModelTypeId *int `p:"modelTypeId" json:"modelTypeId" dc:"模型分类ID可选"`
ModelType string `p:"modelType" json:"modelType" dc:"模型类型名称(可选,模糊查询)"`
}
type ListPromptRes struct {
List any `json:"list" dc:"列表数据"`
Total int64 `json:"total" dc:"总数"`
}