Skip to content

Commit 82f0a61

Browse files
authored
feat: 독서기록 API 기능 구현 (#53)
* [BOOK-163] feat: infra - userbook에서 id와 userId로 도서 등록 여부 검증 메서드 구현 (#52) * [BOOK-163] feat: infra - Jparepository 구현 (#52) * [BOOK-163] feat: infra - �querydslrepository 구현 (#52) * [BOOK-163] feat: infra - �독서기록 Entity 구현 (#52) * [BOOK-163] feat: domain - �독서기록 Entity 구현 (#52) * [BOOK-163] feat: domain - �독서기록 entity mapper 구현 (#52) * [BOOK-163] feat: domain - �독서기록 도메인서비스 구현 (#52) * [BOOK-163] feat: domain - �독서기록 �domain VO 구현 (#52) * [BOOK-163] feat: domain - �통합 interface 구현 (#52) * [BOOK-163] feat: �apis - 독서기록 usecase구현 (#52) * [BOOK-163] feat: �apis - 독서기록 service 구현 (#52) * [BOOK-163] feat: �apis - 독서기록 dto 구현 (#52) * [BOOK-163] feat: �apis - 독서기록 controller 구현 (#52) * [BOOK-163] feat: �apis - merge conflict 해결 (#52) * [BOOK-163] feat: �apis - userbook exception 처리 (#52) * [BOOK-163] refactor: �apis - 코드컨벤션에 맞게 리팩토링 (#52) * [BOOK-163] refactor: apis - 1차 코드리뷰 반영(#52) * [BOOK-163] refactor: infra 1차 코드리뷰 반영(#52) * [BOOK-163] refactor: domain 1차 코드리뷰 반영(#52) * [BOOK-163] refactor: domain bookId isbn -> UUID로 변경 (#52) * [BOOK-163] feat: apis 내서재 총 책개수 컬럼추가 (#52) * [BOOK-163] feat: domain tag 중간테이블 기능개발 (#52) * [BOOK-163] feat: �infra tag 중간테이블 기능개발 (#52) * [BOOK-163] feat: infra 외부API imagePage가져오도록 설정 (#52)
1 parent 3706fcc commit 82f0a61

File tree

59 files changed

+1338
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1338
-71
lines changed

apis/src/main/kotlin/org/yapp/apis/auth/dto/request/DeleteTokenRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import org.yapp.apis.auth.dto.response.RefreshTokenResponse
88
name = "DeleteTokenRequest",
99
description = "Request DTO for deleting a refresh token"
1010
)
11-
data class DeleteTokenRequest(
11+
data class DeleteTokenRequest private constructor(
1212
@field:NotBlank(message = "Refresh token must not be blank.")
1313
@Schema(description = "Refresh token to be deleted", example = "eyJhbGciOiJIUz...")
1414
val refreshToken: String? = null

apis/src/main/kotlin/org/yapp/apis/auth/dto/request/FindUserIdentityRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import java.util.*
99
name = "FindUserIdentityRequest",
1010
description = "Request DTO to retrieve user identity information using userId"
1111
)
12-
data class FindUserIdentityRequest(
12+
data class FindUserIdentityRequest private constructor(
1313
@Schema(
1414
description = "User ID (UUID format)",
1515
example = "a1b2c3d4-e5f6-7890-1234-56789abcdef0"

apis/src/main/kotlin/org/yapp/apis/auth/dto/request/TokenGenerateRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import java.util.*
99
name = "TokenGenerateRequest",
1010
description = "DTO containing information required to save the generated refresh token"
1111
)
12-
data class TokenGenerateRequest(
12+
data class TokenGenerateRequest private constructor(
1313
@field:NotNull(message = "userId must not be null")
1414
@Schema(description = "User ID", example = "f6b7d490-1b1a-4b9f-8e8e-27f8e3a5dafa")
1515
val userId: UUID? = null,

apis/src/main/kotlin/org/yapp/apis/auth/dto/request/UserBooksByIsbnsRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import java.util.UUID
99
name = "UserBooksByIsbnsRequest",
1010
description = "Request DTO for finding user books by user ID and a list of ISBNs"
1111
)
12-
data class UserBooksByIsbnsRequest(
12+
data class UserBooksByIsbnsRequest private constructor(
1313
@Schema(
1414
description = "사용자 ID",
1515
example = "1"

apis/src/main/kotlin/org/yapp/apis/book/controller/BookController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.yapp.apis.book.controller
22

33
import jakarta.validation.Valid
4-
import org.springframework.data.domain.Page
54
import org.springframework.data.domain.Pageable
65
import org.springframework.data.domain.Sort
76
import org.springframework.data.web.PageableDefault
@@ -23,6 +22,7 @@ import org.yapp.apis.book.dto.response.UserBookPageResponse
2322
import org.yapp.apis.book.dto.response.UserBookResponse
2423
import org.yapp.apis.book.usecase.BookUseCase
2524
import org.yapp.domain.userbook.BookStatus
25+
import org.yapp.domain.userbook.UserBookSortType
2626
import java.util.UUID
2727

2828
@RestController
@@ -62,7 +62,7 @@ class BookController(
6262
override fun getUserLibraryBooks(
6363
@AuthenticationPrincipal userId: UUID,
6464
@RequestParam(required = false) status: BookStatus?,
65-
@RequestParam(required = false) sort: String?,
65+
@RequestParam(required = false) sort: UserBookSortType?,
6666
@PageableDefault(size = 10, sort = ["createdAt"], direction = Sort.Direction.DESC)
6767
pageable: Pageable
6868
): ResponseEntity<UserBookPageResponse> {

apis/src/main/kotlin/org/yapp/apis/book/controller/BookControllerApi.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import org.yapp.apis.book.dto.response.BookSearchResponse
2727
import org.yapp.apis.book.dto.response.UserBookPageResponse
2828
import org.yapp.apis.book.dto.response.UserBookResponse
2929
import org.yapp.domain.userbook.BookStatus
30+
import org.yapp.domain.userbook.UserBookSortType
3031
import org.yapp.globalutils.exception.ErrorResponse
3132
import java.util.UUID
3233

@@ -140,7 +141,7 @@ interface BookControllerApi {
140141
fun getUserLibraryBooks(
141142
@AuthenticationPrincipal userId: UUID,
142143
@RequestParam(required = false) status: BookStatus?,
143-
@RequestParam(required = false) sort: String?,
144+
@RequestParam(required = false) sort: UserBookSortType?,
144145
@PageableDefault(size = 10, sort = ["createdAt"], direction = Sort.Direction.DESC)
145146
pageable: Pageable
146147
): ResponseEntity<UserBookPageResponse>

apis/src/main/kotlin/org/yapp/apis/book/dto/request/BookCreateRequest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ data class BookCreateRequest private constructor(
2222
@field:Size(max = 2048, message = "표지 URL은 2048자 이내여야 합니다.")
2323
val coverImageUrl: String,
2424

25-
val description: String? = null,
25+
val description: String? = null
2626
) {
2727
fun validIsbn(): String = isbn!!
2828
fun validTitle(): String = title!!
@@ -42,7 +42,7 @@ data class BookCreateRequest private constructor(
4242
publisher = bookDetail.publisher,
4343
publicationYear = parsePublicationYear(bookDetail.pubDate),
4444
coverImageUrl = bookDetail.cover,
45-
description = bookDetail.description
45+
description = bookDetail.description,
4646
)
4747
}
4848

apis/src/main/kotlin/org/yapp/apis/book/dto/request/UpsertUserBookRequest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package org.yapp.apis.book.dto.request
22

33
import org.yapp.apis.book.dto.response.BookCreateResponse
4-
import org.yapp.apis.book.dto.response.UserBookResponse
54
import org.yapp.domain.userbook.BookStatus
65
import java.util.UUID
76

87

98
data class UpsertUserBookRequest private constructor(
109
val userId: UUID? = null,
10+
val bookId: UUID? = null,
1111
val bookIsbn: String? = null,
1212
val bookTitle: String? = null,
1313
val bookAuthor: String? = null,
@@ -16,6 +16,7 @@ data class UpsertUserBookRequest private constructor(
1616
val status: BookStatus? = null
1717
) {
1818
fun validUserId(): UUID = userId!!
19+
fun validBookId(): UUID = bookId!!
1920
fun validBookIsbn(): String = bookIsbn!!
2021
fun validBookTitle(): String = bookTitle!!
2122
fun validBookAuthor(): String = bookAuthor!!
@@ -27,10 +28,11 @@ data class UpsertUserBookRequest private constructor(
2728
fun of(
2829
userId: UUID,
2930
bookCreateResponse: BookCreateResponse,
30-
status: BookStatus
31+
status: BookStatus,
3132
): UpsertUserBookRequest {
3233
return UpsertUserBookRequest(
3334
userId = userId,
35+
bookId = bookCreateResponse.bookId,
3436
bookIsbn = bookCreateResponse.isbn,
3537
bookTitle = bookCreateResponse.title,
3638
bookAuthor = bookCreateResponse.author,

apis/src/main/kotlin/org/yapp/apis/book/dto/response/BookCreateResponse.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,25 @@ package org.yapp.apis.book.dto.response
22

33
import org.yapp.domain.book.vo.BookInfoVO
44

5+
import java.util.UUID
6+
57
data class BookCreateResponse private constructor(
8+
val bookId: UUID,
69
val isbn: String,
710
val title: String,
811
val author: String,
912
val publisher: String,
10-
val coverImageUrl: String
13+
val coverImageUrl: String,
1114
) {
1215
companion object {
1316
fun from(bookVO: BookInfoVO): BookCreateResponse {
1417
return BookCreateResponse(
18+
bookId = bookVO.id.value,
1519
isbn = bookVO.isbn.value,
1620
title = bookVO.title,
1721
author = bookVO.author,
1822
publisher = bookVO.publisher,
19-
coverImageUrl = bookVO.coverImageUrl
23+
coverImageUrl = bookVO.coverImageUrl,
2024
)
2125
}
2226
}

apis/src/main/kotlin/org/yapp/apis/book/dto/response/BookDetailResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ data class BookDetailResponse private constructor(
2525
val cover: String,
2626
val categoryId: Int?,
2727
val categoryName: String?,
28-
val publisher: String
28+
val publisher: String,
2929
) {
3030
companion object {
3131

0 commit comments

Comments
 (0)