feat(storage): add cos support

This commit is contained in:
neo-f
2023-03-23 13:52:44 +08:00
parent 05c133a4b5
commit a56f0b8150
13 changed files with 283 additions and 90 deletions

View File

@@ -1,6 +1,7 @@
package schema
import (
"net/url"
"octopus/pkg/tools"
"time"
@@ -63,8 +64,9 @@ type DocID struct {
}
type CreateDoc struct {
Name string `json:"name" validate:"required" oai:"description=文档名称"`
FolderID string `json:"folder_id" validate:"required" oai:"description=归属文件夹ID"`
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 {
@@ -104,3 +106,12 @@ func (q *ListDocQuery) Validate() error {
}
return nil
}
type CreateUploadURL struct {
FileName string `query:"file_name" validate:"required" oai:"description=上传文件名"`
}
type UploadURL struct {
URL url.URL `json:"url" oai:"description=生成的预签名上传URL"`
ObjectName string `json:"object_name" oai:"description=上传文件名"`
}