diff --git a/src/main/java/com/bio/bio_backend/domain/user/member/controller/MemberController.java b/src/main/java/com/bio/bio_backend/domain/user/member/controller/MemberController.java index e1fd8e3..7c6efb1 100644 --- a/src/main/java/com/bio/bio_backend/domain/user/member/controller/MemberController.java +++ b/src/main/java/com/bio/bio_backend/domain/user/member/controller/MemberController.java @@ -20,7 +20,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; -import com.bio.bio_backend.global.utils.ApiResponseCode; +import com.bio.bio_backend.global.constants.ApiResponseCode; @Tag(name = "Member", description = "회원 관련 API") @RestController @@ -39,7 +39,7 @@ public class MemberController { @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content(schema = @Schema(implementation = ApiResponseDto.class))), @ApiResponse(responseCode = "409", description = "중복된 사용자 정보", content = @Content(schema = @Schema(implementation = ApiResponseDto.class))) }) - @PostMapping + @PostMapping("/register") public ResponseEntity> createMember(@RequestBody @Valid CreateMemberRequestDto requestDto) { MemberDto member = memberMapper.toMemberDto(requestDto); MemberDto createdMember = memberService.createMember(member); diff --git a/src/main/java/com/bio/bio_backend/domain/user/member/exception/UserDuplicateException.java b/src/main/java/com/bio/bio_backend/domain/user/member/exception/UserDuplicateException.java deleted file mode 100644 index c399d48..0000000 --- a/src/main/java/com/bio/bio_backend/domain/user/member/exception/UserDuplicateException.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.bio.bio_backend.domain.user.member.exception; - -public class UserDuplicateException extends RuntimeException { - - public UserDuplicateException(String message) { - super(message); - } - - public UserDuplicateException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/src/main/java/com/bio/bio_backend/domain/user/member/service/MemberServiceImpl.java b/src/main/java/com/bio/bio_backend/domain/user/member/service/MemberServiceImpl.java index b40f0f4..673566f 100644 --- a/src/main/java/com/bio/bio_backend/domain/user/member/service/MemberServiceImpl.java +++ b/src/main/java/com/bio/bio_backend/domain/user/member/service/MemberServiceImpl.java @@ -5,9 +5,8 @@ import com.bio.bio_backend.domain.user.member.entity.Member; import com.bio.bio_backend.domain.user.member.enums.MemberRole; import com.bio.bio_backend.domain.user.member.mapper.MemberMapper; import com.bio.bio_backend.domain.user.member.repository.MemberRepository; -import com.bio.bio_backend.domain.user.member.exception.UserDuplicateException; import com.bio.bio_backend.global.exception.ApiException; -import com.bio.bio_backend.global.utils.ApiResponseCode; +import com.bio.bio_backend.global.constants.ApiResponseCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.userdetails.UserDetails; diff --git a/src/main/java/com/bio/bio_backend/global/utils/ApiResponseCode.java b/src/main/java/com/bio/bio_backend/global/constants/ApiResponseCode.java similarity index 98% rename from src/main/java/com/bio/bio_backend/global/utils/ApiResponseCode.java rename to src/main/java/com/bio/bio_backend/global/constants/ApiResponseCode.java index beb0035..be3c7b0 100644 --- a/src/main/java/com/bio/bio_backend/global/utils/ApiResponseCode.java +++ b/src/main/java/com/bio/bio_backend/global/constants/ApiResponseCode.java @@ -1,4 +1,4 @@ -package com.bio.bio_backend.global.utils; +package com.bio.bio_backend.global.constants; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/bio/bio_backend/global/dto/ApiResponseDto.java b/src/main/java/com/bio/bio_backend/global/dto/ApiResponseDto.java index 1d8e071..baebd96 100644 --- a/src/main/java/com/bio/bio_backend/global/dto/ApiResponseDto.java +++ b/src/main/java/com/bio/bio_backend/global/dto/ApiResponseDto.java @@ -3,7 +3,7 @@ package com.bio.bio_backend.global.dto; import com.fasterxml.jackson.annotation.JsonInclude; -import com.bio.bio_backend.global.utils.ApiResponseCode; +import com.bio.bio_backend.global.constants.ApiResponseCode; import lombok.Data; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/bio/bio_backend/global/exception/ApiException.java b/src/main/java/com/bio/bio_backend/global/exception/ApiException.java index d339468..c352375 100644 --- a/src/main/java/com/bio/bio_backend/global/exception/ApiException.java +++ b/src/main/java/com/bio/bio_backend/global/exception/ApiException.java @@ -1,7 +1,7 @@ package com.bio.bio_backend.global.exception; import lombok.Getter; -import com.bio.bio_backend.global.utils.ApiResponseCode; +import com.bio.bio_backend.global.constants.ApiResponseCode; @Getter public class ApiException extends RuntimeException { diff --git a/src/main/java/com/bio/bio_backend/global/exception/CustomAuthenticationFailureHandler.java b/src/main/java/com/bio/bio_backend/global/exception/CustomAuthenticationFailureHandler.java index 01c54f5..2cc9ceb 100644 --- a/src/main/java/com/bio/bio_backend/global/exception/CustomAuthenticationFailureHandler.java +++ b/src/main/java/com/bio/bio_backend/global/exception/CustomAuthenticationFailureHandler.java @@ -15,7 +15,7 @@ import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import com.bio.bio_backend.global.dto.ApiResponseDto; -import com.bio.bio_backend.global.utils.ApiResponseCode; +import com.bio.bio_backend.global.constants.ApiResponseCode; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/com/bio/bio_backend/global/exception/GlobalExceptionHandler.java b/src/main/java/com/bio/bio_backend/global/exception/GlobalExceptionHandler.java index 9707760..5cc592e 100644 --- a/src/main/java/com/bio/bio_backend/global/exception/GlobalExceptionHandler.java +++ b/src/main/java/com/bio/bio_backend/global/exception/GlobalExceptionHandler.java @@ -5,7 +5,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.MethodArgumentNotValidException; import com.bio.bio_backend.global.dto.ApiResponseDto; -import com.bio.bio_backend.global.utils.ApiResponseCode; +import com.bio.bio_backend.global.constants.ApiResponseCode; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/src/main/java/com/bio/bio_backend/global/exception/JwtAccessDeniedHandler.java b/src/main/java/com/bio/bio_backend/global/exception/JwtAccessDeniedHandler.java index bcb1a23..3056d84 100644 --- a/src/main/java/com/bio/bio_backend/global/exception/JwtAccessDeniedHandler.java +++ b/src/main/java/com/bio/bio_backend/global/exception/JwtAccessDeniedHandler.java @@ -15,7 +15,7 @@ import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import com.bio.bio_backend.global.dto.ApiResponseDto; -import com.bio.bio_backend.global.utils.ApiResponseCode; +import com.bio.bio_backend.global.constants.ApiResponseCode; @Component public class JwtAccessDeniedHandler implements AccessDeniedHandler { diff --git a/src/main/java/com/bio/bio_backend/global/security/JwtAuthenticationFilter.java b/src/main/java/com/bio/bio_backend/global/security/JwtAuthenticationFilter.java index 9a5caab..631bf5c 100644 --- a/src/main/java/com/bio/bio_backend/global/security/JwtAuthenticationFilter.java +++ b/src/main/java/com/bio/bio_backend/global/security/JwtAuthenticationFilter.java @@ -11,7 +11,7 @@ import com.bio.bio_backend.domain.user.member.dto.LoginRequestDto; import com.bio.bio_backend.domain.user.member.dto.LoginResponseDto; import com.bio.bio_backend.domain.user.member.dto.MemberDto; import com.bio.bio_backend.domain.user.member.service.MemberService; -import com.bio.bio_backend.global.utils.ApiResponseCode; +import com.bio.bio_backend.global.constants.ApiResponseCode; import com.bio.bio_backend.global.utils.JwtUtils; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; @@ -20,7 +20,6 @@ import org.springframework.core.env.Environment; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.authentication.AuthenticationServiceException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; @@ -31,7 +30,6 @@ import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import java.io.IOException; -import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.Objects; diff --git a/src/main/java/com/bio/bio_backend/global/security/JwtTokenFilter.java b/src/main/java/com/bio/bio_backend/global/security/JwtTokenFilter.java index 92afe3b..5680d36 100644 --- a/src/main/java/com/bio/bio_backend/global/security/JwtTokenFilter.java +++ b/src/main/java/com/bio/bio_backend/global/security/JwtTokenFilter.java @@ -1,10 +1,8 @@ package com.bio.bio_backend.global.security; import java.io.IOException; -import java.util.Arrays; import java.util.Objects; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.http.MediaType; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -22,7 +20,7 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import com.bio.bio_backend.global.dto.ApiResponseDto; import com.bio.bio_backend.domain.user.member.service.MemberService; -import com.bio.bio_backend.global.utils.ApiResponseCode; +import com.bio.bio_backend.global.constants.ApiResponseCode; import com.bio.bio_backend.global.utils.JwtUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j;