Skip to content

Commit

Permalink
✨ Feat: 응답값 형식 통일
Browse files Browse the repository at this point in the history
  • Loading branch information
ShimFFF committed Aug 18, 2024
1 parent 54c1dca commit 7668c8d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class RoomInfoPostController {
private final RoomInfoPostCommandService roomInfoPostCommandService;

@PostMapping("/info-post/{roomId}")
@Operation(summary = "스터디룸 정보나눔 게시판 등록 API")
@Operation(summary = "스터디룸 정보나눔 게시판 게시글 등록 API")
public BaseResponse<RoomPostResponseDto.toCreateRoomInfoPostIdDTO> StudyRoomInfoPostController(
@RequestHeader("Authorization") String authorization,
@RequestBody @Valid RoomPostRequestDto.RoomInfoPostDto requestDto,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class RoomTroublePostController {
private final RoomPostQueryService roomPostQueryService;

@PostMapping("/trouble/{roomId}")
@Operation(summary = "스터디룸 트러블슈팅 게시판 등록 API")
@Operation(summary = "스터디룸 트러블슈팅 게시판 게시글 등록 API")
public BaseResponse<RoomPostResponseDto.toCreateRoomTroublePostIdDTO> TroublePostController(
@RequestHeader("Authorization") String authorization,
@RequestBody @Valid RoomPostRequestDto.RoomTroubloePostDto requestDto,
Expand Down Expand Up @@ -162,15 +162,17 @@ public BaseResponse<RoomPostResponseDto.toWriteCommentDto> addReply(
@GetMapping("/{boardId}/trouble-posts")
@Operation(summary = "트러블 슈팅 게시글 무한 스크롤 조회", description = "트러블 슈팅 게시글을 무한 스크롤 방식으로 조회합니다.")
@ApiResponse(responseCode = "200", description = "조회 성공")
public BaseResponse<List<RoomPostResponseDto.TroublePostSummaryDto>> getNextTroublePosts(
public BaseResponse<RoomPostResponseDto.TroublePostSummaryListDto> getNextTroublePosts(
@PathVariable @Parameter(description = "게시판 ID") Long boardId,
@RequestParam @Parameter(description = "마지막으로 로드된 게시글 ID") Long lastPostId,
@RequestParam(defaultValue = "10") @Parameter(description = "조회할 게시글 수") int size) {

List<RoomPostResponseDto.TroublePostSummaryDto> posts =
roomPostQueryService.getNextTroublePosts(boardId, lastPostId, size);

return BaseResponse.onSuccess(posts);
return BaseResponse.onSuccess(
new RoomPostResponseDto.TroublePostSummaryListDto(posts)
);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

public class RoomPostResponseDto {
@Builder
Expand Down Expand Up @@ -54,6 +55,11 @@ public static class toCreateRoomInfoPostIdDTO {
Long infoPostId;
}

@Getter
@AllArgsConstructor
public static class TroublePostSummaryListDto {
private List<TroublePostSummaryDto> troublePostSummaryDtoList;
}

@Getter
public static class TroublePostSummaryDto {
Expand Down

0 comments on commit 7668c8d

Please sign in to comment.