sdk_generate/internal/entitys/request.go

67 lines
3.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package entitys
import (
"sdk-generator/internal/data/model"
)
type GenerateRequest struct {
InstanceId string `form:"instance_id" validate:"required" zh:"文档实例id"`
RefinedDoc string `form:"refined_doc" zh:"文档内容,如果为空默认使用原文档内容"`
Interfaces string `form:"interfaces" zh:"需要实现的接口,如果为空默认使用原文档内容"`
CodeType string `form:"code_type" validate:"required" zh:"生成代码类型go,python,java,php"`
GenerateType int32 `form:"generate_type" validate:"required" zh:"生成类型1:调用文档生成客户端SDK,2对接文档生成服务端骨架"`
Desc string `form:"desc" zh:"仓库前缀"`
MsgSendToken string `form:"mes_send_token" zh:"消息发送token(钉钉机器人access_token)"`
MsgContent string `form:"msg_content" zh:"消息发送内容"`
LlmApiKey string `form:"llm_api_key" validate:"required" zh:"api key"`
LlmBaseUrl string `form:"llm_base_url" validate:"required" zh:"openai base url"`
LlmModel string `form:"llm_model" validate:"required" zh:"model name"`
}
type GenerateResponse struct {
TaskID string `json:"task_id"`
Status string `json:"status"`
Message string `json:"message"`
}
type RefineRequest struct {
Desc string `form:"desc" zh:"文档备注,不传或者为空则默认以文档名称作为备注"`
LlmApiKey string `form:"llm_api_key" validate:"required" zh:"api key"`
LlmBaseUrl string `form:"llm_base_url" validate:"required" zh:"openai base url"`
LlmModel string `form:"llm_model" validate:"required" zh:"model name"`
LlmPrompt string `form:"llm_prompt" validate:"" zh:"model name"`
}
type RefineResponse struct {
InstanceId string `json:"instance_id"`
RefinedDoc string `json:"refined_doc"`
Interfaces []Interface `json:"interfaces"`
}
type ListDocRequest struct {
InstanceId string `form:"instance_id" validate:"omitempty,max=100" zh:"文档实例id"`
Desc string `form:"desc" validate:"omitempty,max=30" zh:"文档备注"`
Page int `form:"page" validate:"omitempty,min=1" zh:"页码"`
PageSize int `form:"page_size" validate:"omitempty,min=1,max=100" zh:"每页数量"`
}
type ListDocResponse struct {
Data []model.AiGenerateDoc `json:"data"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"size"`
}
type UpdateDocRequest struct {
InstanceId string `form:"instance_id" validate:"omitempty,max=100" zh:"文档实例id"`
RefinedDoc string `form:"refined_doc" validate:"omitempty" zh:"文档内容"`
Desc string `form:"desc" validate:"omitempty,max=30" zh:"文档备注"`
}
type ListTaskRequest struct {
TaskId string `form:"task_id" validate:"omitempty,max=100" zh:"文档实例id"`
Desc string `form:"desc" validate:"omitempty,max=30" zh:"文档备注"`
Page int `form:"page" validate:"omitempty,min=1" zh:"页码"`
PageSize int `form:"page_size" validate:"omitempty,min=1,max=100" zh:"每页数量"`
}