Skip to content

Commit

Permalink
fix: User응답오류
Browse files Browse the repository at this point in the history
  • Loading branch information
SangWoon123 committed Nov 18, 2024
1 parent c2edc87 commit ea706df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import com.tukorea.planding.global.oauth.details.Role;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import lombok.Builder;
import lombok.Getter;
import lombok.*;

@Builder
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class UserResponse {
private Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public User(String email, String profileImage, String username, Role role, Socia
this.fcmToken = fcmToken;
}

public static User fromModel(UserDomain userDomain){
public static User fromModel(UserDomain userDomain) {
return User.builder()
.socialType(userDomain.getSocialType())
.socialId(userDomain.getSocialId())
Expand All @@ -79,7 +79,7 @@ public static User fromModel(UserDomain userDomain){
.build();
}

public UserDomain toModel(){
public UserDomain toModel() {
return UserDomain.builder()
.id(id)
.email(email)
Expand All @@ -90,6 +90,7 @@ public UserDomain toModel(){
.socialType(socialType)
.fcmToken(fcmToken)
.alarm(alarm)
.role(role)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public UserDomain getUserByUserCode(String userCode) {
}

// 유저 정보를 조회하는 메서드에 캐싱을 적용
@Cacheable(value = "userInfoCache", key = "#userCode")
@Cacheable(value = "userResponseCache", key = "#userCode")
public UserResponse getUserInfo(String userCode) {
UserDomain user = getUserByUserCode(userCode);
return UserResponse.toResponse(user);
Expand Down

0 comments on commit ea706df

Please sign in to comment.