2023-07-05 11:00:33 +00:00
|
|
|
syntax = "v1"
|
2023-07-04 11:59:54 +00:00
|
|
|
|
|
|
|
info (
|
|
|
|
title: // TODO: add title
|
|
|
|
desc: // TODO: add description
|
|
|
|
author: ""
|
|
|
|
email: ""
|
|
|
|
)
|
|
|
|
|
|
|
|
import "basic.api"
|
|
|
|
|
|
|
|
type RequestUpFile {
|
2023-07-05 11:00:33 +00:00
|
|
|
UpFile string `form:"upfile"`
|
|
|
|
IsCut string `form:"is_cut"` // 是否裁剪
|
2023-07-04 11:59:54 +00:00
|
|
|
}
|
|
|
|
|
2023-07-06 10:23:43 +00:00
|
|
|
type RequestUploadFileFrontend {
|
2023-07-05 11:00:33 +00:00
|
|
|
FileName string `json:"file_name"` // 文件名
|
|
|
|
FileType string `json:"file_type"` // Image / fbx / hdr
|
|
|
|
FileSize int64 `json:"file_size"` // 文件大小
|
|
|
|
Category string `json:"category"` // 类别
|
2023-07-04 11:59:54 +00:00
|
|
|
}
|
|
|
|
|
2023-07-06 10:23:43 +00:00
|
|
|
type RequestUploadFileBackend {
|
|
|
|
File File `file:"file"` // 文件名
|
|
|
|
FileType string `form:"file_type"` // Image / fbx / hdr
|
|
|
|
Category string `form:"category"` // 类别
|
2023-07-04 11:59:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service upload {
|
|
|
|
@handler UploadUpFileHandler
|
|
|
|
get /upload/up-file(RequestUpFile) returns (response);
|
2023-07-05 11:00:33 +00:00
|
|
|
|
|
|
|
@handler UploadFileFrontendHandler
|
2023-07-06 10:23:43 +00:00
|
|
|
post /upload/upload-file-frontend(RequestUploadFileFrontend) returns (response);
|
2023-07-05 11:00:33 +00:00
|
|
|
|
|
|
|
@handler UploadFileBackendHandler
|
2023-07-06 10:23:43 +00:00
|
|
|
post /upload/upload-file-backend(RequestUploadFileBackend) returns (response);
|
2023-07-04 11:59:54 +00:00
|
|
|
}
|