refactor: localize protobuf definitions
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// 取消订单
|
||||
func Cancel(ctx context.Context, in *pb.CancelRequest) (reply *pb.StatusReply, err error) {
|
||||
func Cancel(ctx context.Context, in *pb.CancelRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
@@ -50,7 +50,7 @@ func Cancel(ctx context.Context, in *pb.CancelRequest) (reply *pb.StatusReply, e
|
||||
}
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Identity: summary.Identity,
|
||||
Message: "OK",
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// 检测是否有未确认及付款的订单
|
||||
func Check(ctx context.Context, in *pb.Empty) (reply *pb.StatusReply, err error) {
|
||||
func Check(ctx context.Context, in *pb.Empty) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
auth, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -27,7 +27,7 @@ func Check(ctx context.Context, in *pb.Empty) (reply *pb.StatusReply, err error)
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Identity: summary.OrderNo,
|
||||
Message: "OK",
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// 获取一个订单的详情数据
|
||||
func Get(ctx context.Context, in *pb.IdentRequest) (reply *pb.SummaryGetReply, err error) {
|
||||
func Get(ctx context.Context, in *pb.OrderIdentRequest) (reply *pb.SummaryGetReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
// 快速创建一个店铺订单
|
||||
func QuickCreateByProduct(ctx context.Context, in *pb.QuickCreateByProductRequest) (reply *pb.StatusReply, err error) {
|
||||
func QuickCreateByProduct(ctx context.Context, in *pb.QuickCreateByProductRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
auth, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -156,7 +156,7 @@ func QuickCreateByProduct(ctx context.Context, in *pb.QuickCreateByProductReques
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixNano(),
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// 模拟支付
|
||||
func SimulatePay(ctx context.Context, in *pb.SimulatePayRequest) (reply *pb.StatusReply, err error) {
|
||||
func SimulatePay(ctx context.Context, in *pb.SimulatePayRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
@@ -29,7 +29,7 @@ func SimulatePay(ctx context.Context, in *pb.SimulatePayRequest) (reply *pb.Stat
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixNano(),
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// 模拟收货
|
||||
func SimulateReceiving(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err error) {
|
||||
func SimulateReceiving(ctx context.Context, in *pb.OrderIdentRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
@@ -33,7 +33,7 @@ func SimulateReceiving(ctx context.Context, in *pb.IdentRequest) (reply *pb.Stat
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixNano(),
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// 模拟发货
|
||||
func SimulateShipments(ctx context.Context, in *pb.SimulateShipmentsRequest) (reply *pb.StatusReply, err error) {
|
||||
func SimulateShipments(ctx context.Context, in *pb.SimulateShipmentsRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
@@ -32,7 +32,7 @@ func SimulateShipments(ctx context.Context, in *pb.SimulateShipmentsRequest) (re
|
||||
}
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixNano(),
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
// 将购物车的数据提交生成订单
|
||||
func Submit(ctx context.Context, in *pb.SubmitRequest) (reply *pb.StatusReply, err error) {
|
||||
func Submit(ctx context.Context, in *pb.SubmitRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
RoleValve := &service.ParseOptions{RoleValue: "Mall_Admin"}
|
||||
if in.GetAddress() != nil {
|
||||
@@ -236,7 +236,7 @@ func Submit(ctx context.Context, in *pb.SubmitRequest) (reply *pb.StatusReply, e
|
||||
firstOrderNo = summary[0].OrderNo
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Identity: firstOrderNo,
|
||||
Message: strings.Join(keys, ","),
|
||||
|
||||
Reference in New Issue
Block a user