-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: 기존 최신리스트API -> 최신리스트와 팔로잉리스트 API로 분리 #292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트 코드 수정까지..! 수고하셨습니다 👍👍
public static List<ItemsResponse> toList(List<Item> items) { | ||
return items.stream() | ||
.sorted(Comparator.comparing(Item::getRanking)) | ||
.map(ItemsResponse::of) | ||
.limit(3) | ||
.toList(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
�이제 홈 화면에서 아이템을 TOP3 로 보여주지 않아도 되나요 ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아니요!! 로직 확인해보니 애초에 이미 사전에 toList()메서드를 선언하고 있는 부분에서 items를 인자로 줄 때 getTop3Items()를 이용해서 TOP3로 가져 오더라고요 중복 로직이라 삭제했습니다!!
public static ListResponse of(ListEntity list) {
return ListResponse.builder()
.id(list.getId())
.ownerId(list.getUser().getId())
.ownerNickname(list.getUser().getNickname())
.ownerProfileImage(list.getUser().getProfileImageUrl())
.title(list.getTitle().getValue())
.description(list.getDescription().getValue())
.items(ItemsResponse.toList(list.getTop3Items().getValues())). <-- 이부분
.updateCount(list.getUpdateCount())
.build();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하! 좋습니다 ㅎㅎ 👍
src/main/java/com/listywave/list/application/service/ListService.java
Outdated
Show resolved
Hide resolved
src/test/java/com/listywave/acceptance/list/ListAcceptanceTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다~
public static List<ItemsResponse> toList(List<Item> items) { | ||
return items.stream() | ||
.sorted(Comparator.comparing(Item::getRanking)) | ||
.map(ItemsResponse::of) | ||
.limit(3) | ||
.toList(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하! 좋습니다 ㅎㅎ 👍
Description
🛠️변경사항
탐색 -> 홈으로 변경되었고, 최신리스트와 팔로잉리스트로 페이지가 분리 되었으며
추가적으로 최신리스트 API queryParam에 category가 추가됨
최신리스트 : GET "/lists?size={}&cursorUpdatedDate={}&category={}"
팔로잉리스트 : GET "/lists/following?size={}&cursorUpdatedDate={}"
기타 추가사항
List에 updateCount 추가 (업데이트 N회째)
리스트 수정시 updateCount + 1 되도록 수정
특이사항
리스트 수정 테스트에 updateCount 증가 명칭만 추가 하였고, 추후 리스트 상세 API 변경때 내부적으로 해당 로직 추가 예정
🚨 Merge하기 전 주의!
dev
와prod
에 merge 하기 전 꼭 필수로 해당 테이블에 updateCount 추가하고 merge하기 현재 배포와 개발 서버에 ddl-auto = validate 이기 때문에 직접 수정해줘야함 )Relation Issues