From 918987b4a555e8e0868acbf3ae227079054dae7b Mon Sep 17 00:00:00 2001 From: suyong Date: Tue, 20 Feb 2024 20:09:30 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=EC=95=A1=EC=84=B8=EC=8A=A4=20?= =?UTF-8?q?=ED=86=A0=ED=81=B0=20=EA=B0=92=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/ReviewZIP/global/jwt/JwtProvider.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/example/ReviewZIP/global/jwt/JwtProvider.java b/src/main/java/com/example/ReviewZIP/global/jwt/JwtProvider.java index 1c61c5f..fdcfbc0 100644 --- a/src/main/java/com/example/ReviewZIP/global/jwt/JwtProvider.java +++ b/src/main/java/com/example/ReviewZIP/global/jwt/JwtProvider.java @@ -3,6 +3,7 @@ import com.example.ReviewZIP.domain.token.dto.response.TokenDto; import com.example.ReviewZIP.domain.user.Users; import com.example.ReviewZIP.global.response.code.resultCode.ErrorStatus; +import com.example.ReviewZIP.global.response.exception.handler.GeneralHandler; import com.example.ReviewZIP.global.response.exception.handler.UsersHandler; import io.jsonwebtoken.*; import io.jsonwebtoken.io.Decoders; @@ -30,7 +31,7 @@ @Slf4j @ConfigurationProperties("jwt") public class JwtProvider { - private static final long ACCESS_TOKEN_EXPIRATION_TIME = 1000 * 60 * 60; + private static final long ACCESS_TOKEN_EXPIRATION_TIME = 1000 * 60 * 60 * 24; private static final long REFRESH_TOKEN_EXPIRATION_TIME = 1000 * 24 * 60 * 60 * 7; private static final String AUTHORITIES_KEY = "auth"; @@ -108,14 +109,14 @@ public boolean validateToken(String token) { try { Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(token); return true; - } catch (io.jsonwebtoken.security.SecurityException | MalformedJwtException e) { - throw new UsersHandler(ErrorStatus.INVALID_ACCESS_TOKEN); } catch (ExpiredJwtException e) { - throw new UsersHandler(ErrorStatus.EXPIRED_MEMBER_TOKEN); + throw new GeneralHandler(ErrorStatus.EXPIRED_JWT_EXCEPTION); + } catch (io.jsonwebtoken.security.SecurityException | MalformedJwtException e) { + throw new GeneralHandler(ErrorStatus.INVALID_ACCESS_TOKEN); } catch (UnsupportedJwtException e) { - throw new UsersHandler(ErrorStatus.UNSUPPORTED_TOKEN); + throw new GeneralHandler(ErrorStatus.UNSUPPORTED_TOKEN); } catch (IllegalArgumentException e) { - throw new UsersHandler(ErrorStatus.ILLEGAL_ARGUMENT_TOKEN); + throw new GeneralHandler(ErrorStatus.ILLEGAL_ARGUMENT_TOKEN); } } From 225ae55dac7704c89b1b396c8423200932d33e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=9C=EC=88=98?= Date: Tue, 20 Feb 2024 23:44:45 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20Stores=20nullable=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/example/ReviewZIP/domain/store/Stores.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/com/example/ReviewZIP/domain/store/Stores.java b/src/main/java/com/example/ReviewZIP/domain/store/Stores.java index 747f84b..960e3b0 100644 --- a/src/main/java/com/example/ReviewZIP/domain/store/Stores.java +++ b/src/main/java/com/example/ReviewZIP/domain/store/Stores.java @@ -20,13 +20,10 @@ public class Stores extends BaseEntity { @Column(name = "id") private Long id; - @Column(nullable = false) private String name; - @Column(nullable = false) private String address_name; - @Column(nullable = false) private String road_address_name; @Column(nullable = false)