Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/src/main/kotlin/common/exception/ErrorType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ enum class ErrorType(
"현재 일시 중단된 기능입니다. 자세한 내용은 알림을 참고해 주세요.",
"현재 일시 중단된 기능입니다. 자세한 내용은 알림을 참고해 주세요.",
),
DIARY_QUESTION_INVALID(HttpStatus.BAD_REQUEST, 40026, "강의 일기장 질문이 유효하지 않습니다", "강의 일기장 질문이 유효하지 않습니다"),

SOCIAL_CONNECT_FAIL(HttpStatus.UNAUTHORIZED, 40100, "소셜 로그인에 실패했습니다", "소셜 로그인에 실패했습니다"),
INVALID_APPLE_LOGIN_TOKEN(HttpStatus.UNAUTHORIZED, 40101, "유효하지 않은 애플 로그인 토큰입니다", "소셜 로그인에 실패했습니다"),
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/kotlin/common/exception/SnuttException.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/kotlin/diary/service/DiaryService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading