diff --git a/src/main/java/umc/haruchi/converter/MemberConverter.java b/src/main/java/umc/haruchi/converter/MemberConverter.java index 696328b..f497938 100644 --- a/src/main/java/umc/haruchi/converter/MemberConverter.java +++ b/src/main/java/umc/haruchi/converter/MemberConverter.java @@ -20,6 +20,13 @@ public static Member toMember(MemberRequestDTO.MemberJoinDTO request) { public static MemberResponseDTO.MemberJoinResultDTO toJoinResultDTO(Member member) { return MemberResponseDTO.MemberJoinResultDTO.builder() .memberId(member.getId()) - .createdAt(LocalDateTime.now()).build(); + .createdAt(LocalDateTime.now()) + .build(); + } + + public static MemberResponseDTO.MemberSafeBoxResultDTO toSafeBoxResultDTO(Long safeBox) { + return MemberResponseDTO.MemberSafeBoxResultDTO.builder() + .safeBox(safeBox) + .build(); } } diff --git a/src/main/java/umc/haruchi/web/controller/MemberApiController.java b/src/main/java/umc/haruchi/web/controller/MemberApiController.java index adbcefb..15d43dd 100644 --- a/src/main/java/umc/haruchi/web/controller/MemberApiController.java +++ b/src/main/java/umc/haruchi/web/controller/MemberApiController.java @@ -150,7 +150,8 @@ public ApiResponse getMemberDetail(@Aut @GetMapping("/safebox") @Operation(summary = "회원 세이프박스 조회 API", description = "헤더에 있는 토큰으로 회원을 식별하고, 회원의 세이프박스 금액 조회하는 API") - public ApiResponse getMemberSafeBox(@AuthenticationPrincipal MemberDetail memberDetail) { - return ApiResponse.onSuccess(memberDetail.getMember().getSafeBox()); + public ApiResponse getMemberSafeBox(@AuthenticationPrincipal MemberDetail memberDetail) { + Long safeBox = memberDetail.getMember().getSafeBox(); + return ApiResponse.onSuccess(MemberConverter.toSafeBoxResultDTO(safeBox)); } } diff --git a/src/main/java/umc/haruchi/web/dto/MemberResponseDTO.java b/src/main/java/umc/haruchi/web/dto/MemberResponseDTO.java index 6a93b2c..a3de13b 100644 --- a/src/main/java/umc/haruchi/web/dto/MemberResponseDTO.java +++ b/src/main/java/umc/haruchi/web/dto/MemberResponseDTO.java @@ -51,4 +51,12 @@ public static class MemberDetailResultDTO { String email; String name; } + + @Builder + @Getter + @NoArgsConstructor + @AllArgsConstructor + public static class MemberSafeBoxResultDTO { + Long safeBox; + } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 53be1be..120892b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -26,7 +26,7 @@ spring: data: redis: - host: ${AWS_REDIS_HOST} #로컬로 실행할 때에는 로컬 Redis 서버로만 테스트 가능. 연동 x + host: localhost #${AWS_REDIS_HOST} #로컬로 실행할 때에는 로컬 Redis 서버로만 테스트 가능. 연동 x port: 6379 cache: