getentuserinfologic.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package logic
  2. import (
  3. "context"
  4. "fmt"
  5. "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/internal/svc"
  6. "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type GetEntUserInfoLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewGetEntUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetEntUserInfoLogic {
  15. return &GetEntUserInfoLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 根据企业员工id获取员工的信息
  22. func (l *GetEntUserInfoLogic) GetEntUserInfo(in *pb.EntUserReq) (*pb.EntUserResp, error) {
  23. /// todo: add your logic here and delete this line
  24. resp := &pb.EntUserResp{}
  25. ret, msg := Entservice.GetEntUserInfo(in)
  26. fmt.Println(in.EntId, in.EntUserId, "####")
  27. if msg != "" {
  28. l.Error(fmt.Sprintf("%+v", in), msg)
  29. resp.ErrorMsg = msg
  30. resp.ErrorCode = -1
  31. } else {
  32. resp.Data = &pb.EntUser{
  33. Name: ret.Name,
  34. Phone: ret.Phone,
  35. Mail: ret.Mail,
  36. DeptName: ret.Dept_name,
  37. }
  38. }
  39. return resp, nil
  40. }