From 5a75b4dddf73c9458a4e01de42621cb56c027af7 Mon Sep 17 00:00:00 2001 From: LeeHyeonJun Date: Thu, 21 Dec 2023 13:51:34 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=84=EC=9A=94=EC=97=86=EB=8A=94=20=C3=ACim?= =?UTF-8?q?port=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/auth/controller/AuthController.java | 3 --- .../auth/service/implementation/AuthServiceImpl.java | 7 +------ .../domain/boardgame/entity/ToBoardgameDto.java | 1 - .../weeingback/domain/consulting/entity/Consulting.java | 1 - .../entity/dto/response/ConsultingShowResponse.java | 1 - .../diary/entity/dto/request/DiaryListRequest.java | 1 - .../gapple/weeingback/domain/member/entity/Member.java | 2 -- .../domain/member/entity/NumberNameWithId.java | 9 --------- .../member/service/implmentation/MemberServiceImpl.java | 2 -- .../schedule/entity/dto/ScheduleCreateRequest.java | 1 - .../global/email/service/impl/EmailServiceImpl.java | 8 -------- .../com/gapple/weeingback/global/filter/JwtFilter.java | 2 -- .../com/gapple/weeingback/global/jwt/JwtProvider.java | 5 ----- 13 files changed, 1 insertion(+), 42 deletions(-) diff --git a/src/main/java/com/gapple/weeingback/domain/auth/controller/AuthController.java b/src/main/java/com/gapple/weeingback/domain/auth/controller/AuthController.java index c32a416..28e1ed1 100644 --- a/src/main/java/com/gapple/weeingback/domain/auth/controller/AuthController.java +++ b/src/main/java/com/gapple/weeingback/domain/auth/controller/AuthController.java @@ -4,11 +4,9 @@ import com.gapple.weeingback.domain.auth.service.AuthService; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -@Slf4j @RestController @RequestMapping("/api/auth") @RequiredArgsConstructor @@ -36,7 +34,6 @@ public ResponseEntity logout( public ResponseEntity refresh( @Valid @RequestHeader(name = "Authorization") String authorization, @Valid @RequestHeader(name = "refresh-token") String refresh){ - log.info("headerAccess={}, headerRefresh={}", authorization, refresh); return authService.refresh(authorization, refresh); } diff --git a/src/main/java/com/gapple/weeingback/domain/auth/service/implementation/AuthServiceImpl.java b/src/main/java/com/gapple/weeingback/domain/auth/service/implementation/AuthServiceImpl.java index ccf6f50..170aa11 100644 --- a/src/main/java/com/gapple/weeingback/domain/auth/service/implementation/AuthServiceImpl.java +++ b/src/main/java/com/gapple/weeingback/domain/auth/service/implementation/AuthServiceImpl.java @@ -10,14 +10,12 @@ import com.gapple.weeingback.global.exception.PasswordNotMatchException; import com.gapple.weeingback.global.jwt.JwtProvider; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; -import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; @@ -28,7 +26,6 @@ @Service @RequiredArgsConstructor -@Slf4j public class AuthServiceImpl implements AuthService { private final EmailService emailService; private final MemberRepository memberRepository; @@ -93,7 +90,7 @@ public ResponseEntity logout(String headerAuthorization, String headerRefresh if(refresh.equals(savedRefresh)){ stringValueOperations.set(refreshKey.toString(), ""); } else throw new RuntimeException(); - return new ResponseEntity<>(HttpStatus.OK); + return new ResponseEntity<>(HttpStatus.OK); } @Transactional(rollbackFor = RuntimeException.class) @@ -130,8 +127,6 @@ public ResponseEntity refresh(String headerAuthorization, St Authentication authentication = new UsernamePasswordAuthenticationToken(savedId.toString(), password, roles); - log.info(authentication.getAuthorities().toString()); - String newAccessToken = jwtProvider.generateAccessToken(authentication); return ResponseEntity.ok(new AuthLogoutResponse(newAccessToken, null, "ok")); diff --git a/src/main/java/com/gapple/weeingback/domain/boardgame/entity/ToBoardgameDto.java b/src/main/java/com/gapple/weeingback/domain/boardgame/entity/ToBoardgameDto.java index 2534025..0404ead 100644 --- a/src/main/java/com/gapple/weeingback/domain/boardgame/entity/ToBoardgameDto.java +++ b/src/main/java/com/gapple/weeingback/domain/boardgame/entity/ToBoardgameDto.java @@ -1,6 +1,5 @@ package com.gapple.weeingback.domain.boardgame.entity; -import com.gapple.weeingback.domain.member.entity.Member; import com.gapple.weeingback.domain.member.entity.NumberNameWithId; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/gapple/weeingback/domain/consulting/entity/Consulting.java b/src/main/java/com/gapple/weeingback/domain/consulting/entity/Consulting.java index 5faa177..f769187 100644 --- a/src/main/java/com/gapple/weeingback/domain/consulting/entity/Consulting.java +++ b/src/main/java/com/gapple/weeingback/domain/consulting/entity/Consulting.java @@ -1,6 +1,5 @@ package com.gapple.weeingback.domain.consulting.entity; -import com.gapple.weeingback.domain.member.entity.Member; import jakarta.persistence.*; import lombok.*; import org.hibernate.annotations.GenericGenerator; diff --git a/src/main/java/com/gapple/weeingback/domain/consulting/entity/dto/response/ConsultingShowResponse.java b/src/main/java/com/gapple/weeingback/domain/consulting/entity/dto/response/ConsultingShowResponse.java index 6353554..6a4b2ab 100644 --- a/src/main/java/com/gapple/weeingback/domain/consulting/entity/dto/response/ConsultingShowResponse.java +++ b/src/main/java/com/gapple/weeingback/domain/consulting/entity/dto/response/ConsultingShowResponse.java @@ -1,6 +1,5 @@ package com.gapple.weeingback.domain.consulting.entity.dto.response; -import com.gapple.weeingback.domain.consulting.entity.Consulting; import com.gapple.weeingback.domain.consulting.entity.ToConsultingResponse; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/src/main/java/com/gapple/weeingback/domain/diary/entity/dto/request/DiaryListRequest.java b/src/main/java/com/gapple/weeingback/domain/diary/entity/dto/request/DiaryListRequest.java index 9612032..1acd8e8 100644 --- a/src/main/java/com/gapple/weeingback/domain/diary/entity/dto/request/DiaryListRequest.java +++ b/src/main/java/com/gapple/weeingback/domain/diary/entity/dto/request/DiaryListRequest.java @@ -1,6 +1,5 @@ package com.gapple.weeingback.domain.diary.entity.dto.request; -import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/com/gapple/weeingback/domain/member/entity/Member.java b/src/main/java/com/gapple/weeingback/domain/member/entity/Member.java index 9e92592..9b20c0c 100644 --- a/src/main/java/com/gapple/weeingback/domain/member/entity/Member.java +++ b/src/main/java/com/gapple/weeingback/domain/member/entity/Member.java @@ -9,8 +9,6 @@ import org.hibernate.annotations.GenericGenerator; import org.springframework.security.core.GrantedAuthority; -import java.lang.reflect.Array; -import java.util.ArrayList; import java.util.List; import java.util.UUID; diff --git a/src/main/java/com/gapple/weeingback/domain/member/entity/NumberNameWithId.java b/src/main/java/com/gapple/weeingback/domain/member/entity/NumberNameWithId.java index 7495234..e148b69 100644 --- a/src/main/java/com/gapple/weeingback/domain/member/entity/NumberNameWithId.java +++ b/src/main/java/com/gapple/weeingback/domain/member/entity/NumberNameWithId.java @@ -1,15 +1,6 @@ package com.gapple.weeingback.domain.member.entity; -import com.gapple.weeingback.domain.boardgame.entity.Boardgame; -import com.gapple.weeingback.domain.consulting.entity.Consulting; -import com.gapple.weeingback.domain.diary.entity.Diary; -import jakarta.persistence.*; import lombok.*; -import org.hibernate.annotations.GenericGenerator; -import org.springframework.security.core.GrantedAuthority; - -import java.util.List; -import java.util.UUID; @Builder @Getter @Setter diff --git a/src/main/java/com/gapple/weeingback/domain/member/service/implmentation/MemberServiceImpl.java b/src/main/java/com/gapple/weeingback/domain/member/service/implmentation/MemberServiceImpl.java index a8b81ee..b98d318 100644 --- a/src/main/java/com/gapple/weeingback/domain/member/service/implmentation/MemberServiceImpl.java +++ b/src/main/java/com/gapple/weeingback/domain/member/service/implmentation/MemberServiceImpl.java @@ -1,6 +1,5 @@ package com.gapple.weeingback.domain.member.service.implmentation; -import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import com.gapple.weeingback.domain.member.service.MemberService; @@ -9,5 +8,4 @@ @Service @RequiredArgsConstructor -@Slf4j public class MemberServiceImpl implements MemberService {} \ No newline at end of file diff --git a/src/main/java/com/gapple/weeingback/domain/schedule/entity/dto/ScheduleCreateRequest.java b/src/main/java/com/gapple/weeingback/domain/schedule/entity/dto/ScheduleCreateRequest.java index 3b9f8dd..2cfc267 100644 --- a/src/main/java/com/gapple/weeingback/domain/schedule/entity/dto/ScheduleCreateRequest.java +++ b/src/main/java/com/gapple/weeingback/domain/schedule/entity/dto/ScheduleCreateRequest.java @@ -3,7 +3,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; @Getter @NoArgsConstructor diff --git a/src/main/java/com/gapple/weeingback/global/email/service/impl/EmailServiceImpl.java b/src/main/java/com/gapple/weeingback/global/email/service/impl/EmailServiceImpl.java index 30c5ef6..43ad3a4 100644 --- a/src/main/java/com/gapple/weeingback/global/email/service/impl/EmailServiceImpl.java +++ b/src/main/java/com/gapple/weeingback/global/email/service/impl/EmailServiceImpl.java @@ -3,19 +3,12 @@ import com.gapple.weeingback.global.email.service.EmailService; import jakarta.mail.internet.MimeMessage; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Service; -import org.springframework.web.util.HtmlUtils; import java.util.Random; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -@Slf4j @Service @RequiredArgsConstructor public class EmailServiceImpl implements EmailService { @@ -33,7 +26,6 @@ public String sendAuth(String to){ return authNumber; } catch (Exception e) { - log.info("fail"); throw new RuntimeException(e); } } diff --git a/src/main/java/com/gapple/weeingback/global/filter/JwtFilter.java b/src/main/java/com/gapple/weeingback/global/filter/JwtFilter.java index d544b1f..2704256 100644 --- a/src/main/java/com/gapple/weeingback/global/filter/JwtFilter.java +++ b/src/main/java/com/gapple/weeingback/global/filter/JwtFilter.java @@ -6,14 +6,12 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; import java.io.IOException; -@Slf4j @Component @RequiredArgsConstructor public class JwtFilter extends OncePerRequestFilter { diff --git a/src/main/java/com/gapple/weeingback/global/jwt/JwtProvider.java b/src/main/java/com/gapple/weeingback/global/jwt/JwtProvider.java index 45643a5..58926cf 100644 --- a/src/main/java/com/gapple/weeingback/global/jwt/JwtProvider.java +++ b/src/main/java/com/gapple/weeingback/global/jwt/JwtProvider.java @@ -1,21 +1,16 @@ package com.gapple.weeingback.global.jwt; - import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.security.Keys; - import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; - import org.springframework.security.core.GrantedAuthority; - import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.stereotype.Component; import java.util.*; import static org.springframework.security.core.authority.AuthorityUtils.createAuthorityList; @Component - @Slf4j public class JwtProvider { private final String secretKey; private final Long access;