Skip to content

Conversation

@rinarina0429
Copy link
Member

@rinarina0429 rinarina0429 commented May 25, 2025

Related Issue

Key Changes

서재소소(2차 사일로) 관련 기능입니다.
서재(유저 보관함)가 업데이트 되어 기능을 다시 구현하였습니다.

  • 서재 내에서 필터링 및 검색 기능이 추가되었습니다.
  • 작품 별로 유저가 작성한 피드도 함께 내려줘야 하는데, 이때 아래와 같은 조건이 있습니다.
    • 자기 자신의 서재 조회인 경우) isHidden을 제외한 모든 피드 응답
    • 타인의 서재인 경우) isPublic이 true이고, isSpoiler가 false여야 하는 추가사항
  • 또한 성능 최적화를 위해 피드는 한번의 쿼리로 일괄 조회하여 사용하도록 하였습니다.

To Reviewers

  • 클라에서 작업하기 위해 빨리 넘겨주려고 해서 검색(query) 관련 로직은 아직 구현하지 않았습니다! 검색은 추후 pr에서 확인 부탁드립니다아~

References

@rinarina0429 rinarina0429 self-assigned this May 25, 2025
@rinarina0429 rinarina0429 marked this pull request as draft May 25, 2025 09:15
@rinarina0429 rinarina0429 marked this pull request as ready for review May 26, 2025 07:06
Copy link
Member

@sansan20535 sansan20535 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 : )

Novel novel = userNovel.getNovel();

List<String> attractivePoints = userNovel.getUserNovelAttractivePoints().stream()
.map(UserNovelAttractivePoint::getAttractivePoint)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5; 오호? map도 중복이 가능하군요..! 하나 알아갑니다 : )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map... 중복이 안되지 않나요?


private <T> void applyFilters(JPAQuery<T> queryBuilder, Boolean isInterest, List<String> readStatuses,
List<String> attractivePoints, Float novelRating, String query) {
Optional.ofNullable(isInterest)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5; null 값 검사를 Optional을 사용하는 방법과 queryBuilder를 사용하는 방법이 있었네요..! 저는 개인적으로 필터 부분을 따로 분리한 게 좋은 것 같습니다!

private final GenreRepository genreRepository;
private final FeedRepository feedRepository;

public static final String SORT_TYPE_OLDEST = "OLDEST";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p4; SORT TYPE을 enum으로 관리해도 좋을 것 같습니다!

현재 피드소소 사일로 관련해서도 정렬 기준을 작성했는데, 이러한 기준을 enum으로 모아 관리하면 직관적이고 유지보수도 쉬워지지 않을까 생각이 들었습니다!

@rinarina0429 rinarina0429 merged commit 8abb773 into dev May 26, 2025
1 check passed
Copy link
Contributor

@EunjeongHeo EunjeongHeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 !!!!

Comment on lines +21 to +22
String startDate,
String endDate,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5; startDate 랑 endDate가 LocalDate가 아닌 String인 이유가 있을지 궁금합니다!! 다른 Dto인 UserNovelGetResponse 레코드를 보면 같은 이름인 startDate, endDate 필드가 LocalDate로 되어 있어서요!

(추가로, UserNovelGetResponseUserNovelAndNovelGetResponse가 null 여부에 따른 객체 생성 방식에 대한 컨벤션도 조금 다른 것 같은데 추후에 방식 통일시켜주면 좋을 것 같아요!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오옷 놓쳤네요. 찾아주셔서 감사합니다~~
리뷰 반영 위한 새로운 pr에서 적용하도록 하겠습니다.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+) null 여부에 따른 객체 생성 방식의 경우, readStatus가 null인 경우를 처리하는 방식은 통일되어있습니다!
다만 UserNovelGetResponse는 평가가 없을 경우에도 호출될 수 있는 함수라, userNovel 자체가 null인 경우를 처리하느라 다르게 보이는 것 같습니다.
혹시 다른 통일 방식이 있을까요~?

Copy link
Contributor

@EunjeongHeo EunjeongHeo Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

당시에 어떤 컨벤션을 의미했던 건가 싶어서 다시 코드를 확인해보니, 제가 로직 자체에 대한 의도 파악이 부족했던 것 같습니다!
다른 제안 사항은 없을 것 같아요~! 설명 감사합니다!

Copy link
Contributor

@GiJungPark GiJungPark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다!

List<UserNovelAndNovelGetResponse> userNovelAndNovelGetResponses = userNovelsByNoOffsetPagination.stream()
.map(UserNovelAndNovelGetResponse::of)
boolean isOwner = visitor.getUserId().equals(ownerId);
boolean isAscending = sortType.equalsIgnoreCase(SORT_TYPE_OLDEST);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3: SORT_TYPE_OLDEST.equalsIgnoreCase(sortType)처럼 상수를 기준으로 문자열 비교 메서드를 사용하게는게 NPE 발생 위험성을 제거할 수 있을것 같습니다!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

너무 좋습니다! 새로운 pr에 반영해두도록 하겠습니다~!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 유저 보관함 업데이트 기능 구현

5 participants