From 2031059ec23675d23531af51887abd5f89cc6891 Mon Sep 17 00:00:00 2001 From: "laodaming@fusen.cn" Date: Wed, 6 Dec 2023 12:12:56 +0800 Subject: [PATCH 1/2] update --- service/fsservice.proto | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/service/fsservice.proto b/service/fsservice.proto index e305606..3ea6f68 100644 --- a/service/fsservice.proto +++ b/service/fsservice.proto @@ -138,6 +138,13 @@ service product { get: "/api/product/tag_product_list" }; } + //计算产品价格 + rpc CalculateProductPrice(CalculateProductPriceReq) returns (CalculateProductPriceRsp) { + option (google.api.http) = { + post: "/api/product/calculate_product_price" + body: "*" + }; + } } message UserInfoRequest { @@ -241,4 +248,22 @@ message GetProductListReq{ int64 merchant_type = 2; //商户类型 string template_tag = 3; //模板标签 bool with_product = 4; //是否携带分类下的产品 +} +//计算产品价格 +message CalculateProductPriceReq{ + int64 product_id = 1; + int64 size_id = 2; + int64 fitting_id = 3; + int64 purchase_quantity = 4; +} +message CalculateProductPriceRsp{ + string item_price = 1; + string total_price = 2; + StepRange step_range = 3; +} +message StepRange{ + int64 start = 1;//起点 + int64 end = 2;//终点 + string range_description = 3;//描述 + string item_price = 4;//单价 } \ No newline at end of file From 43b7ba09291248bdb066a01796106b2dec9c1318 Mon Sep 17 00:00:00 2001 From: "menghaiwen@fusen.cn" Date: Wed, 6 Dec 2023 16:18:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/resource.proto | 77 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/service/resource.proto b/service/resource.proto index e65d416..8c3f064 100644 --- a/service/resource.proto +++ b/service/resource.proto @@ -10,8 +10,8 @@ import "google/protobuf/struct.proto"; import "google/protobuf/any.proto"; //定义服务 -service resource { - +service resource { + // 获取资源详情 rpc GetResourceInfo(GetResourceInfoReq) returns (basic.Response) { option (google.api.http) = { @@ -25,7 +25,80 @@ service resource { get: "/api/resource/list" }; } + + // 后端上传--单文件 + rpc UploadFileBackend(UploadFileBackendReq) returns (UploadFileBackendRes) { + option (google.api.http) = { + post: "/api/resource/upload-file-backend", + body: "*" + }; + } + + // 后端上传--分片上传 + rpc UploadFileBackendFragment(UploadFileBackendFragmentReq) returns (UploadFileBackendFragmentRes) { + option (google.api.http) = { + post: "/api/resource/upload-file-backend-fragment", + body: "*" + }; + } } + +/* 后端上传--分片上传 */ +message UploadFileBackendFragmentReq { + string file_name = 1; // 文件名 + bytes file_content = 2; // 文件流 + bytes file_header = 3; // 文件头 + string file_data = 4; // base64 + + int64 chunk_number = 5; // 当前分片号:1、2、3 + int64 total_chunks = 6; // 总分片数:3 + int64 user_id = 7; + int64 guest_id = 8; + + int64 api_type = 10; // 请求类型:1=对外,2=对内' + int64 upload_bucket = 11; // 上传桶类型 + string file_key = 12; // 哈希 + string source = 13;// 来源 + string metadata = 14; // json格式 + int64 refresh = 15; // 是否覆盖 + string resource_id = 16; // 资源ID + string backup_type = 17; // 资源备份:oss + string upload_type = 18; // 上传方式:s3 +} +message UploadFileBackendFragmentRes { + string resource_type = 5; + string resource_id = 4; + string resource_url = 6; +} +/* 后端上传--分片上传 */ + +/* 后端上传--单文件 */ +message UploadFileBackendReq { + string file_name = 1; // 文件名 + bytes file_content = 2; // 文件流 + bytes file_header = 3; // 文件头 + int64 user_id = 4; + int64 guest_id = 5; + string file_data = 6; // base64 + + int64 api_type = 10; // 请求类型:1=对外,2=对内' + int64 upload_bucket = 11; // 上传桶类型 + string file_key = 12; // 哈希 + string source = 13;// 来源 + string metadata = 14; // json格式 + int64 refresh = 15; // 是否覆盖 + string resource_id = 16; // 资源ID + string backup_type = 17; // 资源备份:oss + string upload_type = 18; // 上传方式:s3 +} + +message UploadFileBackendRes{ + string resource_type = 5; + string resource_id = 4; + string resource_url = 6; +} +/* 后端上传--文件流--单文件 */ + /* 获取资源列表 */ message GetResourceListReq{ optional string resource_id = 1;