fusenapi/server_api/upload.api

85 lines
2.7 KiB
Plaintext
Raw Normal View History

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"
2023-07-11 03:33:43 +00:00
service upload {
@handler UploadUpFileHandler
2023-07-12 03:09:43 +00:00
get /api/upload/up-file(RequestUpFile) returns (response);
2023-08-01 10:13:30 +00:00
2023-07-11 03:33:43 +00:00
@handler UploadFileFrontendHandler
2023-07-12 03:09:43 +00:00
post /api/upload/upload-file-frontend(RequestUploadFileFrontend) returns (response);
2023-08-01 10:13:30 +00:00
2023-07-11 03:33:43 +00:00
@handler UploadFileBackendHandler
2023-07-12 03:09:43 +00:00
post /api/upload/upload-file-backend(RequestUploadFileBackend) returns (response);
2023-07-11 03:33:43 +00:00
//生成二维码
@handler UploadQrcodeHandler
post /api/upload/qrcode(UploadQrcodeReq) returns (response);
2023-08-01 10:13:30 +00:00
// 上传文件发起--单个文件--后端上传
@handler UploadFilesBackendHandler
post /api/upload/upload-files-backend(UploadFilesReq) returns (response);
// 上传文件发起--多个文件--前端上传
@handler UploadFilesFrontendHandler
post /api/upload/upload-files-frontend(UploadFilesReq) returns (response);
// 上传文件回调
@handler UploadCallbackHandler
post /api/upload/upload-callback(UploadCallbackReq) returns (response);
2023-07-11 03:33:43 +00:00
}
2023-08-01 10:13:30 +00:00
type (
UploadInfo {
2023-08-01 11:49:56 +00:00
FileSize int64 `form:"file_size,optional"` // 上传唯一标识信息
2023-08-01 10:13:30 +00:00
FileKeys string `form:"file_keys,optional"` // 上传唯一标识信息
2023-08-02 03:13:28 +00:00
Metadata string `form:"meta_data,optional"` // 上传文件额外信息
2023-08-01 10:13:30 +00:00
}
UploadFilesReq {
2023-08-02 03:13:28 +00:00
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型1=对外2=对内
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
UploadInfo string `form:"upload_info"` // 上传信息 json
2023-08-01 10:13:30 +00:00
}
UploadCallbackReq {
FileType string `form:"file_type"` // 文件类型 / fbx / hdr
UploadKey string `form:"upload_key"` // 上传KEY
UploadBucket string `form:"upload_bucket"` // 上传桶名
Version string `form:"version,optional"` // 版本信息
Metadata string `form:"metadata,optional"` // 元数据,json格式,存储图像分率
}
)
2023-07-04 11:59:54 +00:00
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
}
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
}
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
}
2023-07-11 03:33:43 +00:00
//生成二维码
type UploadQrcodeReq {
Url string `json:"url"`
QRcodeType int64 `json:"QRcodeType"`
}
type UploadQrcodeRsp {
Link string `json:"link"`
Data string `json:"d"`
2023-07-04 11:59:54 +00:00
}