getentuserinfobypositonidlogic.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package logic
  2. import (
  3. "context"
  4. "app.yhyue.com/moapp/jybase/common"
  5. "app.yhyue.com/moapp/jybase/encrypt"
  6. "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/svc"
  7. "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/types"
  8. "bp.jydev.jianyu360.cn/BaseService/userCenter/entity"
  9. . "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
  10. "github.com/zeromicro/go-zero/core/logx"
  11. )
  12. type GetEntUserInfoByPositonIdLogic struct {
  13. logx.Logger
  14. ctx context.Context
  15. svcCtx *svc.ServiceContext
  16. }
  17. func NewGetEntUserInfoByPositonIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetEntUserInfoByPositonIdLogic {
  18. return &GetEntUserInfoByPositonIdLogic{
  19. Logger: logx.WithContext(ctx),
  20. ctx: ctx,
  21. svcCtx: svcCtx,
  22. }
  23. }
  24. func (l *GetEntUserInfoByPositonIdLogic) GetEntUserInfoByPositonId(req *types.GetUserInfoByPIdReq) (resp *types.Resp, err error) {
  25. positionId := encrypt.SE.Decode4Hex(req.PositionId)
  26. res, err := entity.UserCenterRpc.IdentityByPositionId(l.ctx, &IdentityReq{
  27. Id: common.Int64All(positionId),
  28. })
  29. return &types.Resp{
  30. Error_code: 0,
  31. Error_msg: "",
  32. Data: map[string]interface{}{
  33. "name": res.EntUserName,
  34. },
  35. }, err
  36. }