90 lines
2.5 KiB
Plaintext
90 lines
2.5 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: // TODO: add title
|
|
desc: // TODO: add description
|
|
author: ""
|
|
email: ""
|
|
)
|
|
|
|
import "basic.api"
|
|
|
|
// @server(
|
|
// middleware: Tracing // 路由中间件声明
|
|
// )
|
|
|
|
service resource {
|
|
@handler LogoCombineHandler
|
|
post /api/resource/logo-combine(LogoCombineReq) returns (response);
|
|
|
|
@handler LogoRemovebgHandler
|
|
post /api/resource/logo-removebg(LogoRemovebgReq) returns (response);
|
|
|
|
@handler ResourceInfoHandler
|
|
get /api/resource/info(ResourceInfoReq) returns (response);
|
|
|
|
@handler LogoResizeHandler
|
|
post /api/resource/logo-resize(LogoResizeReq) returns (response);
|
|
|
|
@handler ResourceBackupHandler
|
|
post /api/resource/backup(ResourceBackupReq) returns (response);
|
|
}
|
|
|
|
type (
|
|
ResourceBackupReq {
|
|
TableName string `json:"table_name"`
|
|
}
|
|
)
|
|
|
|
type (
|
|
LogoResizeReq {
|
|
ResourceId string `form:"resource_id"`
|
|
Width int64 `form:"width"`
|
|
Height int64 `form:"height"`
|
|
}
|
|
LogoResizeRes struct{}
|
|
)
|
|
|
|
type (
|
|
LogoRemovebgReq {
|
|
IsRemoveBg string `form:"is_remove_bg"`
|
|
LogoFile string `form:"logo_file"`
|
|
Width string `form:"width"`
|
|
Height string `form:"height"`
|
|
Proportion string `form:"proportion"`
|
|
}
|
|
)
|
|
|
|
type (
|
|
ResourceInfoReq {
|
|
ResourceId string `form:"resource_id,optional"` // 资源ID
|
|
ResourceKey string `form:"resource_key,optional"` // 资源唯一标识
|
|
}
|
|
)
|
|
|
|
type (
|
|
LogoCombineReq {
|
|
Resolution string `json:"resolution"` // 合图参数
|
|
LogoUrl string `json:"logo_url"` // 合图参数
|
|
TemplateTagColor TemplateTagColor `json:"template_tag_color"`
|
|
TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"`
|
|
TemplateId int64 `json:"template_id"` // 合图参数
|
|
TemplateTag string `json:"template_tag"` // 合图参数
|
|
Website string `json:"website,optional"` // 合图参数
|
|
Slogan string `json:"slogan,optional"` // 合图参数
|
|
Address string `json:"address,optional"` // 合图参数
|
|
Phone string `json:"phone,optional"` // 合图参数
|
|
Qrcode string `json:"qrcode,optional"` // 合图参数
|
|
}
|
|
TemplateTagColor {
|
|
Colors [][]string `json:"colors"` // 颜色组合
|
|
SelectedColorIndex int `json:"selected_color_index"` // 主色的下标索引
|
|
}
|
|
|
|
TemplateTagGroups {
|
|
Tag string `json:"tag"`
|
|
Name string `json:"name"`
|
|
Value string `json:"value"`
|
|
Fixed int64 `json:"fixed"`
|
|
}
|
|
) |