You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
1.3 KiB

syntax = "v1"
// ========== 文件管理类型定义 ==========
type (
// 文件信息
FileInfo {
Id int64 `json:"id"`
Name string `json:"name"`
Key string `json:"key"`
Size int64 `json:"size"`
MimeType string `json:"mimeType"`
Category string `json:"category"`
IsPublic bool `json:"isPublic"`
UserId int64 `json:"userId"`
StorageType string `json:"storageType"`
Url string `json:"url"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
// 文件列表请求
FileListRequest {
Page int `form:"page,default=1"`
PageSize int `form:"pageSize,default=20"`
Keyword string `form:"keyword,optional"`
Category string `form:"category,optional"`
MimeType string `form:"mimeType,optional"`
}
// 文件列表响应
FileListResponse {
Total int64 `json:"total"`
List []FileInfo `json:"list"`
}
// 获取文件请求
GetFileRequest {
Id int64 `path:"id"`
}
// 更新文件请求
UpdateFileRequest {
Id int64 `path:"id"`
Name string `json:"name,optional"`
Category string `json:"category,optional"`
IsPublic *bool `json:"isPublic,optional"`
}
// 删除文件请求
DeleteFileRequest {
Id int64 `path:"id"`
}
// 文件 URL 响应
FileUrlResponse {
Url string `json:"url"`
}
)