refactor: reorganize modules and add Linux build tooling
This commit is contained in:
35
module/ec/order/internal/logic/summary/get.go
Normal file
35
module/ec/order/internal/logic/summary/get.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package summary
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bsm/full/module/ec/order/internal/logic/common"
|
||||
pb "bsm/full/module/ec/order/pb"
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"git.apinb.com/bsm-sdk/core/printer"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
)
|
||||
|
||||
// 获取一个订单的详情数据
|
||||
func Get(ctx context.Context, in *pb.IdentRequest) (reply *pb.SummaryGetReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// valildate request id,identity.
|
||||
if in.Identity == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
summary, err := common.GetOrderSummaryByIdentity(in.Identity)
|
||||
if err != nil {
|
||||
printer.Error(err.Error())
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.SummaryGetReply{
|
||||
Summary: summary,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user