From 260c83f51330df4ad6f256b06ff5a2b7ea2f2294 Mon Sep 17 00:00:00 2001 From: kimjm9841 Date: Sat, 3 Feb 2024 15:25:36 +0900 Subject: [PATCH] =?UTF-8?q?rename:=20DTO=EB=AA=85=20=EA=B0=84=EB=9E=B5?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../off/feed/controller/FeedController.java | 20 +++++++++---------- .../off/feed/converter/FeedConverter.java | 4 ++-- .../domain/off/feed/dto/FeedResponseDTO.java | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/onnoff/onnoff/domain/off/feed/controller/FeedController.java b/src/main/java/com/onnoff/onnoff/domain/off/feed/controller/FeedController.java index 9c4769b..9b48027 100644 --- a/src/main/java/com/onnoff/onnoff/domain/off/feed/controller/FeedController.java +++ b/src/main/java/com/onnoff/onnoff/domain/off/feed/controller/FeedController.java @@ -22,37 +22,37 @@ public class FeedController { @PostMapping("/feeds") @Operation(summary = "워라벨 피드 추가 API", description = "새로운 워라벨 피드를 추가하는 API입니다.") - public ApiResponse addFeed(@RequestBody @Valid FeedRequestDTO.AddFeedDTO request) { + public ApiResponse addFeed(@RequestBody @Valid FeedRequestDTO.AddFeedDTO request) { Feed feed = feedService.addFeed(request); - return ApiResponse.onSuccess(FeedConverter.toFeedResultDTO(feed)); + return ApiResponse.onSuccess(FeedConverter.toFeedDTO(feed)); } @GetMapping("/feeds") @Operation(summary = "워라벨 피드 조회 API", description = "특정한 날짜의 워라벨 피드를 조회하는 API입니다. Query String으로 날짜를 입력해 주세요.") - public ApiResponse> getFeed(@RequestParam(name = "date") LocalDate date) { + public ApiResponse> getFeed(@RequestParam(name = "date") LocalDate date) { List feedList = feedService.getFeed(date); - return ApiResponse.onSuccess(feedList.stream().map(FeedConverter::toFeedResultDTO).toList()); + return ApiResponse.onSuccess(feedList.stream().map(FeedConverter::toFeedDTO).toList()); } @PatchMapping("/feeds/{feedId}") @Operation(summary = "워라벨 피드 수정 API", description = "워라벨 피드의 내용을 수정하는 API입니다.") - public ApiResponse modifyFeed(@PathVariable(name = "feedId") Long feedId, @RequestBody @Valid FeedRequestDTO.ModifyFeedDTO request) { + public ApiResponse modifyFeed(@PathVariable(name = "feedId") Long feedId, @RequestBody @Valid FeedRequestDTO.ModifyFeedDTO request) { Feed feed = feedService.modifyFeed(feedId, request); - return ApiResponse.onSuccess(FeedConverter.toFeedResultDTO(feed)); + return ApiResponse.onSuccess(FeedConverter.toFeedDTO(feed)); } @PatchMapping("/feeds/{feedId}/delay") @Operation(summary = "워라벨 피드 내일로 미루기 API", description = "워라벨 피드의 날짜를 현재 기준 내일로 변경하는 API입니다.") - public ApiResponse delayFeed(@PathVariable(name = "feedId") Long feedId) { + public ApiResponse delayFeed(@PathVariable(name = "feedId") Long feedId) { Feed feed = feedService.delayFeed(feedId); - return ApiResponse.onSuccess(FeedConverter.toFeedResultDTO(feed)); + return ApiResponse.onSuccess(FeedConverter.toFeedDTO(feed)); } @PatchMapping("/feeds/{feedId}/check") @Operation(summary = "워라벨 피드 체크 및 해제 API", description = "워라벨 피드를 체크하거나 체크 해제하는 API입니다.") - public ApiResponse checkFeed(@PathVariable(name = "feedId") Long feedId) { + public ApiResponse checkFeed(@PathVariable(name = "feedId") Long feedId) { Feed feed = feedService.checkFeed(feedId); - return ApiResponse.onSuccess(FeedConverter.toFeedResultDTO(feed)); + return ApiResponse.onSuccess(FeedConverter.toFeedDTO(feed)); } @DeleteMapping("/feeds/{feedId}") diff --git a/src/main/java/com/onnoff/onnoff/domain/off/feed/converter/FeedConverter.java b/src/main/java/com/onnoff/onnoff/domain/off/feed/converter/FeedConverter.java index 01fe0e6..4108ba2 100644 --- a/src/main/java/com/onnoff/onnoff/domain/off/feed/converter/FeedConverter.java +++ b/src/main/java/com/onnoff/onnoff/domain/off/feed/converter/FeedConverter.java @@ -16,8 +16,8 @@ public static Feed toFeed(FeedRequestDTO.AddFeedDTO request, User user) { .build(); } - public static FeedResponseDTO.FeedResultDTO toFeedResultDTO(Feed feed) { - return FeedResponseDTO.FeedResultDTO.builder() + public static FeedResponseDTO.FeedDTO toFeedDTO(Feed feed) { + return FeedResponseDTO.FeedDTO.builder() .feedId(feed.getId()) .date(feed.getDate()) .content(feed.getContent()) diff --git a/src/main/java/com/onnoff/onnoff/domain/off/feed/dto/FeedResponseDTO.java b/src/main/java/com/onnoff/onnoff/domain/off/feed/dto/FeedResponseDTO.java index 396effb..a785581 100644 --- a/src/main/java/com/onnoff/onnoff/domain/off/feed/dto/FeedResponseDTO.java +++ b/src/main/java/com/onnoff/onnoff/domain/off/feed/dto/FeedResponseDTO.java @@ -13,7 +13,7 @@ public class FeedResponseDTO { @Getter @NoArgsConstructor @AllArgsConstructor - public static class FeedResultDTO { + public static class FeedDTO { Long feedId; LocalDate date; String content;