- 新增 DeleteFile 接口,支持通过文件 URL 删除文件 - UploadFile 接口支持多文件上传,返回结果包含文件列表 - DownloadToBrowser 改为流式读取,避免大文件占用内存 - 移除 UploadFileBytes 字节流上传接口 - 修复租户存储容量校验顺序,先校验容量再写入 Redis
47 lines
1.7 KiB
Go
47 lines
1.7 KiB
Go
package dto
|
|
|
|
import (
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
|
)
|
|
|
|
type DownloadToFileReq struct {
|
|
g.Meta `path:"/downloadToFile" method:"post" tags:"存储管理" summary:"下载文件到本地" dc:"下载文件到本地"`
|
|
FileURL string `json:"fileURL" dc:"文件URL"`
|
|
LocalPath string `json:"localPath" dc:"本地路径"`
|
|
}
|
|
|
|
// DownloadToBrowserReq 下载文件到浏览器请求
|
|
type DownloadToBrowserReq struct {
|
|
g.Meta `path:"/downloadToBrowser" method:"post" tags:"存储管理" summary:"下载文件到浏览器" dc:"下载文件到浏览器"`
|
|
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
|
|
Files *ghttp.UploadFiles `json:"files" type:"files"` // 文件URL
|
|
}
|
|
|
|
type UploadFile struct {
|
|
TenantId uint64 `json:"tenantId"`
|
|
FileURL string `json:"fileURL"`
|
|
FileSize int `json:"fileSize"`
|
|
}
|
|
|
|
// 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"`
|
|
Items []*UploadFileRes `json:"files"`
|
|
}
|