diff --git a/build.gradle.kts b/build.gradle.kts index 72dd2c3..530856f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,6 +31,7 @@ dependencies { testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("io.projectreactor:reactor-test") testRuntimeOnly("org.junit.platform:junit-platform-launcher") + implementation("org.springframework.boot:spring-boot-starter-validation") } tasks.withType { diff --git a/src/main/kotlin/com/soon/common/application/util/coroutines/GlobalCoroutineExceptionHandler.kt b/src/main/kotlin/com/soon/common/application/util/coroutines/GlobalCoroutineExceptionHandler.kt index e8e052a..7b60de8 100644 --- a/src/main/kotlin/com/soon/common/application/util/coroutines/GlobalCoroutineExceptionHandler.kt +++ b/src/main/kotlin/com/soon/common/application/util/coroutines/GlobalCoroutineExceptionHandler.kt @@ -6,16 +6,16 @@ import org.slf4j.LoggerFactory import kotlin.coroutines.AbstractCoroutineContextElement import kotlin.coroutines.CoroutineContext -object GlobalCoroutineExceptionHandler: AbstractCoroutineContextElement(CoroutineExceptionHandler), - CoroutineExceptionHandler{ - private val log = LoggerFactory.getLogger(javaClass) +object GlobalCoroutineExceptionHandler : AbstractCoroutineContextElement(CoroutineExceptionHandler), + CoroutineExceptionHandler { + private val log = LoggerFactory.getLogger(javaClass) - override fun handleException(context: CoroutineContext, exception: Throwable) { - val name = context[CoroutineName]?.name ?: "coroutuine" - val description=context[CoroutineDescription]?.description - log.error("$name failed. : $description", exception) - for (suppressed in exception.suppressed) { - log.error("$name has suppressed error",suppressed) - } + override fun handleException(context: CoroutineContext, exception: Throwable) { + val name = context[CoroutineName]?.name ?: "coroutine" + val description = context[CoroutineDescription]?.description + log.error("$name failed. : $description", exception) + for (suppressed in exception.suppressed) { + log.error("$name has suppressed error", suppressed) } + } } \ No newline at end of file diff --git a/src/main/kotlin/com/soon/common/presentation/handler/model/ItemCreateRequest.kt b/src/main/kotlin/com/soon/common/presentation/handler/model/ItemCreateRequest.kt index 0e18940..9017a82 100644 --- a/src/main/kotlin/com/soon/common/presentation/handler/model/ItemCreateRequest.kt +++ b/src/main/kotlin/com/soon/common/presentation/handler/model/ItemCreateRequest.kt @@ -1,10 +1,14 @@ package com.soon.common.presentation.handler.model import com.soon.common.application.model.ItemCreateCommand +import jakarta.validation.constraints.NotBlank data class ItemCreateRequest( + @field:NotBlank val title: String, + @field:NotBlank val description: String, + @field:NotBlank val thumbnail: String, ) { fun toCommand(serviceNo: Int) = ItemCreateCommand( diff --git a/src/test/http/common-game.http b/src/test/http/common-game.http index b335287..5bf27cb 100644 --- a/src/test/http/common-game.http +++ b/src/test/http/common-game.http @@ -4,7 +4,7 @@ Content-Type: application/json Service-Code:eyJubyI6MSwidGl0bGUiOiJ0aXRsZSJ9 { - "title": "title", + "title": "fdghjkgfhjgfhjgfhjg", "description": "description", "thumbnail": "thumbnail" }