syntax = "v1" info ( title: // TODO: add title desc: // TODO: add description author: "" email: "" ) import "basic.api" service upload { @handler UploadUpFileHandler get /api/upload/up-file(RequestUpFile) returns (response); @handler UploadFileFrontendHandler post /api/upload/upload-file-frontend(RequestUploadFileFrontend) returns (response); @handler UploadFileBackendHandler post /api/upload/upload-file-backend(RequestUploadFileBackend) returns (response); //生成二维码 @handler UploadQrcodeHandler post /api/upload/qrcode(UploadQrcodeReq) returns (response); } type RequestUpFile { UpFile string `form:"upfile"` IsCut string `form:"is_cut"` // 是否裁剪 } type RequestUploadFileFrontend { FileName string `json:"file_name"` // 文件名 FileType string `json:"file_type"` // Image / fbx / hdr FileSize int64 `json:"file_size"` // 文件大小 Category string `json:"category"` // 类别 } type RequestUploadFileBackend { File File `file:"file"` // 文件名 FileType string `form:"file_type"` // Image / fbx / hdr Category string `form:"category"` // 类别 } //生成二维码 type UploadQrcodeReq { Url string `json:"url"` QRcodeType int64 `json:"QRcodeType"` } type UploadQrcodeRsp { Link string `json:"link"` Data string `json:"d"` }