🎨 重构用户端前端为vue开发,完善基础类和角色相关接口
This commit is contained in:
54
server/model/app/request/character.go
Normal file
54
server/model/app/request/character.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package request
|
||||
|
||||
import "mime/multipart"
|
||||
|
||||
// CreateCharacterRequest 创建角色卡请求
|
||||
type CreateCharacterRequest struct {
|
||||
Name string `json:"name" binding:"required,min=1,max=500"`
|
||||
Description string `json:"description"`
|
||||
Personality string `json:"personality"`
|
||||
Scenario string `json:"scenario"`
|
||||
Avatar string `json:"avatar"`
|
||||
CreatorName string `json:"creatorName"`
|
||||
CreatorNotes string `json:"creatorNotes"`
|
||||
FirstMessage string `json:"firstMessage"`
|
||||
ExampleMessages []string `json:"exampleMessages"`
|
||||
Tags []string `json:"tags"`
|
||||
IsPublic bool `json:"isPublic"`
|
||||
}
|
||||
|
||||
// UpdateCharacterRequest 更新角色卡请求
|
||||
type UpdateCharacterRequest struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
Name string `json:"name" binding:"required,min=1,max=500"`
|
||||
Description string `json:"description"`
|
||||
Personality string `json:"personality"`
|
||||
Scenario string `json:"scenario"`
|
||||
Avatar string `json:"avatar"`
|
||||
CreatorName string `json:"creatorName"`
|
||||
CreatorNotes string `json:"creatorNotes"`
|
||||
FirstMessage string `json:"firstMessage"`
|
||||
ExampleMessages []string `json:"exampleMessages"`
|
||||
Tags []string `json:"tags"`
|
||||
IsPublic bool `json:"isPublic"`
|
||||
}
|
||||
|
||||
// CharacterListRequest 角色卡列表请求
|
||||
type CharacterListRequest struct {
|
||||
Page int `form:"page" binding:"min=1"`
|
||||
PageSize int `form:"pageSize" binding:"min=1,max=100"`
|
||||
Keyword string `form:"keyword"`
|
||||
Tags []string `form:"tags"`
|
||||
SortBy string `form:"sortBy"` // newest, popular, mostChats, mostLikes
|
||||
}
|
||||
|
||||
// ImportCharacterRequest 导入角色卡请求
|
||||
type ImportCharacterRequest struct {
|
||||
File *multipart.FileHeader `form:"file" binding:"required"`
|
||||
IsPublic bool `form:"isPublic"`
|
||||
}
|
||||
|
||||
// CharacterActionRequest 角色卡操作请求(点赞、收藏等)
|
||||
type CharacterActionRequest struct {
|
||||
CharacterID uint `json:"characterId" binding:"required"`
|
||||
}
|
||||
Reference in New Issue
Block a user