44 lines
1.7 KiB
Go
44 lines
1.7 KiB
Go
|
|
package models
|
||
|
|
|
||
|
|
import "time"
|
||
|
|
|
||
|
|
// UserScenario 用户自建情景。
|
||
|
|
type UserScenario struct {
|
||
|
|
ID string `json:"id"`
|
||
|
|
UserID string `json:"user_id"`
|
||
|
|
Name string `json:"name"`
|
||
|
|
Icon string `json:"icon"`
|
||
|
|
Description string `json:"description"`
|
||
|
|
Prompt string `json:"prompt"`
|
||
|
|
Greeting string `json:"greeting,omitempty"`
|
||
|
|
Language string `json:"language"`
|
||
|
|
CreatedAt time.Time `json:"created_at"`
|
||
|
|
UpdatedAt time.Time `json:"updated_at"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// CreateUserScenarioRequest 创建用户情景请求。
|
||
|
|
type CreateUserScenarioRequest struct {
|
||
|
|
Name string `json:"name" binding:"required,min=2,max=50"`
|
||
|
|
Icon string `json:"icon,omitempty"`
|
||
|
|
Description string `json:"description,omitempty" binding:"omitempty,max=100"`
|
||
|
|
Prompt string `json:"prompt" binding:"required,min=10,max=2000"`
|
||
|
|
Greeting string `json:"greeting,omitempty" binding:"omitempty,max=500"`
|
||
|
|
Language string `json:"language,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// UpdateUserScenarioRequest 更新用户情景请求。
|
||
|
|
type UpdateUserScenarioRequest struct {
|
||
|
|
Name *string `json:"name,omitempty" binding:"omitempty,min=2,max=50"`
|
||
|
|
Icon *string `json:"icon,omitempty"`
|
||
|
|
Description *string `json:"description,omitempty" binding:"omitempty,max=100"`
|
||
|
|
Prompt *string `json:"prompt,omitempty" binding:"omitempty,min=10,max=2000"`
|
||
|
|
Greeting *string `json:"greeting,omitempty" binding:"omitempty,max=500"`
|
||
|
|
Language *string `json:"language,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// UserScenarioListResponse 用户情景列表响应。
|
||
|
|
type UserScenarioListResponse struct {
|
||
|
|
Scenarios []*UserScenario `json:"scenarios"`
|
||
|
|
Total int `json:"total"`
|
||
|
|
}
|