Skip to content

Commit 3ff9bc2

Browse files
committed
[BOOK-79] fix: apis - inner dto class 이름변경 (#15)
1 parent 887d2a9 commit 3ff9bc2

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ data class BookSearchResponse private constructor(
1414
val query: String?,
1515
val searchCategoryId: Int?,
1616
val searchCategoryName: String?,
17-
val books: List<BookSummaryDto>
17+
val books: List<BookSummary>
1818
) {
19-
20-
2119
companion object {
2220
fun from(response: AladinSearchResponse): BookSearchResponse {
23-
val books = response.item?.mapNotNull { BookSummaryDto.fromAladinItem(it) } ?: emptyList()
21+
val books = response.item?.mapNotNull { BookSummary.fromAladinItem(it) } ?: emptyList()
2422
return BookSearchResponse(
2523
version = response.version,
2624
title = response.title,
@@ -37,21 +35,19 @@ data class BookSearchResponse private constructor(
3735
}
3836
}
3937

40-
data class BookSummaryDto private constructor(
38+
data class BookSummary private constructor(
4139
val isbn: String,
4240
val title: String,
4341
val author: String?,
4442
val publisher: String?,
4543
val coverImageUrl: String?,
4644
) {
47-
4845
companion object {
49-
5046
private val unknownTitle = "제목없음"
5147

52-
fun fromAladinItem(item: BookItem): BookSummaryDto? {
48+
fun fromAladinItem(item: BookItem): BookSummary? {
5349
val isbn = item.isbn ?: item.isbn13 ?: return null
54-
return BookSummaryDto(
50+
return BookSummary(
5551
isbn = isbn,
5652
title = item.title ?: unknownTitle,
5753
author = item.author,

0 commit comments

Comments
 (0)