-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Central-MakeUs/dev
[CI/CD] dev 브랜치 최신화 반영하여 배포
- Loading branch information
Showing
7 changed files
with
86 additions
and
34 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/main/java/com/cmc/mercury/domain/book/controller/BookController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.cmc.mercury.domain.book.controller; | ||
|
||
import com.cmc.mercury.domain.book.dto.BookExistResponse; | ||
import com.cmc.mercury.domain.book.dto.BookSearchRequest; | ||
import com.cmc.mercury.domain.book.dto.BookSearchResponse; | ||
import com.cmc.mercury.domain.book.service.BookService; | ||
import com.cmc.mercury.global.response.SuccessResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.*; | ||
import reactor.core.publisher.Mono; | ||
|
||
@RestController | ||
@RequestMapping("/books") | ||
@RequiredArgsConstructor | ||
@Tag(name = "BookController", description = "도서 검색 관련 API") | ||
public class BookController { | ||
|
||
private final BookService bookService; | ||
|
||
@GetMapping("/search") | ||
@Operation(summary = "도서 검색", description = "검색어를 통해 도서 목록을 정렬하여 반환합니다.") | ||
public Mono<SuccessResponse<BookSearchResponse>> searchBooks( | ||
@ModelAttribute @Valid BookSearchRequest request) { | ||
return bookService.searchBooks(request) | ||
.map(SuccessResponse::ok); | ||
} | ||
|
||
@GetMapping("/exist") | ||
@Operation(summary = "기록 중복 생성 검사", | ||
description = "isbn을 통해 해당 도서에 대한 기록을 생성한 적이 있는지의 여부를 반환합니다.") | ||
public SuccessResponse<BookExistResponse> existBooks( | ||
@RequestParam("userId") Long testUserId, | ||
@RequestParam String isbn13 | ||
) { | ||
return SuccessResponse.ok(bookService.existBooks(testUserId, isbn13)); | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
src/main/java/com/cmc/mercury/domain/book/controller/BookSearchController.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
src/main/java/com/cmc/mercury/domain/book/dto/BookExistResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.cmc.mercury.domain.book.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema(description = "선택된 도서의 기록이 존재하는지 여부 응답 형식") | ||
public record BookExistResponse( | ||
|
||
@Schema(description = "중복 등록 여부") | ||
boolean isRegistered, | ||
|
||
@Schema(description = "독서 기록이 존재할 때만 값 반환, 존재하지 않으면 null 반환") | ||
Long recordId | ||
) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters