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-08-10 07:23:28 +00:00
|
|
|
|
post /api/upload/upload-file-backend(UploadFileBackendReq) returns (response);
|
2023-07-11 03:33:43 +00:00
|
|
|
|
//生成二维码
|
|
|
|
|
@handler UploadQrcodeHandler
|
2023-07-21 07:20:18 +00:00
|
|
|
|
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-08-02 10:14:53 +00:00
|
|
|
|
|
|
|
|
|
// 上传LOGO
|
|
|
|
|
@handler UploadLogoHandler
|
|
|
|
|
post /api/upload/up-logo(UploadLogoReq) returns (response);
|
|
|
|
|
|
2023-10-30 04:04:12 +00:00
|
|
|
|
// 上传LOGO-DEBUG
|
|
|
|
|
@handler UploadLogoDebugHandler
|
|
|
|
|
post /api/upload/up-logo-debug(UploadLogoDebugReq) returns (response);
|
|
|
|
|
|
2023-08-07 03:34:22 +00:00
|
|
|
|
// 上传文件发起--base64
|
|
|
|
|
@handler UploadFileBaseHandler
|
|
|
|
|
post /api/upload/upload-file-base(UploadFileBaseReq) returns (response);
|
|
|
|
|
|
2023-08-18 08:47:22 +00:00
|
|
|
|
@handler UploadLogoStandardHandler
|
|
|
|
|
post /api/upload/up-standard-logo(UploadLogoStandardReq) returns (response);
|
|
|
|
|
|
2023-07-11 03:33:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-10-30 04:04:12 +00:00
|
|
|
|
type GetProductTemplateTagsRsp {
|
|
|
|
|
Id int64 `json:"id"`
|
|
|
|
|
TemplateTag string `json:"template_tag"`
|
|
|
|
|
IsDefaultTemplateTag bool `json:"is_default_template_tag"`
|
|
|
|
|
TemplateTagGroups interface{} `json:"template_tag_groups"`
|
|
|
|
|
Cover string `json:"cover"`
|
|
|
|
|
CoverMetadata interface{} `json:"cover_metadata"`
|
|
|
|
|
Colors [][]string `json:"colors"`
|
|
|
|
|
SelectedColorIndex int `json:"selected_color_index"`
|
|
|
|
|
ProductId int64 `json:"product_id"`
|
|
|
|
|
ProductCover string `json:"product_cover"`
|
|
|
|
|
ProductCoverMetadata interface{} `json:"product_cover_metadata"`
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-18 08:47:22 +00:00
|
|
|
|
type (
|
|
|
|
|
UploadLogoStandardReq {
|
|
|
|
|
IsRemoveBg string `form:"is_remove_bg"`
|
|
|
|
|
LogoFile string `form:"logo_file"`
|
|
|
|
|
Width string `form:"width"`
|
|
|
|
|
Height string `form:"height"`
|
|
|
|
|
Proportion int64 `form:"proportion"`
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
2023-08-07 03:34:22 +00:00
|
|
|
|
type (
|
|
|
|
|
UploadFileBaseReq {
|
2023-10-26 07:00:11 +00:00
|
|
|
|
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
|
|
|
|
FileKey string `form:"file_key"` // 上传唯一标识信息
|
|
|
|
|
FileData string `form:"file_data"` // 上传文件额外信息
|
|
|
|
|
Metadata string `form:"meta_data,optional"` // 上传文件额外信息
|
|
|
|
|
UserId int64 `form:"user_id,optional"` // 上传文件额外信息
|
|
|
|
|
GuestId int64 `form:"guest_id,optional"` // 上传文件额外信息
|
|
|
|
|
UploadBucket int64 `form:"upload_bucket,options=[1,2,3],default=1"` // 上传桶名:1=缓存,2=持久
|
|
|
|
|
Source string `form:"source"` // 上传来源
|
|
|
|
|
Refresh int64 `form:"refresh,optional"` // 强制更新 10
|
|
|
|
|
ResourceId string `form:"resource_id,optional"` // 资源ID
|
2023-08-07 03:34:22 +00:00
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
2023-10-30 04:04:12 +00:00
|
|
|
|
type (
|
|
|
|
|
UploadLogoDebugReq {
|
|
|
|
|
FileKey string `form:"file_key"` // 上传logo唯一标识信息
|
|
|
|
|
IsRemoveBg int64 `form:"is_remove_bg,optional"` // 是否要去掉背景
|
|
|
|
|
Proportion int64 `form:"proportion,default=60"` // 贴图在模型面板上的比例
|
|
|
|
|
SkuId int64 `form:"sku_id,default=0"` // 模板ID
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
2023-08-02 10:14:53 +00:00
|
|
|
|
type (
|
|
|
|
|
UploadLogoReq {
|
2023-08-10 11:08:06 +00:00
|
|
|
|
FileKey string `form:"file_key"` // 上传logo唯一标识信息
|
|
|
|
|
IsRemoveBg int64 `form:"is_remove_bg,optional"` // 是否要去掉背景
|
|
|
|
|
Proportion int64 `form:"proportion,default=60"` // 贴图在模型面板上的比例
|
|
|
|
|
SkuId int64 `form:"sku_id,default=0"` // 模板ID
|
2023-08-02 10:14:53 +00:00
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
2023-08-01 10:13:30 +00:00
|
|
|
|
type (
|
2023-08-10 07:23:28 +00:00
|
|
|
|
UploadFileBackendReq {
|
2023-10-26 07:00:11 +00:00
|
|
|
|
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
|
|
|
|
UploadBucket int64 `form:"upload_bucket,options=[1,2,3],default=1"` // 上传桶名:1=缓存,2=持久
|
|
|
|
|
FileKey string `form:"file_key"` // 上传唯一标识信息
|
|
|
|
|
FileSize int64 `form:"file_size,optional"` // 上传唯一标识信息
|
|
|
|
|
Metadata string `form:"meta_data,optional"` // 上传文件额外信息
|
|
|
|
|
Source string `form:"source"` // 上传来源
|
|
|
|
|
Refresh int64 `form:"refresh,optional"` // 强制更新 10
|
|
|
|
|
ResourceId string `form:"resource_id,optional"` // 资源ID
|
2023-08-01 10:13:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UploadFilesReq {
|
2023-10-26 07:00:11 +00:00
|
|
|
|
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
|
|
|
|
UploadBucket int64 `form:"upload_bucket,options=[1,2,3],default=1"` // 上传桶名:1=缓存,2=持久
|
|
|
|
|
UploadInfo string `form:"upload_info"` // 上传信息 json
|
|
|
|
|
Source string `form:"source"` // 上传来源
|
|
|
|
|
Refresh int64 `form:"refresh,optional"` // 强制更新 10
|
|
|
|
|
ResourceId string `form:"resource_id,optional"` // 资源ID
|
2023-08-01 10:13:30 +00:00
|
|
|
|
}
|
|
|
|
|
UploadCallbackReq {
|
2023-10-26 07:00:11 +00:00
|
|
|
|
UploadBucket int64 `form:"upload_bucket,options=[1,2,3],default=1"` // 上传桶名:1=缓存,2=持久
|
|
|
|
|
ResourceId string `form:"resource_id"` // 资源ID
|
|
|
|
|
ResourceType string `form:"resource_type"` // 资源类型
|
|
|
|
|
ResourceUrl string `form:"resource_url"` // 资源URL
|
|
|
|
|
Metadata string `form:"metadata,optional"` // 元数据,json格式,存储图像分率
|
|
|
|
|
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
|
|
|
|
Source string `form:"source"` // 上传来源
|
2023-08-01 10:13:30 +00:00
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
}
|