kmbin92_2025081302 #3

Merged
sohot8653 merged 5 commits from kmbin92_2025081302 into main 2025-08-15 00:54:15 +09:00
16 changed files with 260 additions and 247 deletions
Showing only changes of commit baab0352d5 - Show all commits

View File

@@ -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<ApiResponseDto<CreateMemberResponseDto>> createMember(@RequestBody @Valid CreateMemberRequestDto requestDto) {
MemberDto member = memberMapper.toMemberDto(requestDto);
MemberDto createdMember = memberService.createMember(member);

View File

@@ -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);
}
}

View File

@@ -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;

View File

@@ -1,4 +1,4 @@
package com.bio.bio_backend.global.utils;
package com.bio.bio_backend.global.constants;
import lombok.AllArgsConstructor;
import lombok.Getter;

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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;