From db9efd558ea42730492530dcf41c9c12da2a4da3 Mon Sep 17 00:00:00 2001 From: "menghaiwen@fusen.cn" Date: Tue, 30 Jan 2024 15:36:41 +0800 Subject: [PATCH] =?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/order.proto | 114 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 service/order.proto diff --git a/service/order.proto b/service/order.proto new file mode 100644 index 0000000..81b00ee --- /dev/null +++ b/service/order.proto @@ -0,0 +1,114 @@ +syntax = "proto3"; //版本声明,使用v3版本 + +package order; +option go_package = "gitlab.fusenpack.com/backend/order;service"; + +// 导入google/api/annotations.proto 注释依赖 +import "google/api/annotations.proto"; +import "service/basic.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/any.proto"; + +//定义服务 +service order { + // 更新详情 + rpc OrderSave(OrderSaveReq) returns (OrderSaveRes) {} + + // 获取详情 + rpc OrderInfo(OrderInfoReq) returns (OrderInfoRes) {} + + // 获取列表 + rpc OrderList(OrderListReq) returns (OrderListRes) {} + + // 详情处理 + rpc DetailHandler(DetailHandlerReq) returns (DetailHandlerRes) {} +} +/* 详情处理 */ +message DetailHandlerReq{ + OrderDetailDb order_db = 1;// 订单数据库数据 +} +message DetailHandlerRes{} +/* 详情处理 */ + +/* 更新详情 */ +message OrderSaveReq{ + OrderFilter filter = 1; // 筛选条件 + OrderDetailDb save = 2; // 更新数据 +} +message OrderSaveRes{} +/* 更新详情 */ + +/* 获取详情 */ +message OrderInfoReq{ + OrderFilter filter = 1;// 筛选条件 +} +message OrderInfoRes{ + OrderInfo info = 1; // 详情数据 +} +/* 获取详情 */ + +/* 获取列表 */ +message OrderListReq{ + OrderFilter filter = 1; // 筛选条件 + int64 handle_type = 2; // 处理类型:0=原数据,1=返回处理数据 + + int64 current_page =101; // 当前页码 + int64 per_page =102; // 每页数量 + string order_by = 103; // 排序条件: 如 id desc,ctime desc +} +message OrderListRes{ + repeated OrderInfo list = 1;// 列表数据 + basic.Meta meta = 2; // 列表参数 +} +/* 获取列表 */ + +/* 过滤条件 */ +message OrderFilter { + optional int64 id = 1;// 主键ID + optional int64 user_id = 2; // 用户ID + optional int64 delivery_method = 3; // 物流类型 + optional string order_sn = 4; // 订单编号 + optional string order_source = 5; // 订单来源 + optional int64 status = 6; // 订单状态 + optional int64 is_del = 7; // 是否删除:0=否,1=是 + optional int64 pay_status = 8; // 支付状态 + optional int64 sale_gerent_id = 9; // 销售负责人 + optional int64 design_gerent_id = 10; //设计负责人 + + optional bytes other_filter = 101; // 其他筛选条件 + repeated int64 ids = 102; // 主键IDS +} + +/* 详情数据 */ +message OrderInfo { + OrderDetailDb order_detail_db = 1; // 原数据 + bytes order_detail = 2; // 处理后数据 +} + +/* 数据库 */ +message OrderDetailDb { + optional int64 id = 1; // 主键ID + optional int64 user_id = 2; // 用户ID + optional int64 delivery_method = 3; // 物流类型 + optional string order_sn = 4; // 订单编号 + optional string order_source = 5; // 订单来源 + optional int64 status = 6; // 订单状态 + optional bytes metadata = 7; // 额外参数 + optional string ctime = 8; // 创建时间 + optional string utime = 9; // 更新时间 + optional int64 is_del = 10; // 是否删除:0 = 否,1 = 是 + optional int64 pay_status = 11; // 支付状态 + optional bytes status_link = 12; // 订单状态链路 + optional bytes order_product = 13; // 订单商品 + optional bytes order_address = 14; // 订单地址 + optional bytes order_amount = 15; // 订单金额 + optional bytes pay_status_link = 16; // 支付状态链路 + optional bytes shopping_cart_snapshot = 17; // 购物车快照 + optional bytes shopping_product_snapshot = 18; // 购物车商品快照 + optional int64 sale_gerent_id = 19; // 销售负责人 + optional int64 design_gerent_id = 20; // 设计负责人 + optional bytes scm = 21; // 供应链管理 +} + + +