98 lines
3.6 KiB
Go
98 lines
3.6 KiB
Go
package schema
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type DocFolder struct {
|
|
ID string `json:"id" oai:"description=文件夹ID"`
|
|
Name string `json:"name" oai:"description=文件夹名称"`
|
|
IsDefault bool `json:"is_default,omitempty" oai:"description=是否默认分组"`
|
|
CreatedAt time.Time `json:"created_at" oai:"description=创建时间"`
|
|
UpdatedAt time.Time `json:"updated_at" oai:"description=更新时间"`
|
|
}
|
|
|
|
type DocFolderID struct {
|
|
ID string `path:"id" oai:"description=文件夹ID"`
|
|
}
|
|
|
|
type CreateDocFolder struct {
|
|
Name string `json:"name" validate:"required" oai:"description=文件夹名称"`
|
|
ParentID string `json:"parent_id" oai:"description=父文件夹ID,空表示在根路径创建"`
|
|
}
|
|
|
|
type UpdateDocFolder struct {
|
|
Name *string `json:"name" oai:"description=修改文件夹名称"`
|
|
ParentID *string `json:"parent_id" oai:"description=修改文件夹父级ID"`
|
|
}
|
|
|
|
type GetDocFolderTree struct {
|
|
ParentID *string `query:"parent_id" oai:"description=父文件夹ID,空表示获取根路径"`
|
|
}
|
|
|
|
type DocFolderWithChildren struct {
|
|
*DocFolder
|
|
Children []*DocFolderWithChildren `json:"children,omitempty" oai:"description=子文件夹;required=false"`
|
|
}
|
|
|
|
type Doc struct {
|
|
ID string `json:"id" oai:"description=文档ID"`
|
|
Folder *DocFolder `json:"folder" oai:"description=归属文件夹信息"`
|
|
PresignedURL string `json:"presigned_url" oai:"description=文档预签名下载URL(临时下载URL)"`
|
|
UploadedAt time.Time `json:"uploaded_at" oai:"description=上传时间"`
|
|
CreatedAt time.Time `json:"created_at" oai:"description=创建时间"`
|
|
UpdatedAt time.Time `json:"updated_at" oai:"description=更新时间"`
|
|
}
|
|
|
|
type DocList struct {
|
|
Items []*Doc `json:"items" oai:"description=文档列表"`
|
|
Total int64 `json:"total" oai:"description=文档总数"`
|
|
}
|
|
|
|
type DocID struct {
|
|
ID string `path:"id" oai:"description=文档ID"`
|
|
}
|
|
|
|
type CreateDoc struct {
|
|
Name string `json:"name" validate:"required" oai:"description=文档名称"`
|
|
ObjectName string `json:"object_name" validate:"required" oai:"description=对象存储中对应的文档对象名称"`
|
|
FolderID string `json:"folder_id" validate:"required" oai:"description=归属文件夹ID"`
|
|
}
|
|
|
|
type UpdateDoc struct {
|
|
Name *string `json:"name" oai:"description=更新文档名称"`
|
|
FolderID *string `json:"folder_id" oai:"description=更新归属文件夹ID"`
|
|
}
|
|
|
|
type ListDocQuery struct {
|
|
PageableQuery
|
|
SortableQuery
|
|
FolderIDs *[]string `query:"folder_ids" oai:"description=筛选归属文件夹ID"`
|
|
}
|
|
|
|
type DocsBatchDelete struct {
|
|
IDs []string `json:"ids" validate:"required" oai:"description=批量选择文件ID列表"`
|
|
}
|
|
|
|
type DocsBatchUpdate struct {
|
|
IDs []string `json:"ids" validate:"required" oai:"description=批量选择文件ID列表"`
|
|
FolderID *string `json:"folder_id" oai:"description=更新归属文件夹ID"`
|
|
}
|
|
|
|
type DocBatchResult struct {
|
|
ID string `json:"id" oai:"description=文档ID"`
|
|
Success bool `json:"success" oai:"description=操作是否成功"`
|
|
Error string `json:"message,omitempty" oai:"description=操作失败信息"`
|
|
}
|
|
|
|
type DocBatchResults []DocBatchResult
|
|
|
|
type CreateUploadURL struct {
|
|
FileName string `query:"file_name" validate:"required" oai:"description=上传文件名"`
|
|
}
|
|
|
|
type UploadURL struct {
|
|
URL string `json:"url" oai:"description=生成的预签名上传URL"`
|
|
ObjectName string `json:"object_name" oai:"description=上传文件名"`
|
|
}
|