Skip to content

Commit

Permalink
필요없는 ìimport 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
11dlguswns committed Dec 21, 2023
1 parent 5bfcaf7 commit 5a75b4d
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -36,7 +34,6 @@ public ResponseEntity<?> logout(
public ResponseEntity<AuthLogoutResponse> 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,7 +26,6 @@

@Service
@RequiredArgsConstructor
@Slf4j
public class AuthServiceImpl implements AuthService {
private final EmailService emailService;
private final MemberRepository memberRepository;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -130,8 +127,6 @@ public ResponseEntity<AuthLogoutResponse> 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"));
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -9,5 +8,4 @@

@Service
@RequiredArgsConstructor
@Slf4j
public class MemberServiceImpl implements MemberService {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;

@Getter
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -33,7 +26,6 @@ public String sendAuth(String to){

return authNumber;
} catch (Exception e) {
log.info("fail");
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 5a75b4d

Please sign in to comment.