javascript/proto/order/summary.proto

148 lines
4.0 KiB
Protocol Buffer
Raw Permalink Normal View History

2024-02-27 23:01:27 +08:00
syntax = "proto3";
package order;
option go_package = "./order";
message Empty{
}
message FetchRequest {
int64 page_no=1; // 页数
int64 page_size=2; // 每页记录数
map<string,string> params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11
}
message IdentRequest{
int64 id = 1; // 唯一ID
string identity = 2; // 唯一码
}
message StatusReply{
int64 status = 1; // 状态码
string identity=2; // 标识码
string message=3; //状态说明
int64 timeseq=4; // 响应时间序列
}
// Order(订单)微服务-订单模块
// 需要检验Token,登录后获得
service Summary {
// 基于Token快速创建一个订单
rpc QuickCreateByToken(QuickCreateByTokenRequest) returns (StatusReply) {};
// 将购物车的数据提交生成订单
rpc Submit(SubmitRequest) returns (StatusReply) {};
// 检测是否有未确认及付款的订单
rpc Check(Empty) returns (StatusReply) {};
// 获取一个订单的详情数据
rpc Get(IdentRequest) returns (SummaryGetReply) {};
// 根据不同的类型获取我的订单列表
// 类型:
// All:全部
// Unpaid:未付款
// Paid:已付款
// NotDelivered:未发货
// Delivered:已发货
// NotComment:待评论
rpc List(SummaryListRequest) returns (SummaryListReply) {};
// 确认订单,物流,优惠卷等其它信息
rpc Confirm(ConfirmRequest) returns (ConfirmReply) {};
// 取消订单
rpc Cancel(CancelRequest) returns (StatusReply) {};
}
message QuickCreateByCodeRequest{
int32 partner_id =1; // 合伙人ID
string product_identity = 2; // 商品唯一码
int32 number = 3; // 数量
string phone = 4; // 手机号
string address = 5; // 详情地址
string contact = 6; // 联系人
string code=7;//短信验证码
}
message QuickCreateByTokenRequest{
int32 partner_id =1; // 合伙人ID
string product_identity = 2; // 商品唯一码
int32 number = 3; // 数量
string args = 5; // 相关参数
}
message SubmitRequest {
repeated string id = 1; // 购物车的ID数据以逗号分开
int32 partner_id =2; // 合伙人ID
int64 address_id=3; // 地址ID
}
message SummaryGetReply {
OrderSummary summary = 1; // 订单概要详情
repeated OrderDetails details = 2; // 订单商品详情
}
message OrderSummary {
int64 id = 1; // ID
string order_no = 2; // 订单唯一码
int32 partner_id =3; // 合伙人ID
string tradeNo = 4; // 支付交易号
int32 payType = 5; // 支付类型
string address = 6; // 收货地址
int64 total_price = 7; // 总价
int64 trans_price = 8; // 交易金额
int64 refund_price = 9; // 退款金额
string logistics_number = 10; // 物流信息
int64 logistics_fee = 11; // 物流信息
int64 coupon_amount = 12; // 物流信息
string remark = 13; // 备注
int32 status = 14; // 订单状态
string payTime = 15; // 支付时间
string created = 16; // 创建时间
string updated = 17; // 最后创建时间
repeated OrderDetails details =18; //订单商品
}
message OrderDetails{
int64 id = 1; // ID
int64 product_id = 2; // 商品ID
int32 type = 3; // 商品类型
string title = 4; //商品名称
string cover_image = 5; //商品封面图片
string sales_price = 6; //商品销售价格
string product_args = 7; // 商品参数
int32 number = 8; // 数量
int64 unitPrice = 9; // 单价
}
message SummaryListRequest {
string type = 1; // 订单类型
}
message SummaryListReply {
repeated OrderSummary summary = 1; // 订单列表
}
message ConfirmRequest {
int64 order_no = 1; // 订单唯一码
int64 address_id = 2; // 订单唯一码
string coupon_identity = 3; // 优惠卷
string remark = 4; //备注
double logisticsFee = 5; //运费
}
message ConfirmReply {
int64 total_price = 1; // 总价
}
message CancelRequest {
int64 order_no = 1; // 订单唯一码
string type = 2; // 订单类型
}