feat: import services and standardize Go 1.26.5

This commit is contained in:
2026-08-09 10:43:45 +08:00
parent 689c74b28f
commit 86024fa81d
1456 changed files with 220765 additions and 2 deletions

View File

@@ -0,0 +1,94 @@
syntax = "proto3";
package order;
option go_package = "./order";
message Empty{
}
message FetchRequest {
int64 page_no=1 [json_name="page_no"]; // 页数
int64 page_size=2 [json_name="page_size"]; // 每页记录数
map<string,string> params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11
}
message IdentRequest{
int64 id = 1; // 唯一ID
string identity = 2; // 唯一码
string reason = 3;// 退款原因
int32 approve = 4;// 状态:-2未通过0默认 1:申请退款 2:申请退货 3申请退款退货 4申请通过
string agency = 5 ;// 代理
string store_identity = 6;// 店铺标识
}
message StatusReply{
int32 code = 1; // 状态码
string identity=2; // 标识码
string message=3; //状态说明
int64 timeseq=4; // 响应时间序列
string reason=5; // 退款原因
}
message OrderSummaryItem {
int64 id = 1; // ID
string order_no = 2 [json_name="order_no"]; // 订单编号
int64 partner_id =3 [json_name="partner_id"]; // 合伙人ID
string identity = 4; // 定单唯一标识
int64 total_price = 7 [json_name="total_price"]; // 总价
int64 trans_price = 8 [json_name="trans_price"]; // 交易金额
int64 refund_price = 9 [json_name="refund_price"]; // 退款金额
int64 logistics_fee = 11 [json_name="logistics_fee"]; // 物流费用
int64 coupon_amount = 12 [json_name="coupon_amount"]; // 优惠券金额
string remark = 13; // 备注
int32 status = 14; // 订单状态all全部订单notarize确认中sign签约中signed签约完成,fulfil履约中accomplish完成
string logistics_number = 15 [json_name="logistics_number"]; // 物流号
string address_identity = 16 [json_name="address_identity"]; // 地址库唯一标识
string county = 17; // 国家
string province = 18; // 省
string city = 19; // 市
string area = 20; // 县
string address = 21; // 详细地址
string contact = 22; // 联系人
string phone = 23; // 联系电话
string delivery_time = 24 [json_name="delivery_time"]; // 配送时间
string delivery_identity = 25 [json_name="delivery_identity"]; // 配送工作人员唯一标识
int32 pay_type = 26 [json_name="pay_type"]; // 支付类型0:待支付1:线下支付2:微信 3:支付宝,4:余额
int64 pay_amount = 27 [json_name="pay_amount"]; // 支付金额
string pay_trade_no = 28 [json_name="pay_trade_no"]; // 支付交易号
string pay_time = 29 [json_name="pay_time"]; // 支付时间
string pay_remark = 30 [json_name="pay_remark"]; // 支付备注
string created = 31; // 创建时间
string updated = 32; // 最后创建时间
repeated OrderDetails details =33; //订单商品
string addr = 34; // 简单地址信息
string car_identity = 35 [json_name="car_identity"]; // 配送车辆唯一标识
string delivery_address = 36 [json_name="delivery_address"]; // 配送地址
string brand = 37; // 配送车辆品牌
string version = 38; // 配送车辆型号
string license_number = 39 [json_name="license_number"]; // 配送车辆车牌号
string member_name = 40 [json_name="member_name"]; // 配送员姓名
string member_phone = 41 [json_name="member_phone"]; // 配送员电话
int32 approve = 42;// 审批
}
message OrderDetails{
int64 id = 1; // ID
int64 product_id = 2 [json_name="product_id"]; // 商品规格ID
string spec_no = 3 [json_name="spec_no"]; // 商品规格编号
string spec = 4; // 商品规格名称
int64 type = 5; // 商品类型
string title = 6; //商品名称
string cover_image = 7 [json_name="cover_image"]; //商品封面图片
int64 sales_price = 8 [json_name="sales_price"]; //商品销售价格
string product_args = 9 [json_name="product_args"]; // 商品参数
int64 number = 10; // 数量
int64 unit_price = 11 [json_name="unit_price"]; // 单价
int64 spec_id = 12 [json_name="spec_id"]; // 商品规格id
string product_identity = 13 [json_name="product_identity"]; // 产品唯一标识
int64 gas_types = 14 [json_name="gas_types"];// 商品类型:1其它商品 2按瓶计费,3 按kg计费
int64 total_price = 15 [json_name="total_price"];// 总价
}

View File

@@ -0,0 +1,71 @@
syntax = "proto3";
package order;
option go_package = "./order";
import "blocks.proto";
// Order(订单)微服务-购物车
service Cart {
// 获取购物车的商品数据
rpc Fetch(CartGetRequest) returns (CartGetReply) {};
// 将商品增加至购物车
rpc Create(CartAddRequest) returns (StatusReply) {};
// 修改购物车中的商品数量
rpc Modify(CartSetRequest) returns (StatusReply) {};
// 删除购物车中的商品
rpc Delete(CartDelRequest) returns (StatusReply) {};
}
message CartGetRequest {
string car_identity =1 [json_name="car_identity"]; // 购物车唯一码,主要是用于未登录购物
string passport_identity =2 [json_name="passport_identity"]; // 登录后的用户唯一码
string passport = 3;// 用户
}
message CartGetReply {
repeated CartItem data = 1; // 购物车中的商品数据列表
string car_identity = 2 [json_name="car_identity"]; // 当前账号购物车唯一标识
}
message CartItem{
int64 id = 1; // ID
int64 product_id = 2 [json_name="product_id"]; // 商品ID
string title = 3; //商品名称
string cover_image = 4 [json_name="cover_image"]; //商品封面图片
int64 sales_price = 5 [json_name="sales_price"]; //商品销售价格
string product_identity =6 [json_name="product_identity"]; // 产品唯一码
string product_args =7 [json_name="product_args"]; // 商品属性
int32 number = 8; // 数量
int64 unit_price = 9 [json_name="unit_price"]; // 实际单价
int64 total_price = 10 [json_name="total_price"]; // 总价
string identity = 11; // 购物车商品信息唯一标识
}
message CartAddRequest {
string cart_identity =1 [json_name="cart_identity"]; // 购物车唯一码,主要是用于未登录购物
string passport_identity =2 [json_name="passport_identity"]; // 登录后的用户唯一码
string product_identity =3 [json_name="product_identity"]; // 商品唯一码
int64 product_id = 4 [json_name="product_id"]; // 商品ID
string product_args =5 [json_name="product_args"]; // 商品属性
int32 number = 6; // 数量
int64 spec_id = 7 [json_name="spec_id"]; // 规格id
}
message CartSetRequest {
string identity = 1; // 购物车Identity
int32 number = 2; // 数量
int64 unit_price = 3 [json_name="unit_price"]; // 单价
int64 id = 4;// 商品ID
repeated Updates updates = 5;// 批量更新
}
message Updates {
int64 id = 1;// 商品ID
int64 number = 2; // 数量
}
message CartDelRequest {
repeated int64 id = 3; // 购物车ID
}

View File

@@ -0,0 +1,30 @@
syntax = "proto3";
package order;
option go_package = "./order";
import "blocks.proto";
// Order(订单)微服务-优惠卷
service Coupon {
// 按状态获取优惠卷
rpc ByStatus(Status) returns (CouponListReply) {};
}
message Status {
int32 status = 1; //优惠卷状态
}
message CouponListReply {
repeated CouponItem data = 1; // 购物车中的商品数据列表
}
message CouponItem{
int64 id = 1; // ID
string identity = 2; // 唯一码
string title = 3; //标题
string intro = 4; //描述
string amount = 5; //金额
string started =6; // 开始时间
string expired =7; // 结束时间
string status =8; // 状态
}

View File

@@ -0,0 +1,68 @@
syntax = "proto3";
package order;
option go_package = "./order";
import "blocks.proto";
// Order(订单)微服务-订单模块
// 订单管理类模块
service Mgt {
// 创建订单
rpc OrderCreate(CreateOrderRequest) returns (StatusReply) {};
// 修改订单
rpc OrderModify(OrderSummaryItem) returns (StatusReply) {};
// 获取一个订单的详情数据
rpc OrderGet(IdentRequest) returns (OrderGetReply) {};
// 根据不同的类型获取店铺的订单列表
rpc OrderListByStore(OrderListByStoreRequest) returns (OrderListByStoreReply) {};
// 取消订单
rpc OrderCancel(IdentRequest) returns (StatusReply) {};
// 退货
rpc OrderReturnable(IdentRequest) returns (StatusReply) {};
// 订单审批
rpc OrderApprove(IdentRequest) returns (StatusReply) {};
}
message CreateOrderRequest{
int32 partner_id =1 [json_name="partner_id"]; // 合伙人ID
string args = 2; // 相关参数
string address_identity = 3 [json_name="address_identity"]; // 地址库唯一标识
string delivery_time=4 [json_name="delivery_time"]; // 预约配送时间
repeated SpecList spec = 5;
}
message SpecList {
int32 number = 1; // 数量
string product_identity = 2 [json_name="product_identity"]; // 商品唯一标识
}
message OrderGetReply {
OrderSummaryItem summary = 1; // 订单概要详情
}
message OrderListByStoreRequest {
int32 pay_type = 1 [json_name="pay_type"]; // 支付类型0:待支付1:线下支付2:微信 3:支付宝,4:余额
repeated int32 order_status= 2 [json_name="order_status"]; // 订单状态 1未支付 2已支付 3已发货 4已收货 5:已完成 6:已收货退款 7未发货退款 8:已退货 -1已取消
int64 page_no=3 [json_name="page_no"]; // 页数
int64 page_size=4 [json_name="page_size"]; // 每页记录数
int64 partner_id = 5 [json_name="partner_id"];// 分销商ID
string agency = 6 ;// 代理
string store_identity = 7;// 店铺标识
int32 status = 8;// 订单状态
string keyword = 9;// 关键字
}
message OrderListByStoreReply {
int32 count = 1;
repeated OrderSummaryItem data = 2; // 订单列表
}

View File

@@ -0,0 +1,124 @@
syntax = "proto3";
package order;
option go_package = "./order";
import "blocks.proto";
// Order(订单)微服务-订单模块
// C端模块
service Summary {
// 快速创建一个店铺订单
rpc QuickCreateByProduct(QuickCreateByProductRequest) returns (StatusReply) {};
// 将购物车的数据提交生成订单
rpc Submit(SubmitRequest) returns (StatusReply) {};
// 检测是否有未确认及付款的订单
rpc Check(Empty) returns (StatusReply) {};
// 获取一个订单的详情数据
rpc Get(IdentRequest) returns (SummaryGetReply) {};
// 根据不同的类型获取我的订单列表
rpc List(SummaryListRequest) returns (SummaryListReply) {};
// 确认订单,物流,优惠卷等其它信息
rpc Confirm(ConfirmRequest) returns (ConfirmReply) {};
// 取消订单
rpc Cancel(CancelRequest) returns (StatusReply) {};
// 模拟支付
rpc SimulatePay(SimulatePayRequest) returns (StatusReply) {};
// 模拟发货
rpc SimulateShipments(SimulateShipmentsRequest) returns (StatusReply) {};
// 模拟收货
rpc SimulateReceiving(IdentRequest) returns (StatusReply) {};
}
message SimulateShipmentsRequest{
string identity = 1; // 订单唯一标识
string item_idetity = 2 [json_name="item_idetity"]; // 配送团队唯一标识
string member_identity = 3 [json_name="member_identity"]; // 配送人员唯一标识
string car_identity =4 [json_name="car_identity"]; // 配送车辆唯一标识
}
message SubmitReply{
int64 status = 1; // 状态码
repeated string identity=2; // 标识码
string message=3; //状态说明
int64 timeseq=4; // 响应时间序列
}
message SimulatePayRequest{
repeated string identity = 1;
}
message QuickCreateByProductRequest{
int32 partner_id =1 [json_name="partner_id"]; // 合伙人ID
string store_identity =2 [json_name="store_identity"]; // 店铺唯一标识
string product_identity = 3 [json_name="product_identity"]; // 商品唯一标识
int32 number = 4; // 数量
string args = 5; // 相关参数
string address_identity = 6 [json_name="address_identity"]; // 地址库唯一标识
string delivery_time=7 [json_name="delivery_time"]; // 预约配送时间
string spec_identity = 8 [json_name="spec_identity"]; // 规格identity
string member_identity = 9 [json_name="member_identity"]; // 配送员唯一标识
string delivery_address = 10 [json_name="delivery_address"]; // 配送地址
}
message SubmitRequest {
repeated string id = 1; // 购物车的ID数据以逗号分开
int32 partner_id =2 [json_name="partner_id"]; // 合伙人ID
string store_identity =3 [json_name="store_identity"]; // 店铺唯一标识
string address_identity = 4 [json_name="address_identity"]; // 地址库唯一标识
string delivery_time=5 [json_name="delivery_time"]; // 预约配送时间
OrderAddress address = 6;// 地址详情
}
message OrderAddress {
string country = 1; // 国家
string province = 2; // 省/州
string city = 3; // 市
string area = 4; // 区
string detail = 5; // 详细地址
string contact = 6; // 联系人
string phone = 7; // 手机号码
string email = 8; // 邮箱
string zip_code = 9; // 邮编
}
message SummaryGetReply {
OrderSummaryItem summary = 1; // 订单概要详情
}
message SummaryListRequest {
int32 pay_type = 1 [json_name="pay_type"]; // 支付类型0:待支付1:线下支付2:微信 3:支付宝,4:余额
int32 order_status= 2 [json_name="order_status"]; // 订单状态 1未支付 2已支付 3已发货 4已收货 5:已完成 6:已收货退款 7未发货退款 8:已退货 -1已取消
int64 page_no = 3 [json_name="page_no"];
int64 page_size = 4 [json_name="page_size"];
}
message SummaryListReply {
int32 count = 1;
repeated OrderSummaryItem data = 2; // 订单列表
}
message ConfirmRequest {
string order_no = 1 [json_name="order_no"]; // 订单唯一码
string address_identity = 2 [json_name="address_identity"]; // 地址identity
string coupon_identity = 3 [json_name="coupon_identity"]; // 优惠卷
string remark = 4; //备注
double logistics_fee = 5 [json_name="logistics_fee"]; //运费
}
message ConfirmReply {
int64 total_price = 1 [json_name="total_price"]; // 总价
}
message CancelRequest {
string order_no = 1 [json_name="order_no"]; // 订单唯一码
string type = 2; // 订单类型
}