Skip to content

Commit

Permalink
[#168] fix(dto): 북마크 추가 dto에 link -> url로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Ji-Ha committed Jul 24, 2022
1 parent 5926652 commit 4e223a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/main/kotlin/com/yapp/web2/domain/bookmark/BookmarkDto.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.yapp.web2.domain.bookmark

import com.google.common.collect.ImmutableList
import com.yapp.web2.domain.account.entity.Account
import com.yapp.web2.domain.bookmark.entity.Bookmark
import com.yapp.web2.domain.bookmark.entity.BookmarkInterface
Expand All @@ -9,7 +8,6 @@ import com.yapp.web2.domain.bookmark.entity.SharedBookmark
import com.yapp.web2.domain.folder.entity.Folder
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.time.LocalDateTime
import javax.validation.constraints.NotEmpty
import javax.validation.constraints.NotNull

Expand All @@ -19,7 +17,7 @@ class BookmarkDto {
fun addBookmarkDtoToPersonalBookmark(bookmarkDto: AddBookmarkDto, account: Account): BookmarkInterface {
return PersonalBookmark(
account,
bookmarkDto.link,
bookmarkDto.url,
bookmarkDto.title,
bookmarkDto.image,
bookmarkDto.description,
Expand All @@ -28,13 +26,13 @@ class BookmarkDto {
}

fun addBookmarkDtoToBookmark(bookmarkDto: AddBookmarkDto, account: Account): Bookmark {
return Bookmark(account, bookmarkDto.link, bookmarkDto.title, bookmarkDto.image, bookmarkDto.description, bookmarkDto.remind)
return Bookmark(account, bookmarkDto.url, bookmarkDto.title, bookmarkDto.image, bookmarkDto.description, bookmarkDto.remind)
}

fun addBookmarkDtoToSharedBookmark(bookmarkDto: AddBookmarkDto, account: Account, folder: Folder): BookmarkInterface {
return SharedBookmark(
account,
bookmarkDto.link,
bookmarkDto.url,
bookmarkDto.title,
bookmarkDto.image,
bookmarkDto.description,
Expand All @@ -59,7 +57,7 @@ class BookmarkDto {

// TODO: 2021/12/04 RequestParam 데이터 검증
@ApiModelProperty(value = "북마크 url", required = true, example = "https://www.naver.com")
var link: String,
var url: String,

@ApiModelProperty(value = "북마크 제목", example = "Bookmark Title")
var title: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ internal class SharedBookmarkServiceTest {

// then
assertAll(
{Assertions.assertThat(actual.link).isEqualTo(testDto.link)},
{Assertions.assertThat(actual.link).isEqualTo(testDto.url)},
{Assertions.assertThat(actual.title).isEqualTo(testDto.title)},
{Assertions.assertThat(actual.image).isEqualTo(testDto.image)},
{Assertions.assertThat(actual.image).isEqualTo(testDto.image)},
Expand Down

0 comments on commit 4e223a5

Please sign in to comment.