Skip to content
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

[BE] issue119: 내가 참여한 스터디 목록 조회 리팩터링 #180

Merged
merged 7 commits into from
Aug 2, 2022

Conversation

jaejae-yoo
Copy link
Collaborator

요약

내가 참여한 스터디 목록 기능을 리팩터링 및 누락된 요구사항을 추가한다.

세부사항

  • 내가 참여한 스터디 목록에 자신이 개설한 스터디도 추가한다.
  • 내가 참여한 스터디 목록 조회 로직을 리팩터링한다.

close #119

@jaejae-yoo jaejae-yoo self-assigned this Aug 1, 2022
@jaejae-yoo jaejae-yoo added 🐞 bug Something isn't working 🖥 backend New backend feature 🛠 refactoring Refactor code labels Aug 1, 2022
@jaejae-yoo jaejae-yoo modified the milestone: Milestone 3 Aug 1, 2022
Copy link
Collaborator

@tco0427 tco0427 left a comment

Choose a reason for hiding this comment

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

오류 잡아주시느라 고생하셨습니다!
Approve 해도 될 것 같아요~_~

@@ -35,11 +37,11 @@ public class MyStudyDao {
currentMemberCount, maxMemberCount, startDate, endDate);
};

private static final RowMapper<Map<Long, Map<MemberData, List<TagSummaryData>>>> OWNER_WITH_TAG_ROW_MAPPER = (rs, rn) -> {
Map<Long, Map<MemberData, List<TagSummaryData>>> result = new LinkedHashMap<>();
private static final ResultSetExtractor<Map<Long, StudyOwnerWithTagsData>> OWNER_WITH_TAG_ROW_MAPPER = rs -> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

기존의 RowMapper 를 쓰면 첫번째 row 가 while (rs.next) 시 누락되어 ResultSetExtractor 로 변경해주셨군요..!!
굿굿👍

}
return result;
};

public List<MyStudySummaryData> findMyStudyByGithubId(Long id) {
String sql = "SELECT study.id, study.title, study.study_status, study.current_member_count, "
String sql = "SELECT DISTINCT study.id, study.title, study.study_status, study.current_member_count, "
Copy link
Collaborator

Choose a reason for hiding this comment

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

DISTINCT 처리 좋네요!

public Map<Long, Map<MemberData, List<TagSummaryData>>> findStudyOwnerWithTags(List<Long> studyIds) {
public Map<Long, StudyOwnerWithTagsData> findStudyOwnerWithTags(List<Long> studyIds) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

이렇게 묶어준 게 훨씬 가독성 있는 것 같습니다!!

@NoArgsConstructor
@AllArgsConstructor
@Getter
public class StudyOwnerWithTagsData {
Copy link
Collaborator

Choose a reason for hiding this comment

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

With보다 And가 더 좋아 보여요

@jaejae-yoo jaejae-yoo force-pushed the refactoring/119-find-my-study branch from 748df68 to 441dcf1 Compare August 2, 2022 01:23
@jaejae-yoo jaejae-yoo merged commit 4a73c3f into develop Aug 2, 2022
@jaejae-yoo jaejae-yoo deleted the refactoring/119-find-my-study branch August 4, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖥 backend New backend feature 🐞 bug Something isn't working 🛠 refactoring Refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants