123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 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,
- BaseUserId: req.BaseUserId,
- Types: req.Types,
- EntId: req.EntId,
- EntUserId: req.EntUserId,
- })
- if res.ErrorMsg != "" {
- resp.Error_msg = res.ErrorMsg
- resp.Error_code = -1
- l.Error(fmt.Sprintf("%+v", req), res.ErrorMsg)
- }
- resp.Data = res.Data
- return
- }
|