diff --git a/src/main/kotlin/com/restaurant/be/common/exception/GlobalExceptionHandler.kt b/src/main/kotlin/com/restaurant/be/common/exception/GlobalExceptionHandler.kt index 27ffb87..bbeb3b9 100644 --- a/src/main/kotlin/com/restaurant/be/common/exception/GlobalExceptionHandler.kt +++ b/src/main/kotlin/com/restaurant/be/common/exception/GlobalExceptionHandler.kt @@ -12,17 +12,15 @@ import org.springframework.web.bind.annotation.ExceptionHandler import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestControllerAdvice import org.springframework.web.bind.support.WebExchangeBindException -import org.springframework.web.server.ServerWebExchange import org.springframework.web.server.ServerWebInputException import java.security.SignatureException @RestControllerAdvice class GlobalExceptionHandler { - @ExceptionHandler(ServerException::class) + @ExceptionHandler(value = [ServerException::class]) fun handleServerException( - ex: ServerException, - exchange: ServerWebExchange + ex: ServerException ): ResponseEntity { val response = CommonResponse.fail(ex.message, ex.javaClass.simpleName) return ResponseEntity(response, null, ex.code) @@ -31,8 +29,7 @@ class GlobalExceptionHandler { @ResponseStatus(HttpStatus.BAD_REQUEST) @ExceptionHandler(value = [ServerWebInputException::class]) fun methodArgumentNotValidException( - e: ServerWebInputException, - exchange: ServerWebExchange + e: ServerWebInputException ): CommonResponse { val data = if (e.cause?.cause is MissingKotlinParameterException) { @@ -51,8 +48,7 @@ class GlobalExceptionHandler { @ResponseStatus(HttpStatus.BAD_REQUEST) @ExceptionHandler(value = [WebExchangeBindException::class]) fun methodArgumentNotValidException( - e: WebExchangeBindException, - exchange: ServerWebExchange + e: WebExchangeBindException ): CommonResponse { val errors = mutableListOf() e.allErrors.forEach { @@ -84,8 +80,7 @@ class GlobalExceptionHandler { @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ExceptionHandler(value = [Exception::class]) fun exception( - e: Exception, - exchange: ServerWebExchange + e: Exception ): CommonResponse { val errorResponse = CommonResponse.fail(e.message, e::class.java.simpleName) return errorResponse diff --git a/src/main/kotlin/com/restaurant/be/user/domain/service/SignUpUserService.kt b/src/main/kotlin/com/restaurant/be/user/domain/service/SignUpUserService.kt index 94b4d45..74008aa 100644 --- a/src/main/kotlin/com/restaurant/be/user/domain/service/SignUpUserService.kt +++ b/src/main/kotlin/com/restaurant/be/user/domain/service/SignUpUserService.kt @@ -8,8 +8,8 @@ import com.restaurant.be.user.presentation.dto.SignUpUserRequest import com.restaurant.be.user.presentation.dto.SignUpUserResponse import com.restaurant.be.user.repository.UserRepository import org.springframework.stereotype.Service +import org.springframework.transaction.annotation.Transactional import java.util.concurrent.TimeUnit -import javax.transaction.Transactional @Service class SignUpUserService(