Skip to content

Conversation

@Parkjyun
Copy link
Contributor

@Parkjyun Parkjyun commented May 6, 2025

Related Issue 📌

close #7

Description ✔️

  • 마이페이지 내 강사정보 반환 api, 강사 정보 변경 api 생성
  • 나중에 여러장 업로드가 추가될 때 saveAll 대신 batch insert가 필요하다 판단되면 추가할게용
@Override
    public void replace(Long id, List<String> imageUrls) {
        teacherImageJpaRepository.deleteByTeacherIdAndImageUrlNotIn(id, imageUrls);
        teacherImageJpaRepository.saveAll(
                imageUrls.stream().map(imageUrl -> new TeacherImageJpaEntity(id, imageUrl)).toList()
        );
    }

To Reviewers

테스트에 fixture 만들기 위해 도메인 객체와 repository를 사용하는 부분들이 있는데
이를 직접 jpa entity와 jparepository를 사용하도록 통일하는 작업이 필요할 것 같습니다.
이번 pr은 일단 빨리 머지해야 돼서 TeacherServiceTest에 repository, jparepository 의존성들 모두 넣어 놓을게요

@Parkjyun Parkjyun requested a review from Ho-Tea May 6, 2025 02:47
@github-actions
Copy link

github-actions bot commented May 6, 2025

Test Results

27 files  27 suites   4s ⏱️
62 tests 62 ✅ 0 💤 0 ❌
63 runs  63 ✅ 0 💤 0 ❌

Results for commit 144cfaf.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 6, 2025

🌻Test Coverage Report

Overall Project 49.73% -2.44%
Files changed 59.8%

File Coverage
MyTeacherProfileDetailResult.java 100% 🍏
TeacherVideoRepositoryAdapter.java 100% 🍏
TeacherVideoJpaEntity.java 100% 🍏
TeacherImageRepositoryAdapter.java 100% 🍏
TeacherImageJpaEntity.java 100% 🍏
MemberIdArgumentResolver.java 80.36% -3.57%
TeacherUpdateCommand.java 77.78% -22.22% 🍏
TeacherJpaEntity.java 67.96% 🍏
TeacherService.java 57.26% -4.27% 🍏
LessonJpaEntity.java 53.55% 🍏
TeacherRepositoryAdapter.java 46.67% -2% 🍏
TeacherController.java 33.93% -32.14%
TeacherUpdateRequest.java 0%
TeacherDetailResponse.java 0% -3.13%
TeacherProfileDetailResponse.java 0%
MyLessonsThumbnailResponse.java 0% -9.59%

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.

사소한 코멘트 몇개 남겼는데.. 이부분은 나중에 말해도 좋을 것 같아 우선 approve 할게욥

List<@Size(max = 30) String> prizes,
@Size(min = 1) List<String> videoUrls
) {
public TeacherUpdateCommand toCommand(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.

[사소사소]
Controller에서 인자로 넘겨줄때는 Long으로 넘겨주는데 여기서는 long으로 받는 의도가 있을까욥

Copy link
Contributor Author

Choose a reason for hiding this comment

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

argumentresolver에서 null 넘어올 수 있어서 controller는 Long으로 받고 여기는 long으로 받도록 했는데
처리를 안해주면 당연히 npe나겠군요.. 앞으로 어떻게 통일하면 좋을지 조금 더 찾아볼게용


public interface TeacherVideoRepository {
List<String> findAllByTeacherId(long teacherId);
void replace(long id, List<String> strings);
Copy link
Collaborator

Choose a reason for hiding this comment

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

id가 의미하는게 테이블의 프라이머리 키가아닌 teacher IdteacherId 변수명이 좋을 것 같아욥!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

반영했슴당

@Parkjyun Parkjyun merged commit 7d22a09 into develop May 6, 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: 강사정보 수정 api

3 participants