-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 이번주 과제 조회 API 구현 * feat: 불필요한 코드 제거 및 엔드포인트 수정 * feat: 코드 오타 수정 * fix: 레포지토리 메소드 위치 수정 * feat: 이번주까지 마감인 과제들 반환 로직 추가 * feat: 도메인 메소드에 추가 * feat: 도메인 메소드 주석 가독성 향상 * feat: 과제 제출 내역이 null일때 고려해서 response반환 * feat: 과제 제출 이력이 없을 때 StudyDetail에서 가져와서 반환 * feat: 과제 응답 클래스명 변경 * feat: 과제 응답 로직 개선 * feat: npe 예방 코드 * fix: 머지 컨플릭트 해결 * feat: merge develop
- Loading branch information
1 parent
bcd0e50
commit 9baf58c
Showing
9 changed files
with
110 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...n/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentHistoryStatusResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.gdschongik.gdsc.domain.study.dto.response; | ||
|
||
import static com.gdschongik.gdsc.domain.study.domain.SubmissionFailureType.NOT_SUBMITTED; | ||
|
||
import com.gdschongik.gdsc.domain.study.domain.*; | ||
import com.gdschongik.gdsc.domain.study.domain.vo.Assignment; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.annotation.Nullable; | ||
import java.time.LocalDateTime; | ||
|
||
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) { | ||
|
||
// 과제 제출이 없는 경우, 과제 정보만 사용하여 AssignmentHistoryStatusResponse 생성 | ||
public static AssignmentHistoryStatusResponse of(StudyDetail studyDetail, AssignmentHistory assignmentHistory) { | ||
if (assignmentHistory == null) { | ||
return new AssignmentHistoryStatusResponse( | ||
studyDetail.getId(), | ||
studyDetail.getAssignment().getStatus(), | ||
studyDetail.getWeek(), | ||
studyDetail.getAssignment().getTitle(), | ||
null, | ||
studyDetail.getAssignment().getDescriptionLink(), | ||
studyDetail.getAssignment().getDeadline(), | ||
null, | ||
NOT_SUBMITTED, | ||
null); | ||
} | ||
|
||
Assignment assignment = studyDetail.getAssignment(); | ||
return new AssignmentHistoryStatusResponse( | ||
studyDetail.getId(), | ||
assignment.getStatus(), | ||
studyDetail.getWeek(), | ||
assignment.getTitle(), | ||
assignmentHistory.getSubmissionStatus(), | ||
assignment.getDescriptionLink(), | ||
assignment.getDeadline(), | ||
assignmentHistory.getSubmissionLink(), | ||
assignmentHistory.getSubmissionFailureType(), | ||
assignmentHistory.getCommittedAt()); | ||
} | ||
} |