[#56] 예약 & 결제 프로세스 및 패키지 구조 재정의 #57

Merged
pricelees merged 45 commits from refactor/#56 into main 2025-10-09 09:33:29 +00:00
Showing only changes of commit 979623a670 - Show all commits

View File

@ -30,7 +30,7 @@ class GlobalExceptionHandler(
val httpStatus: HttpStatus = errorCode.httpStatus val httpStatus: HttpStatus = errorCode.httpStatus
val errorResponse = CommonErrorResponse(errorCode) val errorResponse = CommonErrorResponse(errorCode)
logException(servletRequest, httpStatus, errorResponse, e) log.info { convertExceptionLogMessage(servletRequest, httpStatus, errorResponse, e) }
return ResponseEntity return ResponseEntity
.status(httpStatus.value()) .status(httpStatus.value())
@ -56,7 +56,7 @@ class GlobalExceptionHandler(
val httpStatus: HttpStatus = errorCode.httpStatus val httpStatus: HttpStatus = errorCode.httpStatus
val errorResponse = CommonErrorResponse(errorCode) val errorResponse = CommonErrorResponse(errorCode)
logException(servletRequest, httpStatus, errorResponse, e) log.warn { convertExceptionLogMessage(servletRequest, httpStatus, errorResponse, e) }
return ResponseEntity return ResponseEntity
.status(httpStatus.value()) .status(httpStatus.value())
@ -74,28 +74,26 @@ class GlobalExceptionHandler(
val httpStatus: HttpStatus = errorCode.httpStatus val httpStatus: HttpStatus = errorCode.httpStatus
val errorResponse = CommonErrorResponse(errorCode) val errorResponse = CommonErrorResponse(errorCode)
logException(servletRequest, httpStatus, errorResponse, e) log.warn { convertExceptionLogMessage(servletRequest, httpStatus, errorResponse, e) }
return ResponseEntity return ResponseEntity
.status(httpStatus.value()) .status(httpStatus.value())
.body(errorResponse) .body(errorResponse)
} }
private fun logException( private fun convertExceptionLogMessage(
servletRequest: HttpServletRequest, servletRequest: HttpServletRequest,
httpStatus: HttpStatus, httpStatus: HttpStatus,
errorResponse: CommonErrorResponse, errorResponse: CommonErrorResponse,
exception: Exception exception: Exception
) { ): String {
val actualException: Exception? = if (errorResponse.message == exception.message) null else exception val actualException: Exception? = if (errorResponse.message == exception.message) null else exception
val logMessage = messageConverter.convertToErrorResponseMessage( return messageConverter.convertToErrorResponseMessage(
servletRequest = servletRequest, servletRequest = servletRequest,
httpStatus = httpStatus, httpStatus = httpStatus,
responseBody = errorResponse, responseBody = errorResponse,
exception = actualException exception = actualException
) )
log.warn { logMessage }
} }
} }