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