diff --git a/src/main/java/com/umc/TheGoods/config/springSecurity/SpringSecurityConfig.java b/src/main/java/com/umc/TheGoods/config/springSecurity/SpringSecurityConfig.java index 77e57cc..67cd2d6 100644 --- a/src/main/java/com/umc/TheGoods/config/springSecurity/SpringSecurityConfig.java +++ b/src/main/java/com/umc/TheGoods/config/springSecurity/SpringSecurityConfig.java @@ -26,7 +26,6 @@ public class SpringSecurityConfig { - private final CustomAccessDeniedHandler accessDeniedHandler; private final CustomAuthenticationEntryPoint authenticationEntryPoint; private final JwtAuthenticationExceptionHandler exceptionFilter; @@ -36,8 +35,9 @@ public class SpringSecurityConfig { private String secretKey; private final UrlBasedCorsConfigurationSource corsConfigurationSource; + @Bean - public WebSecurityCustomizer webSecurityCustomizer(){ + public WebSecurityCustomizer webSecurityCustomizer() { return (web) -> web.ignoring() .antMatchers( "/favicon.ico", @@ -48,13 +48,16 @@ public WebSecurityCustomizer webSecurityCustomizer(){ "/swagger-resources/**", "/v3/api-docs/**", "/api/members/login", "/api/members/token/regenerate", "/api/members/join", - "/api/members/email/auth","/api/members/email/auth/verify","/api/members/email/duplicate", - "/api/members/kakao/callback","/api/members/naver/callback", "/api/members/nickname/duplicate", - "/api/members/password/update","/api/members/phone/auth","/api/members/phone/auth/**", - "/api/item/today", "/api/item/topsale","/api/item/steady", "/api/count/tags/item", - "/api/delivery-date/item" ,"/api/item/main", "/api/item/{itemId}/related" ,"/api/order/api/nologin/order" + "/api/members/email/auth", "/api/members/email/auth/verify", "/api/members/email/duplicate", + "/api/members/kakao/callback", "/api/members/naver/callback", "/api/members/nickname/duplicate", + "/api/members/password/update", "/api/members/phone/auth", "/api/members/phone/auth/**", + "/api/item/today", "/api/item/topsale", "/api/item/steady", "/api/count/tags/item", + "/api/delivery-date/item", "/api/item/main", "/api/item/{itemId}/related", "/api/order/api/nologin/order", + "/api/seller/item/{itemId}", + "/api/setItemData", "/api/search/item" ); } + @Bean public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception { diff --git a/src/main/java/com/umc/TheGoods/test/TestController.java b/src/main/java/com/umc/TheGoods/test/TestController.java index aff155d..b1bbcba 100644 --- a/src/main/java/com/umc/TheGoods/test/TestController.java +++ b/src/main/java/com/umc/TheGoods/test/TestController.java @@ -36,8 +36,8 @@ public class TestController { public ApiResponse setItemData( @RequestPart(value = "request") @Valid TestRequestDTO.setItemDTO request, @RequestPart(value = "itemThumbnail") MultipartFile itemThumbnail, - @RequestPart(value = "itemImgList", required = false) List itemImgList, - @RequestPart(value = "sellerProfile") MultipartFile sellerProfile + @RequestPart(value = "itemImgList", required = false) List itemImgList + //@RequestPart(value = "sellerProfile") MultipartFile sellerProfile ) { log.info("=========================== 회원 찾기 시작 ======================="); @@ -52,18 +52,19 @@ public ApiResponse setItemData( termAgreeList.add(true); termAgreeList.add(true); termAgreeList.add(true); + termAgreeList.add(true); // 선호 카테고리 랜덤 설정 List memberCategoryList = new ArrayList<>(); long leftLimit = 1L; - long rightLimit = 6L; + long rightLimit = 4L; long generatedLong = leftLimit + (long) (Math.random() * (rightLimit - leftLimit)); memberCategoryList.add(generatedLong); // 회원 가입 TestRequestDTO.setMemberDTO sellerDTO = new TestRequestDTO.setMemberDTO(request.sellerName, request.itemUuid, termAgreeList, memberCategoryList); - seller = testCommandService.addMember(sellerDTO, sellerProfile); + seller = testCommandService.addMember(sellerDTO); } else { log.info("=========================== 닉네임으로 회원 찾음 ================================"); @@ -97,8 +98,8 @@ public String setTestData() { List termAgreeList = new ArrayList<>(); termAgreeList.add(true); - MemberRequestDTO.JoinDTO joinBuyerDTO = new MemberRequestDTO.JoinDTO("구매자 테스트 계정","테스트", "12345678", "test@gmail.com", date, "01012345678", Gender.MALE, termAgreeList); - MemberRequestDTO.JoinDTO noLoginUserDTO = new MemberRequestDTO.JoinDTO("no_login_user","비회원", "12345678", "nologinuser@gmail.com", date, "01087654321", Gender.MALE, termAgreeList); + MemberRequestDTO.JoinDTO joinBuyerDTO = new MemberRequestDTO.JoinDTO("구매자 테스트 계정", "테스트", "12345678", "test@gmail.com", date, "01012345678", Gender.MALE, termAgreeList); + MemberRequestDTO.JoinDTO noLoginUserDTO = new MemberRequestDTO.JoinDTO("no_login_user", "비회원", "12345678", "nologinuser@gmail.com", date, "01087654321", Gender.MALE, termAgreeList); memberCommandService.join(joinBuyerDTO); diff --git a/src/main/java/com/umc/TheGoods/test/TestConverter.java b/src/main/java/com/umc/TheGoods/test/TestConverter.java index 19a28c6..3b192de 100644 --- a/src/main/java/com/umc/TheGoods/test/TestConverter.java +++ b/src/main/java/com/umc/TheGoods/test/TestConverter.java @@ -26,7 +26,7 @@ public static Member toTestMember(TestRequestDTO.setMemberDTO request, BCryptPas return Member.builder() .nickname(request.getNickname()) .password(encoder.encode("12345678")) - .email(request.getUuid() + "@gmail.com") + .email(request.getNickname() + "@gmail.com") .birthday(date) .gender(Gender.FEMALE) .phone("01012345678") diff --git a/src/main/java/com/umc/TheGoods/test/service/TestCommandService.java b/src/main/java/com/umc/TheGoods/test/service/TestCommandService.java index 29904f8..5bf882b 100644 --- a/src/main/java/com/umc/TheGoods/test/service/TestCommandService.java +++ b/src/main/java/com/umc/TheGoods/test/service/TestCommandService.java @@ -9,7 +9,7 @@ public interface TestCommandService { - Member addMember(TestRequestDTO.setMemberDTO request, MultipartFile multipartFile); + Member addMember(TestRequestDTO.setMemberDTO request); Item addItem(Member member, TestRequestDTO.setItemDTO request, MultipartFile itemThumbnail, List itemImgList); } diff --git a/src/main/java/com/umc/TheGoods/test/service/TestCommandServiceImpl.java b/src/main/java/com/umc/TheGoods/test/service/TestCommandServiceImpl.java index 2b1a04a..d569551 100644 --- a/src/main/java/com/umc/TheGoods/test/service/TestCommandServiceImpl.java +++ b/src/main/java/com/umc/TheGoods/test/service/TestCommandServiceImpl.java @@ -5,7 +5,6 @@ import com.umc.TheGoods.converter.item.ItemOptionConverter; import com.umc.TheGoods.converter.member.MemberConverter; import com.umc.TheGoods.domain.images.ItemImg; -import com.umc.TheGoods.domain.images.ProfileImg; import com.umc.TheGoods.domain.item.Category; import com.umc.TheGoods.domain.item.Item; import com.umc.TheGoods.domain.item.ItemOption; @@ -57,7 +56,7 @@ public class TestCommandServiceImpl implements TestCommandService { @Override - public Member addMember(TestRequestDTO.setMemberDTO request, MultipartFile multipartFile) { + public Member addMember(TestRequestDTO.setMemberDTO request) { // userName 중복 체크 memberRepository.findByNickname(request.getNickname()) .ifPresent(user -> { @@ -68,7 +67,6 @@ public Member addMember(TestRequestDTO.setMemberDTO request, MultipartFile multi //저장 Member member = TestConverter.toTestMember(request, encoder); - // 약관동의 저장 로직 HashMap termMap = new HashMap<>(); for (int i = 0; i < request.getMemberTerm().size(); i++) { @@ -81,12 +79,6 @@ public Member addMember(TestRequestDTO.setMemberDTO request, MultipartFile multi memberTerm.setMember(member); }); - String profileUrl = utilService.uploadS3Img("member", multipartFile); - ProfileImg profileImg = TestConverter.toProfileImg(profileUrl); - profileImg.setMember(member); - - profileImgRepository.save(profileImg); - memberRepository.save(member); return member; }