-
-
Save nOy39/90e1508dbcc6794653480a192db6b944 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<TaskResponse> responseList = new ArrayList<>(); | |
List<Task> mainContentList = taskRepo.findAllByUserAndSubTaskNullOrderByIdAsc(currentUser); | |
for (Task task: mainContentList) { | |
responseList.add(new TaskResponse( | |
task.getId(), | |
task.getName(), | |
task.getColor(), | |
task.getImageUrl(), | |
task.getCreated(), | |
task.getExpiredDate(), | |
task.getIsDone(), | |
taskRepo.countDistinctBySubTask(task) | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
List responseList = taskRepo
.findAllByUserAndSubTaskNullOrderByIdAsc(currentUser);
.stream()
.map(task -> new TaskResponse(
task.getId(),
task.getName(),
task.getColor(),
task.getImageUrl(),
task.getCreated(),
task.getExpiredDate(),
task.getIsDone(),
taskRepo.countDistinctBySubTask(task)
)))
.collect(Collectors.toList())