1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package logic
- import (
- "context"
- "fmt"
- "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"
- "bp.jydev.jianyu360.cn/BaseService/userCenter/entity"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type GetUserInfoLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewGetUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserInfoLogic {
- return &GetUserInfoLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *GetUserInfoLogic) GetUserInfo(req *types.UserReq) (resp *types.Resp, err error) {
- // todo: add your logic here and delete this line
- resp = &types.Resp{}
- res, err := entity.UserCenterRpc.GetUserInfo(l.ctx, &pb.UserReq{
- AppId: req.AppId,
- UserId: req.UserId,
- Types: req.Types,
- })
- if res.ErrorMsg != "" {
- resp.Error_msg = res.ErrorMsg
- resp.Error_code = -1
- l.Error(fmt.Sprintf("%+v", req), res.ErrorMsg)
- }
- data := map[string]interface{}{
- "start_time": res.Data.StartTime,
- "end_time": res.Data.EndTime,
- "area": res.Data.Area,
- "matchway": res.Data.Matchway,
- "items": res.Data.Items,
- "projectmatch": res.Data.Projectmatch,
- "infotype": res.Data.Infotype,
- "types": res.SubscribeType, //订阅设置类型 f:免费订阅 v:超级订阅 m:大会员订阅 e:商机管理订阅
- "vip_status": res.VipStatus,
- "member_status": res.MemberStatus,
- "entniche_status": res.EntnicheStatus,
- "phone": res.Phone,
- }
- resp.Data = data
- return
- }
|