From 8b4a7901dfd98841d4aed24ee84142a7116ca575 Mon Sep 17 00:00:00 2001 From: Chanyeong Lim Date: Sat, 14 Mar 2026 15:42:07 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EA=B0=95=EC=9D=98=EC=9D=BC=EA=B8=B0?= =?UTF-8?q?=EC=9E=A5=20=EC=A7=88=EB=AC=B8=20=EC=B6=94=EA=B0=80=20=EC=8B=9C?= =?UTF-8?q?=20answers=EC=99=80=20shortAnswers=20=EA=B8=B8=EC=9D=B4=20?= =?UTF-8?q?=EA=B0=99=EC=9D=80=EC=A7=80=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/kotlin/common/exception/ErrorType.kt | 1 + core/src/main/kotlin/common/exception/SnuttException.kt | 2 ++ core/src/main/kotlin/diary/service/DiaryService.kt | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/core/src/main/kotlin/common/exception/ErrorType.kt b/core/src/main/kotlin/common/exception/ErrorType.kt index c781b425..281499e6 100644 --- a/core/src/main/kotlin/common/exception/ErrorType.kt +++ b/core/src/main/kotlin/common/exception/ErrorType.kt @@ -65,6 +65,7 @@ enum class ErrorType( NOT_PUBLISHED_THEME(HttpStatus.BAD_REQUEST, 40022, "공유한 테마가 아닙니다", "공유한 테마가 아닙니다"), PUBLISHED_THEME_DELETE_ERROR(HttpStatus.BAD_REQUEST, 40023, "테마마켓에서 테마를 내린 뒤 다시 시도해주세요", "테마마켓에서 테마를 내린 뒤 다시 시도해주세요"), TIMETABLE_LECTURE_REMINDER_INVALID_TIME(HttpStatus.BAD_REQUEST, 40024, "리마인더는 시간이 설정된 강의에만 등록할 수 있어요", "리마인더는 시간이 설정된 강의에만 등록할 수 있어요"), + DIARY_QUESTION_INVALID(HttpStatus.BAD_REQUEST, 40025, "강의 일기장 질문이 유효하지 않습니다", "강의 일기장 질문이 유효하지 않습니다"), VACANCY_NOTIFICATION_TEMPORARILY_UNAVAILABLE( HttpStatus.BAD_REQUEST, 40025, diff --git a/core/src/main/kotlin/common/exception/SnuttException.kt b/core/src/main/kotlin/common/exception/SnuttException.kt index 6a8cf9c5..e4cc8259 100644 --- a/core/src/main/kotlin/common/exception/SnuttException.kt +++ b/core/src/main/kotlin/common/exception/SnuttException.kt @@ -135,6 +135,8 @@ object SocialProviderNotAttachedException : SnuttException(ErrorType.SOCIAL_PROV object DiaryQuestionNotFoundException : SnuttException(ErrorType.DIARY_QUESTION_NOT_FOUND) +object DiaryQuestionInvalidException : SnuttException(ErrorType.DIARY_QUESTION_INVALID) + object DiaryDailyClassTypeNotFoundException : SnuttException(ErrorType.DIARY_DAILY_CLASS_TYPE_NOT_FOUND) object DiarySubmissionNotFoundException : SnuttException(ErrorType.DIARY_SUBMISSION_NOT_FOUND) diff --git a/core/src/main/kotlin/diary/service/DiaryService.kt b/core/src/main/kotlin/diary/service/DiaryService.kt index 2c3892cd..72e0f131 100644 --- a/core/src/main/kotlin/diary/service/DiaryService.kt +++ b/core/src/main/kotlin/diary/service/DiaryService.kt @@ -2,6 +2,7 @@ package com.wafflestudio.snutt.diary.service import com.wafflestudio.snutt.common.enums.Semester import com.wafflestudio.snutt.common.exception.DiaryDailyClassTypeNotFoundException +import com.wafflestudio.snutt.common.exception.DiaryQuestionInvalidException import com.wafflestudio.snutt.common.exception.DiaryQuestionNotFoundException import com.wafflestudio.snutt.common.exception.DiarySubmissionNotFoundException import com.wafflestudio.snutt.common.exception.LectureNotFoundException @@ -206,6 +207,9 @@ class DiaryServiceImpl( if (targetDailyClassTypeIds.size != request.targetDailyClassTypes.size) { throw DiaryDailyClassTypeNotFoundException } + if (request.answers.size != request.shortAnswers.size) { + throw DiaryQuestionInvalidException + } val question = DiaryQuestion( answers = request.answers, From daa9d84355e583a9f7ee1bf1b362e0a5f7abc843 Mon Sep 17 00:00:00 2001 From: Chanyeong Lim Date: Mon, 16 Mar 2026 16:38:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?errorCode=20=EC=A4=91=EB=B3=B5=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/kotlin/common/exception/ErrorType.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/kotlin/common/exception/ErrorType.kt b/core/src/main/kotlin/common/exception/ErrorType.kt index 281499e6..0a15637f 100644 --- a/core/src/main/kotlin/common/exception/ErrorType.kt +++ b/core/src/main/kotlin/common/exception/ErrorType.kt @@ -65,13 +65,13 @@ enum class ErrorType( NOT_PUBLISHED_THEME(HttpStatus.BAD_REQUEST, 40022, "공유한 테마가 아닙니다", "공유한 테마가 아닙니다"), PUBLISHED_THEME_DELETE_ERROR(HttpStatus.BAD_REQUEST, 40023, "테마마켓에서 테마를 내린 뒤 다시 시도해주세요", "테마마켓에서 테마를 내린 뒤 다시 시도해주세요"), TIMETABLE_LECTURE_REMINDER_INVALID_TIME(HttpStatus.BAD_REQUEST, 40024, "리마인더는 시간이 설정된 강의에만 등록할 수 있어요", "리마인더는 시간이 설정된 강의에만 등록할 수 있어요"), - DIARY_QUESTION_INVALID(HttpStatus.BAD_REQUEST, 40025, "강의 일기장 질문이 유효하지 않습니다", "강의 일기장 질문이 유효하지 않습니다"), VACANCY_NOTIFICATION_TEMPORARILY_UNAVAILABLE( HttpStatus.BAD_REQUEST, 40025, "현재 일시 중단된 기능입니다. 자세한 내용은 알림을 참고해 주세요.", "현재 일시 중단된 기능입니다. 자세한 내용은 알림을 참고해 주세요.", ), + DIARY_QUESTION_INVALID(HttpStatus.BAD_REQUEST, 40026, "강의 일기장 질문이 유효하지 않습니다", "강의 일기장 질문이 유효하지 않습니다"), SOCIAL_CONNECT_FAIL(HttpStatus.UNAUTHORIZED, 40100, "소셜 로그인에 실패했습니다", "소셜 로그인에 실패했습니다"), INVALID_APPLE_LOGIN_TOKEN(HttpStatus.UNAUTHORIZED, 40101, "유효하지 않은 애플 로그인 토큰입니다", "소셜 로그인에 실패했습니다"),