Skip to content

Commit

Permalink
Merge pull request #225 from team-winey/fix/#224
Browse files Browse the repository at this point in the history
[Fix] 마이페이지 API 구조 변경
  • Loading branch information
alpha-kwhn authored Feb 5, 2024
2 parents 9bf6fa8 + e69f26a commit 372d22c
Showing 1 changed file with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,27 @@
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class UserResponseDto {

private Long userId;
private String nickname;
private String userLevel;
private Boolean fcmIsAllowed;
private Long accumulatedAmount;
private Long amountSavedHundredDays;
private Long amountSavedTwoWeeks;
private Long amountSpentTwoWeeks;
private UserData userData;

@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public static class UserData {
private Long userId;
private String nickname;
private String userLevel;
private Boolean fcmIsAllowed;
private Long accumulatedAmount;
private Long amountSavedHundredDays;
private Long amountSavedTwoWeeks;
private Long amountSpentTwoWeeks;
}

public static UserResponseDto of(Long userId, String nickname, String userLevel,
Boolean fcmIsAllowed, Long accumulatedAmount, Long amountSavedHundredDays, Long amountSavedTwoWeeks,
Long amountSpentTwoWeeks) {
return new UserResponseDto(userId, nickname, userLevel, fcmIsAllowed, accumulatedAmount,
amountSavedHundredDays, amountSavedTwoWeeks, amountSpentTwoWeeks);
UserData userData = new UserData(userId, nickname, userLevel, fcmIsAllowed, accumulatedAmount,
amountSavedHundredDays, amountSavedTwoWeeks, amountSpentTwoWeeks);
return new UserResponseDto(userData);
}
}

0 comments on commit 372d22c

Please sign in to comment.