Skip to content

Conversation

@Parkjyun
Copy link
Contributor

@Parkjyun Parkjyun commented Apr 22, 2025

Related Issue 📌

close #3

Description ✔️

  • 변경된 ui에 따라 멤버 정보 반환 api를 변경했습니다.

  • 변경된 ui에 따라 선생님 정보 반환 api를 생성했습니다.

  • 멤버 정보 수정 api를 생성했습니다.

  • 수업 수강 수 api를 생성했습니다.

  • teacher에 prize column을 추강했습니다.

  • teacherImageJpaEntity에서 식별자만 가지도록 변경했슴다.

To Reviewers

pr이 생각보다 커져서..
선생 정보 업데이트는 다른 pr로 올리겠습니당

@Parkjyun Parkjyun requested a review from Ho-Tea April 22, 2025 19:12
@Parkjyun Parkjyun self-assigned this Apr 22, 2025
@Parkjyun Parkjyun changed the base branch from main to develop April 22, 2025 19:26
Copy link
Collaborator

@Ho-Tea Ho-Tea left a comment

Choose a reason for hiding this comment

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

번거로운 작업이였을텐데 고생하셨습니다!!
사소한 코멘트 몇개 달아드렸으니 확인 부탁드립니다 🙇‍♂️

급한건 아니지만 저희끼리 한번 얘기해볼만한 것들 아래에 달아놓을게요!!

  1. Adapter에서 Optionalservice에 올리는 경우와 객체로 변환해서 올리는 경우를 구분해야 할 것 같은데 (서로 다른 adapter에서 올라온 것들에 대해 통합적으로 검증해야하는 경우 -> Optionalservice까지 올림, 각 adapter에서 처리할 수 있는 검증은 adpater에서 처리) 는 어떨까요!
  2. 테스트 작성해주신것 너무 좋아요 👍👍👍 나중에 시간될때 저희가 앱잼하면서 놓쳤던 테스트 보강해도 좋을것같아용
  3. Controller <-> Service <-> Repostiroy 에서 어떤경우에는 Long을 사용하고 어떤 경우에는 long을 사용하기에 일관성을 맞추는 방향으로 얘기해도 좋을것같아요!

return ResponseEntity.ok(MemberResponse.from(memberService.findById(memberId)));
}

@PatchMapping("/me")
Copy link
Collaborator

Choose a reason for hiding this comment

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

사소하기는하지만.. 내부적으로 모든 필드에 재대입이 들어가기때문에 Put은 어떨까용

Copy link
Contributor Author

Choose a reason for hiding this comment

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

저도 이게 참 애매했는데,
아래와 같은 생각으로 patch로 정했습니당.

해당 api는 이름, 전화번호, 닉네임, 이미지url을 요청으로 받습니다.
그런데 저희 테이블에는 이름, 전화번호, 닉네임, 이미지url 이외에 role, oauth관련 정보들도 포함하고 있습니다.
그래서 업데이트할 때 리소스(멤버)의 모든 컬럼을 변경하지 않기에, 리소스 전체를 업데이트한다는 put보다는 patch가 어울린다고 생각했습니다!

Copy link
Collaborator

Choose a reason for hiding this comment

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

저희 테이블에는 이름, 전화번호, 닉네임, 이미지url 이외에 role, oauth관련 정보들도 포함하고 있습니다.

제가 이 부분을 놓쳤네요. 충분히 납득되었습니다 👍👍👍

lesson.getRepresentativeImageUrl(),
lesson.getGenre(),
lesson.getLevel(),
-1 * (int) LocalDateTime.now().until(lesson.getStartTime(), java.time.temporal.ChronoUnit.DAYS));
Copy link
Collaborator

Choose a reason for hiding this comment

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

매직넘버는 상수화해도 좋을 것 같아요!

void updateRole(Long id, Role role);

@Query("select m.nickname from MemberJpaEntity m where m.id = :memberId")
Optional<String> findNickNameById(long memberId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

단순 쿼리메서드를 통해서도 가능할 것 같아요!

Optional<String> findNicknameById(Long id);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

바로~ 반영하겠슴다

Comment on lines 71 to 74
Assertions.assertThat(myTeacherProfileResult.profileImage()).isEqualTo("www.example.com/teacher1.png");
Assertions.assertThat(myTeacherProfileResult.nickname()).isEqualTo("nickname");
Assertions.assertThat(myTeacherProfileResult.instagram()).isEqualTo("@hong_dancer1");
Assertions.assertThat(myTeacherProfileResult.youtube()).isEqualTo("youtube.com/hong_dancer1");
Copy link
Collaborator

Choose a reason for hiding this comment

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

assertAll로 묶을 수 있겠네요!

assertAll(
  () -> assertThat(myTeacherProfileResult.profileImage()).isEqualTo("www.example.com/teacher1.png"),
  () -> ...
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

역시 테스트 코드왕

.detail("경력 10년의 힙합 댄서")
.educations(List.of("한국예술대학교 댄스학과"))
.experiences(List.of("다양한 공연 및 강의 경험"))
.prizes(List.of("앱잼 1등"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋㅋㅋㅋ큐ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ

@github-actions
Copy link

Test Results

27 files  27 suites   4s ⏱️
59 tests 59 ✅ 0 💤 0 ❌
60 runs  60 ✅ 0 💤 0 ❌

Results for commit 283d062.

@github-actions
Copy link

🌻Test Coverage Report

Overall Project 48.54% -4.18%
Files changed 46.12%

File Coverage
CreateTeacherRequest.java 100% 🍏
MyTeacherProfileResult.java 100% 🍏
MemberJpaEntity.java 100% 🍏
TeacherImageRepositoryAdapter.java 100% 🍏
TeacherImageJpaEntity.java 100% 🍏
OnBoardRequest.java 98.04% -1.96% 🍏
MemberRepositoryAdapter.java 77.94% -3.68% 🍏
Teacher.java 74.19% 🍏
MemberUpdateCommand.java 71.15% -28.85% 🍏
TeacherJpaEntity.java 64.69% -3.96% 🍏
TeacherController.java 50% -21.05%
TeacherService.java 44.1% -9.32%
TeacherRepositoryAdapter.java 41.04% -2.24%
ReservationRepositoryAdapter.java 40% 🍏
CreateTeacherCommand.java 34.88% -3.49%
LessonController.java 34.82% 🍏
OnboardCommand.java 34.62% -7.69%
MemberController.java 13.7% -49.32%
ReservationService.java 12.3% 🍏
MemberService.java 9.52% 🍏
TeacherProfileResponse.java 0%
MemberFacade.java 0% -31.03%
MemberUpdateRequest.java 0%
ReservationStatisticsResponse.java 0%
MyLessonsThumbnailResponse.java 0%
MemberResponse.java 0% -20.51%

Copy link
Collaborator

@Ho-Tea Ho-Tea left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!!!!

@Ho-Tea Ho-Tea merged commit 92a71b2 into develop Apr 25, 2025
2 checks passed
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: 마이페이지 리팩토링

3 participants