From c1cb8cfde0fea11cc60efe7a7754460c09f8991d Mon Sep 17 00:00:00 2001 From: dunowljj Date: Thu, 23 Nov 2023 01:25:41 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20:=20DIG-76=20Value=20=EA=B0=92=20?= =?UTF-8?q?=EC=A3=BC=EC=9E=85=20=EB=AA=BB=ED=95=98=EB=8A=94=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EC=9E=98=EB=AA=BB?= =?UTF-8?q?=EB=90=9C=20=EC=83=81=EC=88=98=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 - LoginResponse가 빈으로 등록되지 않아서 Value 어노테이션이 동작 안하고 있었다. - NOT_ALREADY_JOINED 잘못된 값 수정 --- .../daitgym/user/constants/UserConstants.java | 26 +++++++++++++++++++ .../user/dto/response/LoginResponse.java | 24 +++-------------- .../daitgym/user/service/AuthService.java | 1 + 3 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/ogjg/daitgym/user/constants/UserConstants.java diff --git a/src/main/java/com/ogjg/daitgym/user/constants/UserConstants.java b/src/main/java/com/ogjg/daitgym/user/constants/UserConstants.java new file mode 100644 index 00000000..3218be5f --- /dev/null +++ b/src/main/java/com/ogjg/daitgym/user/constants/UserConstants.java @@ -0,0 +1,26 @@ +package com.ogjg.daitgym.user.constants; + +import com.ogjg.daitgym.domain.ExerciseSplit; +import jakarta.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class UserConstants { + public static final String DEFAULT_HEALTH_CLUB_NAME = ""; + @Value("${cloud.aws.default.profile-img}") + public String awsDefaultUrlTemp; + public static String AWS_DEFAULT_PROFILE_IMG_URL; + public static final String DEFAULT_INTRODUCTION = DEFAULT_HEALTH_CLUB_NAME; + public static final String DEFAULT_PREFERRED_SPLIT = ExerciseSplit.ONE_DAY.getTitle(); + + public static final boolean ALREADY_JOINED = true; + public static final boolean NOT_ALREADY_JOINED = false; + public static final boolean DELETED = true; + public static final boolean NOT_DELETED = false; + + @PostConstruct + public void setUrl() { + AWS_DEFAULT_PROFILE_IMG_URL = awsDefaultUrlTemp; + } +} diff --git a/src/main/java/com/ogjg/daitgym/user/dto/response/LoginResponse.java b/src/main/java/com/ogjg/daitgym/user/dto/response/LoginResponse.java index 018540ec..8c5cc2bd 100644 --- a/src/main/java/com/ogjg/daitgym/user/dto/response/LoginResponse.java +++ b/src/main/java/com/ogjg/daitgym/user/dto/response/LoginResponse.java @@ -1,30 +1,19 @@ package com.ogjg.daitgym.user.dto.response; -import com.ogjg.daitgym.domain.ExerciseSplit; import com.ogjg.daitgym.domain.Role; import com.ogjg.daitgym.domain.User; -import jakarta.annotation.PostConstruct; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import static com.ogjg.daitgym.user.constants.UserConstants.*; @Getter @NoArgsConstructor +@Component public class LoginResponse { - public static final String DEFAULT_HEALTH_CLUB_NAME = ""; - - @Value("${cloud.aws.default.profile-img}") - public String awsDefaultUrlTemp; - public static String AWS_DEFAULT_PROFILE_IMG_URL; - public static final String DEFAULT_INTRODUCTION = DEFAULT_HEALTH_CLUB_NAME; - public static final String DEFAULT_PREFERRED_SPLIT = ExerciseSplit.ONE_DAY.getTitle(); - public static final boolean ALREADY_JOINED = true; - public static final boolean NOT_ALREADY_JOINED = true; - public static final boolean DELETED = true; - public static final boolean NOT_DELETED = false; - private boolean isAlreadyJoined; private boolean isDeleted; @@ -41,11 +30,6 @@ public class LoginResponse { private String role; - @PostConstruct - public void setUrl() { - AWS_DEFAULT_PROFILE_IMG_URL = awsDefaultUrlTemp; - } - @Builder public LoginResponse(String nickname, String userProfileImgUrl, String preferredSplit, String introduction, String healthClubName, boolean isAlreadyJoined, String role, boolean isDeleted) { this.nickname = nickname; diff --git a/src/main/java/com/ogjg/daitgym/user/service/AuthService.java b/src/main/java/com/ogjg/daitgym/user/service/AuthService.java index d4c25723..eeeda178 100644 --- a/src/main/java/com/ogjg/daitgym/user/service/AuthService.java +++ b/src/main/java/com/ogjg/daitgym/user/service/AuthService.java @@ -26,6 +26,7 @@ import java.util.UUID; import static com.ogjg.daitgym.config.security.jwt.util.JwtUtils.*; +import static com.ogjg.daitgym.user.constants.UserConstants.*; import static com.ogjg.daitgym.user.dto.response.LoginResponse.*; @Service