feat: 添加争议微服务,支持订单争议流程
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"juwan-backend/app/dispute/rpc/internal/svc"
|
||||
"juwan-backend/app/dispute/rpc/pb"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetDisputesByIdLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetDisputesByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDisputesByIdLogic {
|
||||
return &GetDisputesByIdLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetDisputesByIdLogic) GetDisputesById(in *pb.GetDisputesByIdReq) (*pb.GetDisputesByIdResp, error) {
|
||||
d, err := l.svcCtx.DisputeModelRO.Disputes.Get(l.ctx, in.GetId())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.GetDisputesByIdResp{Disputes: entDisputeToPb(d)}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user