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 32b66de..c44bf19 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 @@ -28,8 +28,8 @@ public ApiResponse addFeed(@RequestBody @Valid Fe } @GetMapping("/feeds") - @Operation(summary = "워라벨 피드 조회 API",description = "특정한 날짜의 워라벨 피드를 조회하는 API입니다. Query String으로 날짜를 입력해 주세요.") - public ApiResponse> getFeed(@RequestParam(name = "date") LocalDate date){ + @Operation(summary = "워라벨 피드 조회 API", description = "특정한 날짜의 워라벨 피드를 조회하는 API입니다. Query String으로 날짜를 입력해 주세요.") + public ApiResponse> getFeed(@RequestParam(name = "date") LocalDate date) { List feedList = feedService.getFeed(date); return ApiResponse.onSuccess(feedList.stream().map(FeedConverter::toFeedResultDTO).toList()); } @@ -42,9 +42,8 @@ public ApiResponse modifyFeed(@RequestBody @Valid } @DeleteMapping("/feeds/{feedId}") - @Operation(summary = "워라벨 피드 삭제 API",description = "기존의 워라벨 피드를 삭제하는 API입니다.") - public ApiResponse deleteFeed(@PathVariable(name = "feedId") Long feedId){ - feedService.deleteFeed(feedId); - return ApiResponse.onSuccess(null); + @Operation(summary = "워라벨 피드 삭제 API", description = "기존의 워라벨 피드를 삭제하는 API입니다.") + public ApiResponse deleteFeed(@PathVariable(name = "feedId") Long feedId) { + return ApiResponse.onSuccess(feedService.deleteFeed(feedId)); } } diff --git a/src/main/java/com/onnoff/onnoff/domain/off/feed/service/FeedService.java b/src/main/java/com/onnoff/onnoff/domain/off/feed/service/FeedService.java index a36a29a..deabce3 100644 --- a/src/main/java/com/onnoff/onnoff/domain/off/feed/service/FeedService.java +++ b/src/main/java/com/onnoff/onnoff/domain/off/feed/service/FeedService.java @@ -15,5 +15,5 @@ public interface FeedService { Feed modifyFeed(FeedRequestDTO.ModifyFeedDTO request); - void deleteFeed(Long feedId); + Long deleteFeed(Long feedId); } diff --git a/src/main/java/com/onnoff/onnoff/domain/off/feed/service/FeedServiceImpl.java b/src/main/java/com/onnoff/onnoff/domain/off/feed/service/FeedServiceImpl.java index 0feed24..f2a6512 100644 --- a/src/main/java/com/onnoff/onnoff/domain/off/feed/service/FeedServiceImpl.java +++ b/src/main/java/com/onnoff/onnoff/domain/off/feed/service/FeedServiceImpl.java @@ -49,8 +49,10 @@ public Feed modifyFeed(FeedRequestDTO.ModifyFeedDTO request) { @Override @Transactional - public void deleteFeed(Long feedId) { + public Long deleteFeed(Long feedId) { Feed feed = feedRepository.findById(feedId).orElseThrow(() -> new GeneralException(ErrorStatus.FEED_NOT_FOUND)); feedRepository.delete(feed); + + return feed.getId(); } }