Skip to content

Commit

Permalink
rename: DTO명 간략하게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjm9841 committed Feb 3, 2024
1 parent bbd9bee commit 260c83f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,37 @@ public class FeedController {

@PostMapping("/feeds")
@Operation(summary = "워라벨 피드 추가 API", description = "새로운 워라벨 피드를 추가하는 API입니다.")
public ApiResponse<FeedResponseDTO.FeedResultDTO> addFeed(@RequestBody @Valid FeedRequestDTO.AddFeedDTO request) {
public ApiResponse<FeedResponseDTO.FeedDTO> 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<List<FeedResponseDTO.FeedResultDTO>> getFeed(@RequestParam(name = "date") LocalDate date) {
public ApiResponse<List<FeedResponseDTO.FeedDTO>> getFeed(@RequestParam(name = "date") LocalDate date) {
List<Feed> 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<FeedResponseDTO.FeedResultDTO> modifyFeed(@PathVariable(name = "feedId") Long feedId, @RequestBody @Valid FeedRequestDTO.ModifyFeedDTO request) {
public ApiResponse<FeedResponseDTO.FeedDTO> 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<FeedResponseDTO.FeedResultDTO> delayFeed(@PathVariable(name = "feedId") Long feedId) {
public ApiResponse<FeedResponseDTO.FeedDTO> 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<FeedResponseDTO.FeedResultDTO> checkFeed(@PathVariable(name = "feedId") Long feedId) {
public ApiResponse<FeedResponseDTO.FeedDTO> 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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class FeedResponseDTO {
@Getter
@NoArgsConstructor
@AllArgsConstructor
public static class FeedResultDTO {
public static class FeedDTO {
Long feedId;
LocalDate date;
String content;
Expand Down

0 comments on commit 260c83f

Please sign in to comment.