use of wooteco.prolog.ability.application.dto.AbilityStudylogResponse in project prolog by woowacourse.
the class StudylogAbilityService method findAbilityStudylogsMappingOnlyByAbilityIds.
public PageableResponse<AbilityStudylogResponse> findAbilityStudylogsMappingOnlyByAbilityIds(String username, List<Long> abilityIds, Pageable pageable) {
if (abilityIds != null && !abilityIds.isEmpty()) {
Page<StudylogAbility> studylogAbilities = studylogAbilityRepository.findByAbilityIdIn(abilityIds, pageable);
List<AbilityStudylogResponse> abilityStudylogResponses = AbilityStudylogResponse.listOf(studylogAbilities.getContent());
return PageableResponse.of(abilityStudylogResponses, studylogAbilities);
}
Member member = memberService.findByUsername(username);
Page<StudylogAbility> studylogAbilities = studylogAbilityRepository.findByMemberId(member.getId(), pageable);
List<AbilityStudylogResponse> abilityStudylogResponses = AbilityStudylogResponse.listOf(studylogAbilities.getContent());
return PageableResponse.of(abilityStudylogResponses, studylogAbilities);
}
Aggregations