transfercluesucclogic.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
  4. "context"
  5. "github.com/gogf/gf/v2/util/gconv"
  6. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
  7. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type TransferClueSuccLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewTransferClueSuccLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TransferClueSuccLogic {
  16. return &TransferClueSuccLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *TransferClueSuccLogic) TransferClueSucc(req *types.TransferClueReq) (resp *types.BiResp, err error) {
  23. if req.Phone == "" && req.OrderNo == "" {
  24. return &types.BiResp{Error_code: -1, Error_msg: "手机号或者订单号不能为空", Data: nil}, err
  25. }
  26. res, err := l.svcCtx.BiServiceRpc.TransferClueByPhone(l.ctx, &biservice.TransferClueReq{
  27. PositionId: req.PositionId,
  28. UserId: req.UserId,
  29. Phone: req.Phone,
  30. OrderNo: req.OrderNo,
  31. })
  32. return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: gconv.Map(gconv.UnsafeBytesToStr(res.Data))}, err
  33. }