Skip to content

Commit

Permalink
feat: 졸업요건 검사 API 응답값 생성
Browse files Browse the repository at this point in the history
- 주전공만 지원
- 주전공 관련 필드만 우선 제공
  • Loading branch information
tmdcheol committed Nov 19, 2024
1 parent 1dffca8 commit cb3071f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static GraduationResponse.AllDTO toAllDTO(
List<Object> DTOList,
final int totalCompletedCredit
) {
for (Object o : DTOList) {
/* for (Object o : DTOList) {
if (o instanceof GraduationResponse.MainDTO response) {
boolean isOverTotalNeedCredit = response.totalNeedCredit() <= totalCompletedCredit;
log.info("totalCompletedCredit: {}", totalCompletedCredit);
Expand All @@ -33,8 +33,22 @@ public static GraduationResponse.AllDTO toAllDTO(
if (o instanceof GraduationResponse.MinorDTO) {
}
}
return new AllDTO();
}*/

GraduationResponse.MainDTO mainDTO = (GraduationResponse.MainDTO) DTOList.get(0);
boolean isOverTotalNeedCredit = mainDTO.totalNeedCredit() <= totalCompletedCredit;

return new AllDTO(
mainDTO.swAiDTO(),
mainDTO.creativityDTO(),
mainDTO.coreDTO(),
mainDTO.majorRequiredDTO(),
mainDTO.majorSelectDTO(),
mainDTO.generalRequiredDTO(),
totalCompletedCredit,
mainDTO.totalNeedCredit(),
isOverTotalNeedCredit
);
}

public static GraduationResponse.MainDTO toMainDTO(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@

public abstract class GraduationResponse {

public record AllDTO() {
public record AllDTO(
ProcessorResponse.SwAiDTO swAiDTO,
ProcessorResponse.CreativityDTO creativityDTO,
ProcessorResponse.CoreDTO coreDTO,
ProcessorResponse.MajorRequiredDTO majorRequiredDTO,
ProcessorResponse.MajorSelectDTO majorSelectDTO,
ProcessorResponse.GeneralRequiredDTO generalRequiredDTO,
int totalCompletedCredit,
int totalNeedCredit,
boolean isOverTotalNeedCredit
) {

}

Expand Down

0 comments on commit cb3071f

Please sign in to comment.