package logic import ( "context" "fmt" "bp.jydev.jianyu360.cn/BaseService/userCenter/entity" "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb" "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/svc" "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type GetEntUserInfoLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewGetEntUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetEntUserInfoLogic { return &GetEntUserInfoLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *GetEntUserInfoLogic) GetEntUserInfo(req *types.EntUserReq) (resp *types.Resp, err error) { // todo: add your logic here and delete this line resp = &types.Resp{Data: nil} res, err := entity.UserCenterRpc.GetEntUserInfo(l.ctx, &pb.EntUserReq{ AppId: req.AppId, EntUserId: req.EntUserId, }) if res == nil { resp = &types.Resp{Data: nil, Error_msg: "暂无数据", Error_code: -1} return } if res.ErrorMsg != "" { resp.Error_msg = res.ErrorMsg resp.Error_code = -1 l.Error(fmt.Sprintf("%+v", req), res.ErrorMsg) } else { data := map[string]interface{}{ "name": res.Data.Name, "phone": res.Data.Phone, "deptName": res.Data.DeptName, "mail": res.Data.Mail, } resp.Data = data } return }