feat: 新增删除文件接口并支持多文件上传
- 新增 DeleteFile 接口,支持通过文件 URL 删除文件 - UploadFile 接口支持多文件上传,返回结果包含文件列表 - DownloadToBrowser 改为流式读取,避免大文件占用内存 - 移除 UploadFileBytes 字节流上传接口 - 修复租户存储容量校验顺序,先校验容量再写入 Redis
This commit is contained in:
@@ -17,10 +17,16 @@ type DownloadToBrowserReq struct {
|
||||
FileURL string `json:"fileURL" dc:"文件URL" in:"query"`
|
||||
}
|
||||
|
||||
type DeleteFileReq struct {
|
||||
g.Meta `path:"/deleteFile" method:"post" tags:"存储管理" summary:"删除文件" dc:"删除文件"`
|
||||
FileURL string `json:"fileUrl" dc:"文件URL"` // 文件URL
|
||||
}
|
||||
|
||||
// UploadFileReq 上传文件请求
|
||||
type UploadFileReq struct {
|
||||
g.Meta `path:"/uploadFile" method:"post" tags:"存储管理" summary:"上传文件" dc:"上传文件"`
|
||||
File *ghttp.UploadFile `json:"file" type:"file"` // 文件URL
|
||||
File *ghttp.UploadFile `json:"file" type:"file"` // 文件URL
|
||||
Files *ghttp.UploadFiles `json:"files" type:"files"` // 文件URL
|
||||
}
|
||||
|
||||
type UploadFile struct {
|
||||
@@ -31,17 +37,10 @@ type UploadFile struct {
|
||||
|
||||
// UploadFileRes 上传文件响应
|
||||
type UploadFileRes struct {
|
||||
FileURL string `json:"fileURL" dc:"上传地址"`
|
||||
FileSize int `json:"fileSize" dc:"文件大小"`
|
||||
FileName string `json:"fileName" dc:"文件名称"`
|
||||
FileFormat string `json:"fileFormat" dc:"文件格式"`
|
||||
FileAddressPrefix string `json:"fileAddressPrefix"`
|
||||
}
|
||||
|
||||
// UploadFileBytesReq 上传文件请求(字节流)
|
||||
type UploadFileBytesReq struct {
|
||||
g.Meta `path:"/uploadFileBytes" method:"post" tags:"存储管理" summary:"上传文件(字节流)" dc:"上传文件(字节流)"`
|
||||
FileName string `json:"fileName" dc:"文件名"`
|
||||
FileBytes []byte `json:"fileBytes" dc:"文件字节流"`
|
||||
FileStoreURL string `json:"fileStoreURL" dc:"文件存储的URL"`
|
||||
FileURL string `json:"fileURL" dc:"上传地址"`
|
||||
FileSize int `json:"fileSize" dc:"文件大小"`
|
||||
FileName string `json:"fileName" dc:"文件名称"`
|
||||
FileFormat string `json:"fileFormat" dc:"文件格式"`
|
||||
FileAddressPrefix string `json:"fileAddressPrefix"`
|
||||
Items []*UploadFileRes `json:"files"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user