userlistlogic.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
  4. "context"
  5. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc"
  6. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type UserListLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserListLogic {
  15. return &UserListLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *UserListLogic) UserList(req *types.UserReq) (*types.CommonRes, error) {
  22. // todo: add your logic here and delete this line
  23. resp, err := l.svcCtx.Message.UserList(l.ctx, &messagecenter.UserReq{
  24. Phone: req.Phone,
  25. UserType: req.UserType,
  26. StartTime: req.StartTime,
  27. EndTime: req.EndTime,
  28. NewUserId: req.NewUserId,
  29. EntUserId: req.EntUserId,
  30. Page: req.Page,
  31. Size: req.Size,
  32. IsArtificial: req.IsArtificial,
  33. FiltrationId: req.FiltrationId,
  34. EntId: req.EntId,
  35. QueryType: req.QueryType,
  36. NameSearch: req.NameSearch,
  37. PositionId: req.PositionId,
  38. })
  39. if err != nil {
  40. return nil, err
  41. }
  42. return &types.CommonRes{
  43. Error_msg: resp.ErrorMsg,
  44. Error_code: int(resp.ErrorCode),
  45. Data: resp.Data,
  46. Count: resp.Count,
  47. }, nil
  48. }