first commit

This commit is contained in:
2025-12-09 11:54:11 +09:00
commit f1ae6e3cb8
43 changed files with 1923 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package com.krt.flower.Flower.exception;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class ApiExceptionAdvice {
@ExceptionHandler({ApiException.class})
public ResponseEntity<ApiExceptionEntity> exceptionHandler(ApiException apiEx) {
return ResponseEntity
.status(apiEx.exceptionDto.getStatus())
.body(ApiExceptionEntity.builder()
.errorCode(apiEx.exceptionDto.getCode())
.errorMessage(apiEx.exceptionDto.getMessage())
.errorPoint(apiEx.exceptionDto.getErrorPoint())
.build());
}
@ExceptionHandler({TextException.class})
public ResponseEntity<TextExceptionEntity> exceptionHandler(TextException apiEx) {
return ResponseEntity
.status(apiEx.exceptionDto.getStatus())
.body(TextExceptionEntity.builder()
.errorCode(apiEx.exceptionDto.getCode())
.errorMessage(apiEx.exceptionDto.getMessage())
.build());
}
}