diff --git a/src/main/java/com/example/api/common/exception/CustomException.java b/src/main/java/com/example/api/common/exception/CustomException.java index df81536..adc8766 100644 --- a/src/main/java/com/example/api/common/exception/CustomException.java +++ b/src/main/java/com/example/api/common/exception/CustomException.java @@ -13,4 +13,4 @@ public CustomException(ErrorCodeEnum e) { this.errorCodeEnum = e; this.message = e.getMessage(); } -} +} \ No newline at end of file diff --git a/src/main/java/com/example/api/common/handler/CustomExceptionHandler.java b/src/main/java/com/example/api/common/handler/CustomExceptionHandler.java index 0645c3e..31f3d93 100644 --- a/src/main/java/com/example/api/common/handler/CustomExceptionHandler.java +++ b/src/main/java/com/example/api/common/handler/CustomExceptionHandler.java @@ -26,6 +26,7 @@ public ResponseEntity exceptionHandler(CustomException e) { public ResponseEntity methodArgumentNotValidException(MethodArgumentNotValidException e) { return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage()); } + @ExceptionHandler(ConstraintViolationException.class) public ResponseEntity constraintViolationException(ConstraintViolationException e) { log.error(e.getMessage()); diff --git a/src/main/java/com/example/api/common/utils/AuthenticationUtils.java b/src/main/java/com/example/api/common/utils/AuthenticationUtils.java index 123ac4d..11f25ad 100644 --- a/src/main/java/com/example/api/common/utils/AuthenticationUtils.java +++ b/src/main/java/com/example/api/common/utils/AuthenticationUtils.java @@ -1,20 +1,18 @@ package com.example.api.common.utils; import com.example.api.auth.domain.SecurityUser; -import com.example.api.user.domain.User; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; - /** * 이걸로 유저 정보를 가져오자 */ public class AuthenticationUtils { - public static SecurityUser getCurrentUserAuthentication(){ + public static SecurityUser getCurrentUserAuthentication() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - if (authentication != null && authentication.getPrincipal() instanceof SecurityUser){ + if (authentication != null && authentication.getPrincipal() instanceof SecurityUser) { return (SecurityUser) authentication.getPrincipal(); } return null; } -} +} \ No newline at end of file diff --git a/src/main/java/com/example/api/matching/dto/SaveMatchingDto.java b/src/main/java/com/example/api/matching/dto/SaveMatchingDto.java index 116cf3c..f0ded95 100644 --- a/src/main/java/com/example/api/matching/dto/SaveMatchingDto.java +++ b/src/main/java/com/example/api/matching/dto/SaveMatchingDto.java @@ -16,10 +16,6 @@ @NoArgsConstructor @AllArgsConstructor public class SaveMatchingDto { - - @NotNull - private UUID writerId; - @NotNull private MatchingTypeEnum type;