Files
oss/model/dto/file_dto.go

47 lines
1.7 KiB
Go
Raw Normal View History

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"`
}