Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public enum SortStatus {
SCRAP_DESC("scrap","scrapCount"),
DATE_DESC("date","createdAt");

private final String vlaue;
private final String value;
private final String property;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Object resolveArgument(@NotNull MethodParameter parameter, ModelAndViewCo
}

if(!Arrays.stream(SortStatus.values())
.map(sortStatus -> sortStatus.getVlaue())
.map(sortStatus -> sortStatus.getValue())
.collect(Collectors.toList())
.contains(splitQuery.get("sort").get(0))){
throw new BadRequestException(ErrorStatus.INVALID_SORT_PARAMETER_EXCEPTION,ErrorStatus.INVALID_SORT_PARAMETER_EXCEPTION.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ public RecommendPublicCourseResponseDto recommendPublicCourse(Long userId, Integ
//3. page, sort ์— ๋”ฐ๋ผ ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ
List<RecommendPublicCourse> recommendPublicCourses = new ArrayList<>();
Page<PublicCourse> publicCourses = null;
if (SortStatus.SCRAP_DESC.getVlaue().equals(sort)) {
if (SortStatus.SCRAP_DESC.getValue().equals(sort)) {
publicCourses = publicCourseRepository.findAll(
PageRequest.of(pageNo - 1, PAGE_SIZE,
Sort.by(Sort.Direction.DESC, SortStatus.SCRAP_DESC.getProperty())));

} else if (SortStatus.DATE_DESC.getVlaue().equals(sort)) {
} else if (SortStatus.DATE_DESC.getValue().equals(sort)) {
publicCourses = publicCourseRepository.findAll(
PageRequest.of(pageNo - 1, PAGE_SIZE,
Sort.by(Sort.Direction.DESC, SortStatus.DATE_DESC.getProperty())));
Expand Down