Skip to content

Commit d5502df

Browse files
authored
refactor: enum값을 함께 반환하도록 되돌림 (#327)
1 parent 045d746 commit d5502df

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

aics-api/src/main/java/kgu/developers/api/graduationUser/presentation/response/MyGraduationUserResponse.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212

1313
@Builder
1414
public record MyGraduationUserResponse(
15-
@Schema(description = "제목", example = "최종 보고서를 제출하지 않았어요.")
16-
String title,
15+
@Schema(description = "현재 상태", example = "FINAL_THESIS_NOT_SUBMITTED")
16+
GraduationUserStatus status,
1717

18-
@Schema(description = "내용", example = "최종 보고서 마감 기한은 2025년 10월 30일이에요.")
19-
String description
18+
@Schema(description = "제목", example = "최종 보고서를 제출하지 않았어요.")
19+
String title,
20+
21+
@Schema(description = "내용", example = "최종 보고서 마감 기한은 2025년 10월 30일이에요.")
22+
String description
2023
) {
2124
private static final DateTimeFormatter KOREAN_DATE = DateTimeFormatter.ofPattern("yyyy년 M월 d일");
2225

@@ -47,22 +50,20 @@ public static MyGraduationUserResponse from(GraduationUser graduationUser, Sched
4750
};
4851

4952
return MyGraduationUserResponse.builder()
50-
.title(title)
51-
.description(description)
52-
.build();
53+
.status(status)
54+
.title(title)
55+
.description(description)
56+
.build();
5357
}
5458

55-
/**
56-
* 서비스에서 schedule 조회할 때 쓰라고 status -> SubmissionType 매핑도 제공
57-
*/
5859
public static SubmissionType requiredSubmissionType(GraduationUser graduationUser) {
5960
GraduationUserStatus status = determineStatus(graduationUser);
6061

6162
return switch (status) {
6263
case MID_THESIS_NOT_SUBMITTED -> SubmissionType.MIDTHESIS;
6364
case FINAL_THESIS_NOT_SUBMITTED -> SubmissionType.FINALTHESIS;
6465
case CERTIFICATE_NOT_SUBMITTED -> SubmissionType.CERTIFICATE;
65-
default -> null; // schedule 필요 없는 상태들
66+
default -> null;
6667
};
6768
}
6869

0 commit comments

Comments
 (0)