Skip to content

Commit

Permalink
[Refactor] 응답 형식 통일
Browse files Browse the repository at this point in the history
  • Loading branch information
hen715 committed Jan 16, 2025
1 parent c11c16c commit 7a60633
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public ResponseEntity<ResponseDto<Long>> register(@RequestPart @Valid BookRegist
@ApiResponse(responseCode = "200", description = "책 리스트 조회 성공", content = @Content(schema = @Schema(implementation = ListResponseDto.class)))
})
@GetMapping
public ResponseEntity<ListResponseDto<BookPreview>> getList(@RequestParam(required = false, defaultValue = "1") @Min(1) int page) {
return ResponseEntity.status(OK).body(bookService.getList(page));
public ResponseEntity<ResponseDto<ListResponseDto<BookPreview>>> getList(@RequestParam(required = false, defaultValue = "1") @Min(1) int page) {
return ResponseEntity.status(OK).body(ResponseDto.of(bookService.getList(page),"책 리스트 조회 성공"));
}

@Operation(summary = "책 상세 조회", description = "헤더 Auth에 발급받은 토큰을, url 파라미터에 책의 id를 보내주세요.")
Expand All @@ -84,8 +84,8 @@ public ResponseEntity<ResponseDto<Long>> toggleTransactionStatus(@Parameter(name
@ApiResponse(responseCode = "200", description = "판매 가능한 책 리스트 조회 성공", content = @Content(schema = @Schema(implementation = ListResponseDto.class)))
})
@GetMapping("/available")
public ResponseEntity<ListResponseDto<BookPreview>> getListOnlyAvailable(@RequestParam(required = false, defaultValue = "1") @Min(1) int page) {
return ResponseEntity.status(OK).body(bookService.getListOnlyAvailable(page));
public ResponseEntity<ResponseDto<ListResponseDto<BookPreview>>> getListOnlyAvailable(@RequestParam(required = false, defaultValue = "1") @Min(1) int page) {
return ResponseEntity.status(OK).body(ResponseDto.of(bookService.getListOnlyAvailable(page),"판매 가능한 책 리스트 조회 성공"));
}

@Operation(summary = "책 삭제", description = "헤더 Auth에 발급받은 토큰을, url 파라미터에 책의 id를 보내주세요.")
Expand Down

0 comments on commit 7a60633

Please sign in to comment.