Skip to content

Commit

Permalink
Fix : DIG-76 Value 값 주입 못하는 버그 수정 및 잘못된 상수값 수정
Browse files Browse the repository at this point in the history
- LoginResponse가 빈으로 등록되지 않아서 Value 어노테이션이 동작 안하고 있었다.
- NOT_ALREADY_JOINED 잘못된 값 수정
  • Loading branch information
dunowljj authored and Dongjin113 committed Nov 23, 2023
1 parent 8b957f7 commit c1cb8cf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 20 deletions.
26 changes: 26 additions & 0 deletions src/main/java/com/ogjg/daitgym/user/constants/UserConstants.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c1cb8cf

Please sign in to comment.