init repo
This commit is contained in:
69
internal/model/formula/request.go
Normal file
69
internal/model/formula/request.go
Normal file
@@ -0,0 +1,69 @@
|
||||
package formula
|
||||
|
||||
type CreateFormulaRecognitionRequest struct {
|
||||
FileURL string `json:"file_url" binding:"required"` // oss file url
|
||||
FileHash string `json:"file_hash" binding:"required"` // file hash
|
||||
FileName string `json:"file_name" binding:"required"` // file name
|
||||
TaskType string `json:"task_type" binding:"required,oneof=FORMULA"` // task type
|
||||
}
|
||||
|
||||
type GetRecognitionStatusRequest struct {
|
||||
TaskNo string `uri:"task_no" binding:"required"`
|
||||
}
|
||||
|
||||
type AIEnhanceRecognitionRequest struct {
|
||||
TaskNo string `json:"task_no" binding:"required"`
|
||||
}
|
||||
|
||||
type VLFormulaRequest struct {
|
||||
Model string `json:"model"`
|
||||
Stream bool `json:"stream"`
|
||||
MaxTokens int `json:"max_tokens"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
TopP float64 `json:"top_p"`
|
||||
TopK int `json:"top_k"`
|
||||
N int `json:"n"`
|
||||
FrequencyPenalty float64 `json:"frequency_penalty"`
|
||||
Messages []Message `json:"messages"`
|
||||
}
|
||||
|
||||
type Message struct {
|
||||
Role string `json:"role"`
|
||||
Content []Content `json:"content"`
|
||||
}
|
||||
|
||||
type Content struct {
|
||||
Text string `json:"text"`
|
||||
Type string `json:"type"`
|
||||
ImageURL Image `json:"image_url"`
|
||||
}
|
||||
|
||||
type Image struct {
|
||||
Detail string `json:"detail"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type VLFormulaResponse struct {
|
||||
ID string `json:"id"`
|
||||
Object string `json:"object"`
|
||||
Created int64 `json:"created"`
|
||||
Model string `json:"model"`
|
||||
Choices []Choice `json:"choices"`
|
||||
Usage Usage `json:"usage"`
|
||||
SystemFingerprint string `json:"system_fingerprint"`
|
||||
}
|
||||
|
||||
type Choice struct {
|
||||
Index int `json:"index"`
|
||||
Message struct {
|
||||
Content string `json:"content"`
|
||||
Role string `json:"role"`
|
||||
} `json:"message"`
|
||||
FinishReason string `json:"finish_reason"`
|
||||
}
|
||||
|
||||
type Usage struct {
|
||||
PromptTokens int `json:"prompt_tokens"`
|
||||
CompletionTokens int `json:"completion_tokens"`
|
||||
TotalTokens int `json:"total_tokens"`
|
||||
}
|
||||
13
internal/model/formula/response.go
Normal file
13
internal/model/formula/response.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package formula
|
||||
|
||||
type CreateTaskResponse struct {
|
||||
TaskNo string `json:"task_no"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type GetFormulaTaskResponse struct {
|
||||
TaskNo string `json:"task_no"`
|
||||
Status int `json:"status"`
|
||||
Count int `json:"count"`
|
||||
Latex string `json:"latex"`
|
||||
}
|
||||
36
internal/model/task/request.go
Normal file
36
internal/model/task/request.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package task
|
||||
|
||||
type EvaluateTaskRequest struct {
|
||||
TaskNo string `json:"task_no" binding:"required"` // 任务编号
|
||||
Satisfied int `json:"satisfied"` // 0: 不满意, 1: 满意
|
||||
Suggestion []string `json:"suggestion"` // 建议 1. 公式无法渲染 2. 公式渲染错误
|
||||
Feedback string `json:"feedback"` // 反馈
|
||||
}
|
||||
|
||||
type TaskListRequest struct {
|
||||
TaskType string `json:"task_type" form:"task_type" binding:"required"`
|
||||
Page int `json:"page" form:"page"`
|
||||
PageSize int `json:"page_size" form:"page_size"`
|
||||
}
|
||||
|
||||
type PdfInfo struct {
|
||||
PageCount int `json:"page_count"`
|
||||
PageWidth int `json:"page_width"`
|
||||
PageHeight int `json:"page_height"`
|
||||
}
|
||||
|
||||
type TaskListDTO struct {
|
||||
TaskID string `json:"task_id"`
|
||||
FileName string `json:"file_name"`
|
||||
Status string `json:"status"`
|
||||
Path string `json:"path"`
|
||||
TaskType string `json:"task_type"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
PdfInfo PdfInfo `json:"pdf_info"`
|
||||
}
|
||||
|
||||
type TaskListResponse struct {
|
||||
TaskList []*TaskListDTO `json:"task_list"`
|
||||
HasMore bool `json:"has_more"`
|
||||
NextPage int `json:"next_page"`
|
||||
}
|
||||
24
internal/model/user/user.go
Normal file
24
internal/model/user/user.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
type SmsSendRequest struct {
|
||||
Phone string `json:"phone" binding:"required"`
|
||||
}
|
||||
|
||||
type SmsSendResponse struct {
|
||||
Code string `json:"code"`
|
||||
}
|
||||
|
||||
type PhoneLoginRequest struct {
|
||||
Phone string `json:"phone" binding:"required"`
|
||||
Code string `json:"code" binding:"required"`
|
||||
}
|
||||
|
||||
type PhoneLoginResponse struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type UserInfoResponse struct {
|
||||
Username string `json:"username"`
|
||||
Phone string `json:"phone"`
|
||||
Status int `json:"status"` // 0: not login, 1: login
|
||||
}
|
||||
Reference in New Issue
Block a user