-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: 나의 수강중인 스터디 조회 API 추가 #656
Conversation
Caution Review failedThe pull request is closed. ## Walkthrough
이번 변경 사항은 `StudentStudyController`와 `StudentStudyService`에 새로운 메소드를 추가하여 사용자가 현재 참여 중인 스터디 정보를 조회할 수 있는 기능을 강화합니다. 새로운 API 엔드포인트는 사용자 경험을 개선하고, 스터디 데이터 접근성을 높이는 역할을 합니다.
## Changes
| 파일 경로 | 변경 요약 |
|--------------------------------------------------|-------------------------------------------------------|
| `src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyController.java`, `src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyService.java` | `getMyOngoingStudy()` 및 `getMyCurrentStudy()` 메소드 추가하여 현재 참여 중인 스터디 조회 기능 구현. |
| `src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudentOngoingStudyResponse.java`, `src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudentMyCurrentStudyResponse.java` | 새로운 레코드 `StudentMyCurrentStudyResponse` 추가 및 `StudentOngoingStudyResponse` 수정하여 스터디 정보를 응답 형식으로 변환하는 기능 제공. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant User
participant Controller
participant Service
participant Repository
User->>Controller: getMyOngoingStudy()
Controller->>Service: getMyOngoingStudy()
Service->>Repository: fetchStudyHistories()
Repository-->>Service: studyHistories
Service-->>Controller: StudentOngoingStudyResponse
Controller-->>User: Ongoing Study Data
User->>Controller: getMyCurrentStudy()
Controller->>Service: getMyCurrentStudy()
Service->>Repository: fetchStudyHistories()
Repository-->>Service: studyHistories
Service-->>Controller: StudentMyCurrentStudyResponse
Controller-->>User: Current Study Data Assessment against linked issues
src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyController.java: ## AI-generated summary of changes The diff introduces new endpoints in the Alterations to the declarations of exported or public entities
src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyService.java: ## AI-generated summary of changes The changes in Alterations to the declarations of exported or public entities
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudentOngoingStudyResponse.java: ## AI-generated summary of changes The file Alterations to the declarations of exported or public entities
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudentMyCurrentStudyResponse.java: ## AI-generated summary of changes The newly introduced file Alterations to the declarations of exported or public entities
|
Job Summary for GradleCheck Style and Test to Develop :: build-test
|
Job Summary for GradleCheck Style and Test to Develop :: build-test
|
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyController.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyService.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudentOngoingStudyResponse.java (1 hunks)
Additional comments not posted (3)
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/StudentOngoingStudyResponse.java (1)
5-11
: 잘 구현된StudentOngoingStudyResponse
클래스입니다.이 클래스는
StudyHistory
객체를StudentOngoingStudyResponse
로 변환하는from
메서드를 포함하고 있으며, null 값을 적절히 처리하고 있습니다. 레코드 기능을 활용하여 불변성을 유지하는 점이 좋습니다.src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyController.java (1)
58-63
: 새로운 API 엔드포인트getMyOngoingStudy
가 잘 추가되었습니다.이 메서드는 현재 수강 중인 스터디를 조회하는 기능을 제공하며, 적절한 API 문서화를 위한 어노테이션이 포함되어 있습니다.
ResponseEntity
를 사용하여 응답을 처리하는 방식이 적절합니다.src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyService.java (1)
96-103
:getMyOngoingStudy
메서드가 잘 구현되었습니다.이 메서드는 현재 멤버의 진행 중인 스터디를 조회하며,
@Transactional(readOnly = true)
어노테이션을 통해 읽기 전용 작업임을 명시하고 있습니다.memberUtil
을 사용하여 현재 멤버를 가져오고, 스트림을 사용하여 필터링하는 방식이 효율적입니다.
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.
lgtm
@@ -90,4 +92,13 @@ public void attend(Long studyDetailId, StudyAttendCreateRequest request) { | |||
|
|||
log.info("[StudyService] 스터디 출석: attendanceId={}", attendance.getId()); | |||
} | |||
|
|||
@Transactional(readOnly = true) | |||
public StudentOngoingStudyResponse getMyOngoingStudy() { |
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.
ongoing은 현재 진행중인 이라는 뜻이 있어서, 내가 '수강중인' 스터디라는 맥락을 드러내기엔 부적합한 것 같습니다.
그냥 getMyCurrentStudy
나 getMyEnrolledStudy
가 적절할듯 하네요
@Transactional(readOnly = true) | ||
public StudentOngoingStudyResponse getMyOngoingStudy() { | ||
Member currentMember = memberUtil.getCurrentMember(); | ||
Optional<StudyHistory> studyHistory = studyHistoryRepository.findAllByMentee(currentMember).stream() |
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.
마이너하긴 한데 여기서 orElse(null)까지 끌고가는게 의미적으로 더 낫지 않을까 싶네요
파라미터에서 로직을 수행하는 건 한 라인에 두 가지 일을 수행하는 거라 별로라서요
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.
그렇네요
굳이 파라미터에서 할 필요없겠어요
수정 후 반영했습니다~
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.
LGTM
Job Summary for GradleCheck Style and Test to Develop :: build-test
|
🌱 관련 이슈
📌 작업 내용 및 특이사항
나의 스터디
페이지 진입시, 내가 어떤 스터디를 듣고 있는지 조회할 수 있어야 합니다.📝 참고사항
📚 기타
Summary by CodeRabbit
신규 기능
개선 사항