refactor: localize protobuf definitions
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// 订单审批
|
||||
func OrderApprove(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err error) {
|
||||
func OrderApprove(ctx context.Context, in *pb.OrderIdentRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
// 验证输入参数是否有效。
|
||||
if in.GetIdentity() == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
@@ -89,7 +89,7 @@ func OrderApprove(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusRep
|
||||
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: in.GetIdentity(),
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// 取消订单
|
||||
func OrderCancel(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err error) {
|
||||
func OrderCancel(ctx context.Context, in *pb.OrderIdentRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
auth, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -37,7 +37,7 @@ func OrderCancel(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusRepl
|
||||
printer.Error(err.Error())
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: in.GetIdentity(),
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
// 创建订单
|
||||
func OrderCreate(ctx context.Context, in *pb.CreateOrderRequest) (reply *pb.StatusReply, err error) {
|
||||
func OrderCreate(ctx context.Context, in *pb.CreateOrderRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
auth, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -158,7 +158,7 @@ func OrderCreate(ctx context.Context, in *pb.CreateOrderRequest) (reply *pb.Stat
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixNano(),
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// 获取一个订单的详情数据
|
||||
func OrderGet(ctx context.Context, in *pb.IdentRequest) (reply *pb.OrderGetReply, err error) {
|
||||
func OrderGet(ctx context.Context, in *pb.OrderIdentRequest) (reply *pb.OrderGetReply, err error) {
|
||||
// parse authorization meta.
|
||||
RoleValve := &service.ParseOptions{RoleValue: "Mall_Admin"}
|
||||
if in.GetAgency() != "" {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// 修改订单
|
||||
func OrderModify(ctx context.Context, in *pb.OrderSummaryItem) (reply *pb.StatusReply, err error) {
|
||||
func OrderModify(ctx context.Context, in *pb.OrderSummaryItem) (reply *pb.OrderStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
auth, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
@@ -25,7 +25,7 @@ func OrderModify(ctx context.Context, in *pb.OrderSummaryItem) (reply *pb.Status
|
||||
|
||||
// TODO: add your logic code & delete this line.
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Timeseq: time.Now().UnixNano(),
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// OrderReturnable 订单申请售后
|
||||
func OrderReturnable(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err error) {
|
||||
func OrderReturnable(ctx context.Context, in *pb.OrderIdentRequest) (reply *pb.OrderStatusReply, err error) {
|
||||
_, err = service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -50,7 +50,7 @@ func OrderReturnable(ctx context.Context, in *pb.IdentRequest) (reply *pb.Status
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.OrderStatusReply{
|
||||
Code: 0,
|
||||
Message: "OK",
|
||||
Identity: in.GetIdentity(),
|
||||
|
||||
Reference in New Issue
Block a user