package logic import ( "bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice" "context" "github.com/gogf/gf/v2/util/gconv" "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc" "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type CreateClueLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewCreateClueLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateClueLogic { return &CreateClueLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *CreateClueLogic) CreateClue(req *types.CreateClueReq) (resp *types.BiResp, err error) { if req.Phone == "" { return &types.BiResp{Error_code: -1, Error_msg: "手机号不能为空", Data: nil}, err } res, err := l.svcCtx.BiServiceRpc.CreateClueByPhone(l.ctx, &biservice.CreateCuleReq{ AppId: req.AppId, PositionId: req.PositionId, UserId: req.UserId, Phone: req.Phone, }) return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: gconv.Map(gconv.UnsafeBytesToStr(res.Data))}, err }