2026-08-09 10:43:45 +08:00
|
|
|
package summary
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2026-08-09 12:41:08 +08:00
|
|
|
"bsm/full/module/ec/order/internal/logic/common"
|
|
|
|
|
pb "bsm/full/module/ec/order/pb"
|
2026-08-10 11:35:48 +08:00
|
|
|
|
2026-08-09 10:43:45 +08:00
|
|
|
"git.apinb.com/bsm-sdk/core/errcode"
|
|
|
|
|
"git.apinb.com/bsm-sdk/core/printer"
|
|
|
|
|
"git.apinb.com/bsm-sdk/core/service"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 获取一个订单的详情数据
|
2026-08-09 20:14:57 +08:00
|
|
|
func Get(ctx context.Context, in *pb.OrderIdentRequest) (reply *pb.SummaryGetReply, err error) {
|
2026-08-09 10:43:45 +08:00
|
|
|
// 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
|
|
|
|
|
}
|