getentuserlistlogic.go 917 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 GetEntUserListLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewGetEntUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetEntUserListLogic {
  15. return &GetEntUserListLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 获取企业员工列表
  22. func (l *GetEntUserListLogic) GetEntUserList(in *pb.EntUserListReq) (*pb.EntUserListResp, error) {
  23. // todo: add your logic here and delete this line
  24. resp := &pb.EntUserListResp{}
  25. data, msg := Entservice.GetEntUserList(in)
  26. if msg != "" {
  27. l.Error(fmt.Sprintf("%+v", in), msg)
  28. resp.ErrorMsg = msg
  29. resp.ErrorCode = -1
  30. } else {
  31. resp.Data = data
  32. }
  33. return resp, nil
  34. }