diff --git a/src/main/java/com/groom/swipo/domain/point/dto/Response/PointHomeResponse.java b/src/main/java/com/groom/swipo/domain/point/dto/Response/PointHomeResponse.java index a0fc12e..b779df3 100644 --- a/src/main/java/com/groom/swipo/domain/point/dto/Response/PointHomeResponse.java +++ b/src/main/java/com/groom/swipo/domain/point/dto/Response/PointHomeResponse.java @@ -10,13 +10,16 @@ @Builder public record PointHomeResponse( + String userName, Integer balance, // 페이잔액 Integer totalCards, //사용자가 보유한 모든 지역 카드 수 List cards, List paylistInfos ) { - public static PointHomeResponse of(Pay pay, Integer totalCards, List cards, List paylistInfos){ + public static PointHomeResponse of(String userName, Pay pay, Integer totalCards, List cards, + List paylistInfos) { return PointHomeResponse.builder() + .userName(userName) .balance(pay.getTotalPay()) .totalCards(totalCards) .cards(cards) diff --git a/src/main/java/com/groom/swipo/domain/point/service/PointService.java b/src/main/java/com/groom/swipo/domain/point/service/PointService.java index 1d26626..d7f07bf 100644 --- a/src/main/java/com/groom/swipo/domain/point/service/PointService.java +++ b/src/main/java/com/groom/swipo/domain/point/service/PointService.java @@ -69,7 +69,7 @@ public PointHomeResponse getHome(Principal principal) { .map(paylist -> PaylistInfo.of(paylist, paylist.getStore())) .toList(); - return PointHomeResponse.of(pay, cardInfos.size(), cardInfos, paylistInfos); + return PointHomeResponse.of(user.getName(), pay, cardInfos.size(), cardInfos, paylistInfos); } @Transactional @@ -154,7 +154,7 @@ public PointTransferInfoResponse getPointTransferInfo(Principal principal) { .map(CardInfo::from) .toList(); - return PointTransferInfoResponse.of(cards.size(),cardInfos); + return PointTransferInfoResponse.of(cards.size(), cardInfos); } // 포인트 이전 @@ -170,7 +170,7 @@ public PointTransferResponse pointTransfer(PointTransferRequest request, Princip //해당 유저가 가진 카드가 맞는지 검증 if (!Objects.equals(user.getId(), toCard.getUser().getId()) & !Objects.equals(user.getId(), - toCard.getUser().getId())){ + toCard.getUser().getId())) { throw new CardNotFoundException("해당 유저가 보유한 카드가 아닙니다"); }