Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop

This commit is contained in:
eson
2023-07-06 18:23:43 +08:00
60 changed files with 1575 additions and 242 deletions

View File

@@ -25,6 +25,15 @@ type Auth {
RefreshAfter int64 `json:"refreshAfter"`
}
// File 文件
type File {
Filename string `fsfile:"filename"`
Header map[string][]string `fsfile:"header"`
Size int64 `fsfile:"size"`
Data []byte `fsfile:"data"`
}
// 统一分页
type Meta struct {
TotalCount int64 `json:"totalCount"`

View File

@@ -28,6 +28,9 @@ service product {
//获取产品信息
@handler GetProductInfoHandler
get /product/info(GetProductInfoReq) returns (response);
//保存设计信息
@handler SaveDesignHandler
post /product/save-design(SaveDesignReq) returns (response);
}
//获取产品列表
@@ -99,15 +102,14 @@ type PriceObj {
Num int `json:"num"`
Price float64 `json:"price"`
}
//获取保存的设计信息
type GetProductDesignReq {
Sn string `form:"sn"`
}
type GetProductDesignRsp {
ProductId int64 `json:"product_id"`
TemplateId int64 `json:"template_id"`
MaterialId int64 `json:"material_id"`
ProductId int64 `json:"product_id"`
TemplateId int64 `json:"template_id"`
//MaterialId int64 `json:"material_id"`
SizeId int64 `json:"size_id"`
OptionalId int64 `json:"optional_id"`
Cover string `json:"cover"`
@@ -162,4 +164,65 @@ type SizeTitle {
type MaterialItem {
Id int64 `json:"id"`
Title string `json:"title"`
}
//保存设计信息
type SaveDesignReq {
Data string `json:"data"` //加密信息
}
type SaveDesignRsp {
Sn string `json:"sn"`
}
//保存设计信息(解密结构体)
type SaveDesignReqRealStruct {
ProductId int64 `json:"product_id"`
SizeId int64 `json:"size_id"`
OptionalId int64 `json:"optional_id"`
TemplateId int64 `json:"template_id"`
Sn string `json:"sn"`
Data DesignData `json:"data"`
Cover string `json:"cover"`
PageGuid string `json:"pageGuid"`
}
type DesignData {
MainColor ColorFill `json:"MainColor"`
SecondaryColor ColorFill `json:"SecondaryColor"`
Logo DesignLogo `json:"Logo"`
Slogan DesignSlogan `json:"Slogan"`
QRcode DesignQRcode `json:"QRcode"`
Website DesignWebsite `json:"Website"`
Phone DesignPhone `json:"Phone"`
Address DesignAddress `json:"Address"`
}
type DesignAddress {
Text string `json:"text"`
IfShow bool `json:"ifShow"`
}
type DesignPhone {
Text string `json:"text"`
IfShow bool `json:"ifShow"`
}
type DesignWebsite {
Text string `json:"text"`
IfShow bool `json:"ifShow"`
}
type DesignQRcode {
Text string `json:"text"`
SvgPath string `json:"svgPath"`
IfShow bool `json:"ifShow"`
}
type DesignSlogan {
Text string `json:"text"`
IfShow bool `json:"ifShow"`
}
type DesignLogo {
Material string `json:"material"`
MaterialName string `json:"materialName"`
MaterialTime string `json:"materialTime"`
Fill string `json:"fill"`
FillName string `json:"fill_name"`
Colors []string `json:"colors"`
}
type ColorFill {
Fill string `json:"fill"`
}

View File

@@ -14,20 +14,26 @@ type RequestUpFile {
IsCut string `form:"is_cut"` // 是否裁剪
}
type RequestUploadFile {
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"` // 类别
}
service upload {
@handler UploadUpFileHandler
get /upload/up-file(RequestUpFile) returns (response);
@handler UploadFileFrontendHandler
post /upload/upload-file-frontend(RequestUploadFile) returns (response);
post /upload/upload-file-frontend(RequestUploadFileFrontend) returns (response);
@handler UploadFileBackendHandler
post /upload/upload-file-backend(RequestUploadFile) returns (response);
post /upload/upload-file-backend(RequestUploadFileBackend) returns (response);
}