-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: '좋아요'용어 통일 및 회의에서 논의된 내용 적용 #383
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
Conversation
Walkthrough
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🧬 Code Graph Analysis (1)src/main/java/com/example/solidconnection/university/service/LikedUnivApplyInfoService.java (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (10)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/main/java/com/example/solidconnection/siteuser/service/MyPageService.java (2)
94-97: 메서드명 변경은 적절하지만 주석도 함께 업데이트가 필요합니다.
- 메서드명이
getWishUnivApplyInfo에서getLikedUnivApplyInfos로 적절히 변경되었습니다.- 하지만 주석(94번 라인)이 여전히 "관심 대학교"라는 표현을 사용하고 있어 새로운 용어와 일치하지 않습니다.
다음과 같이 주석을 수정하는 것을 제안합니다:
- /* - * 관심 대학교 목록을 조회한다. - * */ + /* + * 좋아요한 대학교 지원 정보 목록을 조회한다. + * */
97-103: 서비스 메서드 위치에 대한 아키텍처 검토가 필요합니다.PR 설명에서 언급하신 대로, 이 메서드를
UnivApplyInfoLikeService로 이동하는 것이 도메인 관점에서 더 적절할 수 있습니다.다음 사항들을 고려해보시기 바랍니다:
1. 도메인 일관성: 좋아요 관련 로직은UnivApplyInfoLikeService에 집중되는 것이 Single Responsibility Principle에 부합합니다.
2. 의존성 관리: 현재MyPageService가LikedUnivApplyInfoRepository에 직접 의존하고 있는데, 이를 서비스 레이어를 통해 접근하는 것이 더 깔끔합니다.
3. 재사용성: 다른 컨텍스트에서도 좋아요한 정보 목록이 필요할 경우 도메인 서비스에 있는 것이 유리합니다.메서드 이동을 고려해보시길 권장합니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/main/java/com/example/solidconnection/siteuser/service/MyPageService.java(1 hunks)src/main/java/com/example/solidconnection/university/controller/UnivApplyInfoController.java(1 hunks)src/main/java/com/example/solidconnection/university/service/UnivApplyInfoLikeService.java(4 hunks)src/test/java/com/example/solidconnection/siteuser/service/MyPageServiceTest.java(1 hunks)src/test/java/com/example/solidconnection/university/service/UnivApplyInfoLikeServiceTest.java(6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (8)
src/test/java/com/example/solidconnection/siteuser/service/MyPageServiceTest.java (1)
100-100: 테스트 메서드 호출이 올바르게 업데이트되었습니다.서비스 메서드 이름 변경에 맞춰 테스트가 적절히 수정되었습니다. 테스트 로직과 검증 부분은 그대로 유지되어 기능적 일관성이 보장됩니다.
src/test/java/com/example/solidconnection/university/service/UnivApplyInfoLikeServiceTest.java (1)
55-55: 테스트 메서드 호출들이 일관되게 업데이트되었습니다.
서비스 메서드 호출이 새로운 명명 규칙에 맞춰 정확히 변경되었습니다:
likeUnivApplyInfo→addUnivApplyInfoLikecancelLikeUnivApplyInfo→cancelUnivApplyInfoLikegetIsLiked→isUnivApplyInfoLiked헬퍼 메서드명도
saveLikedUniversity에서saveLikedUnivApplyInfo로 개선되어 더욱 명확해졌습니다.모든 테스트가 기능적 일관성을 유지하면서 새로운 명명 규칙을 따르고 있습니다.
Also applies to: 66-66, 69-69, 81-81, 84-84, 107-107, 115-115, 118-118, 127-127, 139-139, 144-144
src/main/java/com/example/solidconnection/university/service/UnivApplyInfoLikeService.java (3)
34-47: 좋아요 추가 메서드가 적절히 단순화되었습니다.
- 메서드명이
likeUnivApplyInfo에서addUnivApplyInfoLike로 변경되어 의도가 더 명확해졌습니다.- 반환 타입을
void로 변경하여 API가 단순화되었고, 불필요한 응답 래퍼 객체가 제거되었습니다.- 핵심 로직은 그대로 유지되어 기능적 일관성이 보장됩니다.
53-62: 좋아요 취소 메서드도 일관되게 개선되었습니다.
- 메서드명이
cancelLikeUnivApplyInfo에서cancelUnivApplyInfoLike로 변경되어 명명 일관성이 향상되었습니다.- 반환 타입 단순화로 클라이언트 코드가 더 깔끔해질 것입니다.
- 예외 처리 로직이 그대로 유지되어 안정성이 보장됩니다.
68-72: 좋아요 상태 확인 메서드명이 개선되었습니다.
getIsLiked에서isUnivApplyInfoLiked로 변경되어 메서드의 목적이 더 명확하고 가독성이 향상되었습니다. 반환 타입과 로직은 적절히 유지되었습니다.src/main/java/com/example/solidconnection/university/controller/UnivApplyInfoController.java (3)
49-54: 좋아요 목록 조회 엔드포인트가 적절히 업데이트되었습니다.
- 메서드명이
getMyWishUnivApplyInfo에서getLikedUnivApplyInfos로 변경되어 용어 통일이 달성되었습니다.- 서비스 호출도
myPageService.getLikedUnivApplyInfos로 일관되게 변경되었습니다.- 응답 타입과 로직은 그대로 유지되어 기능적 안정성이 보장됩니다.
57-63: 좋아요 상태 확인 엔드포인트가 명확하게 개선되었습니다.메서드명과 서비스 호출이
isUnivApplyInfoLiked로 통일되어 의도가 더욱 명확해졌습니다. RESTful API 관점에서도 적절한 네이밍입니다.
66-72: 좋아요 추가/취소 엔드포인트가 효과적으로 단순화되었습니다.
- 메서드명이 각각
addUnivApplyInfoLike,cancelUnivApplyInfoLike로 변경되어 일관성이 향상되었습니다.- 반환 타입을
ResponseEntity<Void>로 변경하여 불필요한 응답 객체가 제거되었습니다.ResponseEntity.ok().build()로 200 OK 응답을 반환하는 것이 적절합니다.- REST API 설계 관점에서 좋아요/취소 같은 액션은 성공 여부만 알면 되므로 단순화가 합리적입니다.
Also applies to: 75-81
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/com/example/solidconnection/siteuser/service/MyPageService.java (1)
97-103: 도메인 분리 관점에서의 메서드 위치 재고 제안PR 설명에서 언급하신 대로, 이 메서드를
UnivApplyInfoLikeService로 이동하는 것이 도메인 관점에서 더 적절할 것 같습니다.
현재 위치의 문제점:
- MyPageService는 페이지 관점의 서비스
- 좋아요한 대학 정보 조회는 좋아요 도메인에 더 적합
이동 시 장점:
- 도메인 응집도 향상
- 단일 책임 원칙 준수
- 유지보수성 개선
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/main/java/com/example/solidconnection/siteuser/service/MyPageService.java(1 hunks)src/main/java/com/example/solidconnection/university/controller/UnivApplyInfoController.java(1 hunks)src/main/java/com/example/solidconnection/university/service/UnivApplyInfoLikeService.java(4 hunks)src/test/java/com/example/solidconnection/siteuser/service/MyPageServiceTest.java(1 hunks)src/test/java/com/example/solidconnection/university/service/UnivApplyInfoLikeServiceTest.java(6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (15)
src/test/java/com/example/solidconnection/siteuser/service/MyPageServiceTest.java (1)
100-100: 용어 통일화가 잘 적용되었습니다!테스트 메서드 호출이 서비스 레이어의 변경사항과 일치하도록 정확히 업데이트되었습니다.
- 메서드 이름 변경:
getWishUnivApplyInfo→getLikedUnivApplyInfos- 용어 통일: "wish" → "like" 일관성 확보
src/main/java/com/example/solidconnection/siteuser/service/MyPageService.java (1)
97-97: 메서드 이름 변경이 적절히 완료되었습니다!용어 통일화 목적으로 메서드 이름이 정확히 업데이트되었습니다.
- 메서드 이름:
getWishUnivApplyInfo→getLikedUnivApplyInfos- 기능 유지: 내부 로직은 그대로 유지되어 안정성 확보
src/main/java/com/example/solidconnection/university/service/UnivApplyInfoLikeService.java (4)
34-34: 메서드 이름이 더욱 명확해졌습니다!메서드 이름이 액션의 의도를 더 잘 표현하도록 개선되었습니다.
- 변경사항:
likeUnivApplyInfo→addUnivApplyInfoLike- 개선점: "add"를 통해 좋아요 추가 액션임을 명확히 표현
53-53: 좋아요 취소 메서드 이름 개선 완료메서드 이름이 더 직관적이고 일관성 있게 변경되었습니다.
- 변경사항:
cancelLikeUnivApplyInfo→cancelUnivApplyInfoLike- 일관성:
addUnivApplyInfoLike와 네이밍 패턴 일치
68-68: 좋아요 상태 확인 메서드 네이밍 개선메서드 이름이 boolean 반환 메서드의 관례에 더 적합하게 변경되었습니다.
- 변경사항:
getIsLiked→isUnivApplyInfoLiked- 개선점: "is"로 시작하는 boolean 메서드 네이밍 관례 준수
34-47: 반환 타입 간소화가 적절히 적용되었습니다좋아요 추가 메서드의 반환 타입이 void로 변경되어 API가 더 간결해졌습니다.
변경 장점:
- HTTP 201/200 상태 코드만으로 성공 여부 확인 가능
- 불필요한 응답 페이로드 제거
- API 응답 시간 단축
RESTful 설계 관점:
- 리소스 생성/삭제 작업에서 일반적인 패턴
- 클라이언트는 HTTP 상태 코드로 결과 판단
src/test/java/com/example/solidconnection/university/service/UnivApplyInfoLikeServiceTest.java (5)
55-55: 테스트 메서드 호출이 정확히 업데이트되었습니다서비스 레이어의 메서드 이름 변경에 맞춰 테스트가 일관성 있게 수정되었습니다.
- 메서드 호출:
likeUnivApplyInfo→addUnivApplyInfoLike- 테스트 커버리지: 기존과 동일하게 유지
84-84: 좋아요 취소 테스트 메서드 업데이트 완료
- 메서드 호출:
cancelLikeUnivApplyInfo→cancelUnivApplyInfoLike- 테스트 로직: 핵심 검증 로직은 그대로 유지
118-118: 좋아요 상태 확인 테스트 메서드들 일괄 업데이트모든 관련 테스트 메서드에서 새로운 서비스 메서드를 정확히 호출하고 있습니다.
- 메서드 호출:
getIsLiked→isUnivApplyInfoLiked- 테스트 시나리오:
- 좋아요한 상태 확인
- 좋아요하지 않은 상태 확인
- 존재하지 않는 정보 예외 처리
Also applies to: 127-127, 139-139
144-144: 헬퍼 메서드 이름 통일성 확보헬퍼 메서드 이름이 도메인 용어와 일치하도록 적절히 변경되었습니다.
- 변경사항:
saveLikedUniversity→saveLikedUnivApplyInfo- 일관성: 도메인 객체명과 정확히 일치
58-61: 테스트 검증 로직 간소화가 적절합니다void 반환 타입 변경에 따라 테스트 검증 방식이 적절히 조정되었습니다.
- 변경 전: 응답 메시지 검증
- 변경 후: 데이터베이스 상태 직접 검증
- 장점:
- 더 직접적이고 명확한 테스트
- 실제 비즈니스 로직의 결과 확인
Also applies to: 87-90
src/main/java/com/example/solidconnection/university/controller/UnivApplyInfoController.java (4)
49-49: 좋아요 목록 조회 API 메서드 이름 개선API 메서드 이름이 더 직관적이고 RESTful하게 변경되었습니다.
- 메서드 이름:
getMyWishUnivApplyInfo→getLikedUnivApplyInfos- 서비스 호출:
myPageService.getLikedUnivApplyInfos사용- 용어 통일: "wish" → "like" 일관성 확보
Also applies to: 52-52
57-57: 좋아요 상태 확인 API 메서드 개선메서드 이름이 boolean 반환의 의미를 더 명확히 표현하도록 변경되었습니다.
- 메서드 이름:
getIsLiked→isUnivApplyInfoLiked- 서비스 호출: 업데이트된 서비스 메서드와 일치
- 네이밍 일관성: "is"로 시작하는 boolean 메서드 관례 준수
Also applies to: 61-61
66-72: 좋아요 추가 API 응답 타입 간소화API 응답이 더 간결하고 RESTful한 방식으로 개선되었습니다.
반환 타입 변경:
ResponseEntity<LikeResultResponse>→ResponseEntity<Void>메서드 이름:
addUnivApplyInfoLike로 의도 명확화HTTP 응답:
- 성공: 200 OK (응답 본문 없음)
- 실패: 예외를 통한 적절한 HTTP 상태 코드
RESTful 설계 장점:
- 불필요한 페이로드 제거
- 표준 HTTP 상태 코드 활용
- 클라이언트 처리 로직 간소화
75-81: 좋아요 취소 API도 동일하게 개선 완료좋아요 추가 API와 일관성 있는 개선이 적용되었습니다.
- 반환 타입:
ResponseEntity<Void>사용- 메서드 이름:
cancelUnivApplyInfoLike로 명확화- API 일관성: POST/DELETE 엔드포인트 동일한 응답 패턴
Gyuhyeok99
left a comment
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.
빠른 반영 너무 좋습니다 ㅎㅎ
UnivApplyInfoLikeService 하위로 옮기려 합니다.
전 옮기는 거 좋은 거 같습니다!
whqtker
left a comment
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.
확인했습니다 ! 말씀하신 내용도 동의합니다
lsy1307
left a comment
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.
특이사항 없는 것 같습니다!
- MyPageService에서 UnivApplyInfoLikeService 로
관련 이슈
작업 내용
특이 사항
getLikedUnivApplyInfos()함수가MyPageService에 선언되어있더라고요.아마 그걸 구현하는 당시의 저는 (약 1년 전...) 페이지의 관점에서 API를 생각했던 것 같은데
이건 LikedUnivApplyInfo 라는 도메인에 관련된 것이니 위치를
UnivApplyInfoLikeService하위로 옮기려 합니다.여기에 대해 의견 부탁드립니다. 🙇🏻♀️
리뷰 요구사항 (선택)