Updated code
This commit is contained in:
@@ -47,17 +47,14 @@ public class UserActionDao {
|
||||
@Autowired
|
||||
private RoleActionContextRepository roleActionContextRepository;
|
||||
|
||||
public SummaryPageResponseBean getUserAction(HttpServletRequest request, UserEntity userEntity, TimePeriodEnum timeFilter, List<UserActionContextEnum> actionContext){
|
||||
public SummaryPageResponseBean getUserAction(HttpServletRequest request, UserEntity userEntity){
|
||||
Long numberOfLoginAttempts = userActionsRepository.countUserLoginAttempts(userEntity.getId());
|
||||
Long applicationsProcessed = assignedApplicationsRepository.countAssignedApplicationsByUserId(userEntity.getId());
|
||||
|
||||
List<UserActionEntity> userActions = getFilterUserActions(userEntity.getId(),timeFilter,actionContext);
|
||||
|
||||
return null;
|
||||
// createSummaryPageResponse(userEntity,numberOfLoginAttempts,applicationsProcessed,userActions);
|
||||
return createSummaryPageResponse(userEntity,numberOfLoginAttempts,applicationsProcessed);
|
||||
}
|
||||
|
||||
public SummaryPageResponseBean createSummaryPageResponse(UserEntity user, Long numberOfLoginAttempts, Long applicationsProcessed,PageableResponseBean<List<UserActionResponseBean>> userActions){
|
||||
public SummaryPageResponseBean createSummaryPageResponse(UserEntity user, Long numberOfLoginAttempts, Long applicationsProcessed){
|
||||
SummaryPageResponseBean response = new SummaryPageResponseBean();
|
||||
response.setRole(user.getRoleEntity().getRoleName());
|
||||
response.setLastLogin(user.getLastLogin());
|
||||
@@ -66,7 +63,6 @@ public class UserActionDao {
|
||||
response.setEmail(user.getEmail());
|
||||
response.setNumberOfLoginAttempts(numberOfLoginAttempts);
|
||||
response.setApplicationsProcessed(applicationsProcessed);
|
||||
response.setUserActions(userActions);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -162,7 +158,7 @@ public class UserActionDao {
|
||||
return responseBean;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
public SummaryPageResponseBean getUserActionByPagination(UserEntity user, UserActionPaginationRequest userActionPaginationRequest) {
|
||||
public PageableResponseBean<List<UserActionResponseBean>> getUserActionByPagination(UserEntity user, UserActionPaginationRequest userActionPaginationRequest) {
|
||||
Integer pageNo = null;
|
||||
Integer pageLimit = null;
|
||||
if (userActionPaginationRequest.getGlobalFilters() != null) {
|
||||
@@ -192,7 +188,7 @@ public class UserActionDao {
|
||||
pageableResponseBean.setTotalRecords(entityPage.getTotalElements());
|
||||
pageableResponseBean.setPageSize(entityPage.getSize());
|
||||
|
||||
return createSummaryPageResponse(user,numberOfLoginAttempts,applicationsProcessed,pageableResponseBean);
|
||||
return pageableResponseBean;
|
||||
}
|
||||
public Specification<UserActionEntity> search(UserActionPaginationRequest userActionPaginationRequest,UserEntity userEntity) {
|
||||
return (root, query, criteriaBuilder) -> {
|
||||
|
||||
Reference in New Issue
Block a user