use of com.webank.wedatasphere.qualitis.response.user.UserResponse in project Qualitis by WeBankFinTech.
the class UserServiceImpl method findAllUser.
@Override
public GeneralResponse<GetAllResponse<UserResponse>> findAllUser(PageRequest request) throws UnExpectedRequestException {
// Check Arguments
PageRequest.checkRequest(request);
int page = request.getPage();
int size = request.getSize();
List<User> users = userDao.findAllUser(page, size);
long total = userDao.countAll();
List<UserResponse> userResponses = new ArrayList<>();
for (User user : users) {
UserResponse tmp = new UserResponse(user);
userResponses.add(tmp);
}
GetAllResponse<UserResponse> response = new GetAllResponse<>();
response.setTotal(total);
response.setData(userResponses);
LOGGER.info("Succeed to find all users, response: {}, current_user: {}", response, HttpUtils.getUserName(httpServletRequest));
return new GeneralResponse<>("200", "{&FIND_ALL_USERS_SUCCESSFULLY}", response);
}
Aggregations