25 lines
603 B
Go
Raw Normal View History

2023-10-08 15:59:42 +07:00
package entity
import "mime/multipart"
type UploadFileRequest struct {
FileHeader *multipart.FileHeader
FolderName string
FileSize int64 `validate:"max=10000000"` // 10Mb = 10000000 byte
Ext string `validate:"oneof=.png .jpeg .jpg .pdf .xlsx .csv"`
}
type DownloadFileRequest struct {
FileName string `query:"file_name" validate:"required"`
FolderName string `query:"folder_name" validate:"required"`
}
type UploadFileResponse struct {
FilePath string `json:"file_path"`
FileUrl string `json:"file_url"`
}
type DownloadFileResponse struct {
FileUrl string `json:"file_url"`
}