-
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 구현 #647
Conversation
Caution Review failedThe pull request is closed. ## Walkthrough
이번 변경 사항은 학생들이 이번 주에 제출해야 할 과제를 조회할 수 있는 새로운 API 엔드포인트를 `StudentStudyDetailController`에 추가합니다. 이로 인해 사용자는 과제 목록을 쉽게 확인할 수 있으며, 관련 메서드의 시그니처와 데이터 처리 방식도 개선되었습니다.
## Changes
| 파일 경로 | 변경 요약 |
|-----------------------------------------------------|-----------------------------------------------------------------|
| `.../api/StudentStudyDetailController.java`, `.../application/StudentStudyDetailService.java` | 새로운 API 엔드포인트 추가 및 메서드 시그니처 변경 |
| `.../repository/AssignmentHistoryRepository.java` | 메서드 이름 변경 및 새로운 메서드 추가 |
| `.../domain/vo/Assignment.java`, `.../domain/StudyDetail.java`, `.../dto/response/AssignmentHistoryStatusResponse.java` | 과제 상태 응답을 위한 새로운 객체 정의 및 메서드 추가 |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant User
participant Controller
participant Service
participant Repository
User->>Controller: GET /upcoming-assignments?studyId={studyId}
Controller->>Service: getUpcomingAssignments(studyId)
Service->>Repository: findAssignmentHistoriesByStudentAndStudyId(currentMember, studyId)
Repository-->>Service: Return assignment histories
Service-->>Controller: Return list of AssignmentHistoryStatusResponse
Controller-->>User: Respond with assignments Assessment against linked issues
src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java: ## AI-generated summary of changes The diff introduces a new API endpoint in the Alterations to the declarations of exported or public entities
src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java: ## AI-generated summary of changes The changes in the These modifications improve the service's functionality by allowing clients to access the status of upcoming assignments while ensuring a consistent approach to fetching assignment histories. Alterations to the declarations of exported or public entities
src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java: ## AI-generated summary of changes The diff introduces a new method Alterations to the declarations of exported or public entities
src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetail.java: ## AI-generated summary of changes The diff introduces a new public method Alterations to the declarations of exported or public entities
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentHistoryStatusResponse.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
|
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/StudentStudyDetailController.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentStatusResponse.java (1 hunks)
Additional comments not posted (5)
src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (2)
5-5
: 잘하셨습니다! 새로운 클래스 임포트.
AssignmentStatusResponse
클래스가 올바르게 임포트되었습니다.
32-38
: 새로운 API 엔드포인트 구현 확인.새로운
getAssignmentsToSubmit
메서드가 올바르게 추가되었습니다. API 문서화 및 요청 매핑이 적절하게 설정되어 있습니다.src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentStatusResponse.java (1)
1-37
: 새로운 레코드 클래스 정의 확인.
AssignmentStatusResponse
레코드가 잘 정의되었습니다. 각 필드에 대해 적절한 주석이 추가되어 있으며,from
메서드를 통해AssignmentHistory
객체를 변환하는 로직도 명확합니다.src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (2)
9-9
: 잘하셨습니다! 새로운 클래스 임포트.
AssignmentStatusResponse
클래스가 올바르게 임포트되었습니다.
45-55
: 새로운 메서드getAssignmentsToSubmit
구현 확인.새로운 메서드가 올바르게 구현되었습니다.
@Transactional(readOnly = true)
어노테이션을 통해 읽기 전용 트랜잭션으로 설정되어 있으며, 필터링 및 매핑 로직이 명확합니다.
@@ -26,4 +28,12 @@ public ResponseEntity<AssignmentDashboardResponse> getSubmittableAssignments( | |||
AssignmentDashboardResponse response = studentStudyDetailService.getSubmittableAssignments(studyId); | |||
return ResponseEntity.ok(response); | |||
} | |||
|
|||
@Operation(summary = "이번주 제출해야 할 과제 조회", description = "마감 기한이 이번주까지인 과제를 조회합니다.") | |||
@GetMapping("/assignments") |
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.
전체 과제를 조회하는게 아니라서 추가 컨텍스트가 있으면 좋을듯 합니다
@Schema(description = "과제 상태") StudyStatus assignmentStatus, | ||
@Schema(description = "주차") Long week, | ||
@Nullable @Schema(description = "과제 제목") String title, | ||
@Nullable @Schema(description = "과제 제출 상태") AssignmentSubmissionStatus assignmentSubmissionStatus, |
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.
이 부분은 #638 에서 처리할거라 todo만 달아주세요
assignment.getDescriptionLink(), | ||
assignment.getDeadline(), | ||
assignmentHistory.getSubmissionLink(), | ||
assignmentHistory.getSubmissionFailureType() == 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.
변경 후에는 항상 null이 아니기 때문에 null 체크 안해도 됩니다
assignmentHistory.getSubmissionFailureType() == null | ||
? null | ||
: assignmentHistory.getSubmissionFailureType(), | ||
assignmentHistory.getCommittedAt() == null ? null : assignmentHistory.getCommittedAt()); |
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.
최종 수정 일시가 필요한 것으로 보여 구현해놓았는데...필요가 없나요?
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.
위의 것도 지금봤는데 삼항 연산자를 쓸 이유가 있나요?
assignmentHistory.getCommittedAt()
와 동일한 코드 같습니다.
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 (2)
- src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentStatusResponse.java (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentStatusResponse.java
public List<AssignmentStatusResponse> getAssignmentsToSubmit(Long studyId) { | ||
Member currentMember = memberUtil.getCurrentMember(); | ||
List<AssignmentHistory> assignmentHistories = | ||
assignmentHistoryRepository.findAssignmentHistoriesByMenteeAndStudy(currentMember, studyId).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.
assignmentHistoryRepository.findAssignmentHistoriesByMenteeAndStudy(currentMember, studyId).stream() | |
assignmentHistoryRepository.findAssignmentHistoriesByMenteeAndStudyId(currentMember, studyId).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.
study를 따로 호출해야하는데 굳이지 않나용?
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.
인자로 StudyId를 받고 있으니, 메서드명이 Study로 끝나는게 아니라 StudyId로 끝나야 한다는 의미입니다.
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.
아아 죄송해요 잘못봤네요
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 (2)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dao/AssignmentHistoryRepository.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java
Additional comments not posted (1)
src/main/java/com/gdschongik/gdsc/domain/study/dao/AssignmentHistoryRepository.java (1)
14-14
: 새로운 메서드 추가 확인
findAssignmentHistoriesByMenteeAndStudyId
메서드는Member
와studyId
를 기반으로 여러AssignmentHistory
객체를 반환하도록 설계되었습니다. 메서드 이름이 명확하고 Java 명명 규칙을 따르고 있습니다. 메서드 시그니처가 적절하며, 여러 결과를 반환하기 위해List<AssignmentHistory>
를 사용하는 것이 적절합니다.그러나 이 메서드의 구현이 예상대로 작동하는지 확인하는 것이 좋습니다. 이 메서드를 호출하는 코드가 올바르게 작동하는지 검증하십시오.
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 (4)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (3 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyHistoryService.java (1 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dao/AssignmentHistoryCustomRepository.java (1 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dao/AssignmentHistoryCustomRepositoryImpl.java (1 hunks)
Files skipped from review due to trivial changes (2)
- src/main/java/com/gdschongik/gdsc/domain/study/dao/AssignmentHistoryCustomRepository.java
- src/main/java/com/gdschongik/gdsc/domain/study/dao/AssignmentHistoryCustomRepositoryImpl.java
Files skipped from review as they are similar to previous changes (1)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java
Additional comments not posted (1)
src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyHistoryService.java (1)
77-77
: 리포지토리 메서드 호출 변경 확인
findAssignmentHistoriesByMenteeAndStudyId
메서드 호출로 변경되었습니다. 이 변경은studyId
를 사용하여 과제 이력을 조회하는 것으로 보입니다. 리포지토리 메서드가 올바르게 구현되었는지 확인하고, 예상되는 동작과 일치하는지 검증해 주세요. 또한, 이 변경이 다른 부분에 영향을 미치지 않는지 확인하는 것이 중요합니다.Verification successful
리포지토리 메서드 구현 확인 완료
findAssignmentHistoriesByMenteeAndStudyId
메서드는AssignmentHistoryCustomRepositoryImpl.java
에 구현되어 있으며,AssignmentHistoryCustomRepository.java
에 선언되어 있습니다. 이 메서드는StudentStudyDetailService.java
와StudentStudyHistoryService.java
에서 사용되고 있어, 올바르게 구현된 것으로 보입니다. 이 변경이 다른 부분에 영향을 미치지 않는지 추가로 확인해 주세요.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of `findAssignmentHistoriesByMenteeAndStudyId` in the repository. # Test: Search for the method definition. Expect: Correct implementation using `studyId`. ast-grep --lang java --pattern $'public List<AssignmentHistory> findAssignmentHistoriesByMenteeAndStudyId(Member mentee, Long studyId) { $$$ }'Length of output: 146
Script:
#!/bin/bash # Description: Search for the method name `findAssignmentHistoriesByMenteeAndStudyId` in the repository to verify its existence and implementation. # Test: Use ripgrep to find occurrences of the method name. rg 'findAssignmentHistoriesByMenteeAndStudyId'Length of output: 1064
|
||
@Operation(summary = "이번주 제출해야 할 과제 조회", description = "마감 기한이 이번주까지인 과제를 조회합니다.") | ||
@GetMapping("/assignments/upcoming") | ||
public ResponseEntity<List<AssignmentStatusResponse>> getAssignmentsToSubmit( |
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.
endpoint랑 비슷한 느낌으로 가면 어떨까요
public ResponseEntity<List<AssignmentStatusResponse>> getAssignmentsToSubmit( | |
public ResponseEntity<List<AssignmentStatusResponse>> getUpcomingAssignments( |
List<AssignmentHistory> assignmentHistories = | ||
assignmentHistoryRepository.findAssignmentHistoriesByMenteeAndStudyId(currentMember, studyId).stream() | ||
.filter(assignmentHistory -> | ||
assignmentHistory.getStudyDetail().isAssignmentDeadlineRemaining()) |
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.
api summary는 이번주 제출해야 할 과제 조회인데, 이번주라는 조건이 보이지 않습니다.
조건을 수정 혹은 api 설명을 수정해주셔야 할 것 같습니다.
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.
조건 추가하겠습니다
…into feature/631-student-get-assignment
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 (5)
- src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (3 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyHistoryService.java (1 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetail.java (1 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyHistoryService.java
Additional comments not posted (4)
src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (1)
32-38
: API 엔드포인트 설명 및 메서드명 일치메서드
getUpcomingAssignments
는 이번 주 제출해야 할 과제를 조회하는 기능을 제공합니다. 메서드명과 API 설명이 일치하는지 확인하세요. 기존 리뷰에서 제안된 메서드명 변경이 반영되었는지 검토해보세요.src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (1)
45-55
: 이번 주 과제 필터링 로직 확인메서드
getUpcomingAssignments
는 이번 주 마감인 과제를 필터링합니다.isAssignmentDeadlineThisWeek
메서드를 사용하여 올바르게 필터링되고 있는지 확인하세요. 기존 리뷰에서 언급된 조건 추가가 반영되었는지 검토해보세요.src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java (1)
97-107
: 이번 주 마감일 확인 로직 검토메서드
isDeadLineThisWeek
는 마감일이 이번 주 내에 있는지 확인합니다.LocalDate
를 사용하여 주의 시작과 끝을 계산하는 로직이 올바른지 검토하세요. 이 로직이 주말을 포함하여 올바르게 작동하는지 확인하는 것이 중요합니다.src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetail.java (1)
97-99
: 과제 마감일 이번 주 확인 로직 검토메서드
isAssignmentDeadlineThisWeek
는 과제의 마감일이 이번 주 내에 있는지 확인합니다.Assignment
클래스의isDeadLineThisWeek
메서드를 호출하여 올바르게 작동하는지 검토하세요. 이 메서드가 정확한 결과를 반환하는지 테스트 케이스를 통해 확인하는 것이 좋습니다.
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 (1)
- src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java
List<AssignmentHistory> assignmentHistories = | ||
assignmentHistoryRepository.findAssignmentHistoriesByMenteeAndStudyId(currentMember, studyId).stream() | ||
.filter(assignmentHistory -> | ||
assignmentHistory.getStudyDetail().isAssignmentDeadlineThisWeek()) | ||
.toList(); |
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.
이렇게 하면 아직 제출 시도를 하지 않은 Assignment는 AssignmentHistory가 없으므로 누락될 수 있을 것 같습니다.
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.
슬기님꺼 피알 머지 되면 처리할게영 그럼!
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 (1)
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentStatusResponse.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentStatusResponse.java
List<AssignmentHistory> assignmentHistories = | ||
assignmentHistoryRepository.findAssignmentHistoriesByStudentAndStudyId(currentMember, studyId).stream() | ||
.filter(assignmentHistory -> | ||
assignmentHistory.getStudyDetail().isAssignmentDeadlineThisWeek()) | ||
.toList(); |
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.
제출한 이력이 없는 과제에 대해서는 AssignmentHistory가 존재하지 않습니다.
따라서, 이 방법으로는 제출한 적 있는 과제에 대해서만 조회가 가능합니다.
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.
Response한번 보시겠어요??
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.
아 이해했어용
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.
근데 질문이 있는데 수강신청하면 자동으로 저 assignmentHistory가 생기는게 아닌가요?
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.
StudentStudyHistoryService의 findOrCreate 메서드 확인해주세요
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.
그런데 상욱님 제가 만든 Response를 보시면 null이면 Assignment를 반환하게 만들었는데 이걸로 충분한거 같은데 왜 다른 로직이 필요하다고 생각하신지 여쭈어봐도 될까용
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.
어 아니에요!! 무시하셔두 됩니다 제가 오늘 밤에 퇴근하고 고칠게요
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/application/StudentStudyDetailService.java (3 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dao/StudyDetailRepository.java (1 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentStatusResponse.java (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentStatusResponse.java
Additional comments not posted (1)
src/main/java/com/gdschongik/gdsc/domain/study/dao/StudyDetailRepository.java (1)
11-11
: 새로운 메서드 추가가 적절합니다.
findAllByStudyId
메서드는StudyDetail
객체를 정렬 없이 검색할 수 있는 기능을 제공하여 데이터 접근의 유연성을 높입니다.이 메서드가 코드베이스에서 올바르게 사용되고 있는지 확인하세요.
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
Outside diff range, codebase verification and nitpick comments (2)
src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (1)
33-39
: 메서드 이름 및 엔드포인트 경로 개선 제안현재 메서드 이름과 엔드포인트 경로가 기능을 충분히 설명하지 못할 수 있습니다. 더 명확한 설명을 위해 다음과 같이 변경하는 것을 고려해보세요:
@GetMapping("/assignments/this-week") public ResponseEntity<List<AssignmentHistoryStatusResponse>> getAssignmentsDueThisWeek(이렇게 하면 API 사용자가 이번 주에 제출해야 할 과제를 조회하는 것임을 더 쉽게 이해할 수 있습니다.
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentHistoryStatusResponse.java (1)
11-23
:@Nullable
사용 적절성 및 TODO 주석
@Nullable
어노테이션이 적절하게 사용되었습니다. 또한 TODO 주석이 있으니 추후에 처리해야 할 작업을 잊지 않도록 주의하세요.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (3 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentHistoryStatusResponse.java (1 hunks)
Additional comments not posted (3)
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentHistoryStatusResponse.java (1)
24-54
: 필드 매핑 로직 확인
from
및fromStudyDetail
메서드의 필드 매핑 로직이 올바르게 구현되었습니다. 모든 필요한 필드가 적절히 매핑되었으며, 필드가 null일 수 있는 경우를 고려한 점이 좋습니다.src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (2)
45-45
: 리포지토리 메서드 이름 명확성리포지토리 메서드 이름이
findAssignmentHistoriesByStudentAndStudyId
로 변경되어 명확성이 향상되었습니다. 이로 인해 코드의 가독성이 개선되었습니다.
55-75
: 필터링 로직 및 에지 케이스 처리 확인
getUpcomingAssignments
메서드가 이번 주에 마감되는 과제를 올바르게 필터링하고, 제출 이력이 없는 경우를 적절히 처리하고 있습니다. 이러한 로직은 기능의 신뢰성을 높입니다.
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
|
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (3 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentHistoryStatusResponse.java (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java
- src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java
Additional comments not posted (2)
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentHistoryStatusResponse.java (2)
1-10
: 적절한 import 문 사용import 문이 클래스의 기능에 적절하게 사용되었습니다.
25-53
: 정적 팩토리 메서드 구현이 적절합니다.
assignmentHistory
의 존재 여부에 따라AssignmentHistoryStatusResponse
를 올바르게 생성합니다. 논리가 명확하며 null 케이스를 효과적으로 처리합니다.
public record AssignmentHistoryStatusResponse( | ||
Long studyDetailId, | ||
@Schema(description = "과제 상태") StudyStatus assignmentStatus, | ||
@Schema(description = "주차") Long week, | ||
@Nullable @Schema(description = "과제 제목") String title, | ||
// TODO 추후 처리 예정 | ||
@Nullable @Schema(description = "과제 제출 상태") AssignmentSubmissionStatus assignmentSubmissionStatus, | ||
@Nullable @Schema(description = "과제 명세 링크") String descriptionLink, | ||
@Nullable @Schema(description = "마감 기한") LocalDateTime deadline, | ||
@Nullable @Schema(description = "과제 제출 링크") String submissionLink, | ||
@Nullable @Schema(description = "과제 제출 실패 사유. 제출 여부도 포함되어 있습니다. 미제출 상태라면 기본 과제 정보만 반환합니다.") | ||
SubmissionFailureType submissionFailureType, | ||
@Nullable @Schema(description = "최종 수정 일시") LocalDateTime committedAt) { |
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.
필드 정의가 잘 되어 있습니다.
필드에 대한 API 문서화가 적절하게 이루어졌습니다. TODO 주석은 추후 작업을 나타냅니다.
추후 작업에 대한 도움이 필요하시면 말씀해 주세요. 관련 GitHub 이슈를 생성할 수 있습니다.
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
public List<AssignmentHistoryStatusResponse> getUpcomingAssignments(Long studyId) { | ||
Member currentMember = memberUtil.getCurrentMember(); | ||
List<StudyDetail> studyDetails = studyDetailRepository.findAllByStudyId(studyId).stream() | ||
.filter(studyDetail -> studyDetail.isAssignmentDeadlineThisWeek()) |
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.
이거 아마 한번 돌려보시면 assignment.deadline이 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.
위에 구현하신 isOpen가져와서 비교하는 대로 수정했습니다
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 (1)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (3 hunks)
Additional comments not posted (3)
src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (3)
42-42
: 리포지토리 메서드 이름 확인 필요리포지토리 메서드 이름이
findAssignmentHistoriesByStudentAndStudyId
로 변경되었습니다. 이 이름이 일관성 있는지 확인해주세요.
57-74
: 빈 과제 목록 처리 확인이번 주에 마감 기한이 있는 과제가 없을 경우, 이 메서드가 빈 목록을 올바르게 처리하는지 확인해주세요.
81-81
: 리포지토리 메서드의 적절성 확인
getStudySessions
와getSubmittableAssignments
에서 동일한 리포지토리 메서드를 사용하고 있습니다. 두 경우 모두에 적합한지 확인해주세요.
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
|
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 (2)
- src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (2 hunks)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (4 hunks)
Additional comments not posted (6)
src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java (3)
Line range hint
17-22
: 코드 변경 사항이 적절합니다.
getSubmittableAssignments
메서드는 올바르게 구현되었습니다.
Line range hint
28-33
: 코드 변경 사항이 적절합니다.
getStudySessions
메서드는 올바르게 구현되었습니다.
42-48
: 코드 변경 사항이 적절합니다.
getUpcomingAssignments
메서드는 올바르게 구현되었습니다.src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (3)
Line range hint
36-54
: 코드 변경 사항이 적절합니다.
getSubmittableAssignments
메서드는 올바르게 구현되었습니다.
Line range hint
56-74
: 코드 변경 사항이 적절합니다.
getStudySessions
메서드는 올바르게 구현되었습니다.
88-105
: 코드 변경 사항이 적절합니다.
getUpcomingAssignments
메서드는 올바르게 구현되었습니다.
…into feature/631-student-get-assignment
Job Summary for GradleCheck Style and Test to Develop :: build-test
|
🌱 관련 이슈
📌 작업 내용 및 특이사항
2024/08/23
Study -> StudyId인것도 함께 처리하는 요청이 들어와서 같이 처리했다는 것 봐주세용
📝 참고사항
📚 기타
Summary by CodeRabbit
Summary by CodeRabbit
New Features
AssignmentHistoryStatusResponse
레코드가 도입되었습니다.Bug Fixes