Skip to content

Commit

Permalink
[#132] refactor(share)
Browse files Browse the repository at this point in the history
- build.gradle(mockK 버전 업그레이드) 수정
- bookmarkInterface 관련 클래스 삭제
- SharedBookmark constructor 조정
- 공유 보관함을 확인하는 isSameRootFolderId 메소드 추가
  • Loading branch information
Ji-Ha committed Jun 23, 2022
1 parent 2b2f89b commit d81f200
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 311 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dependencies {
exclude(group = "org.mockito")
}
testImplementation("org.springframework.batch:spring-batch-test")
testImplementation("com.ninja-squad:springmockk:2.0.3")
testImplementation("com.ninja-squad:springmockk:3.0.1")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,23 @@
package com.yapp.web2.domain.bookmark.entity


import java.time.LocalDateTime
import javax.persistence.Id

class SharedBookmark(var rootFolderId: Long) : BookmarkInterface {
@Id
override var id: String = ""
override var userId: Long? = null
override var link: String = ""
override var title: String = ""
override var description: String = ""
override var image: String? = null

override var folderId: Long? = null
override var folderEmoji: String? = ""
override var folderName: String = ""
override var clickCount: Int = 0

override var deleteTime: LocalDateTime? = null
override var deleted: Boolean = false

override var saveTime: LocalDateTime = LocalDateTime.now()
var remindAccountList = mutableListOf<Long>()

constructor(bookmark: BookmarkInterface, rootFolderId: Long): this(rootFolderId) {
this.userId = bookmark.userId
this.link = bookmark.link
this.title = bookmark.title
this.description = bookmark.description
this.image = bookmark.image
this.folderId = bookmark.folderId
this.folderEmoji = bookmark.folderEmoji
this.folderName = bookmark.folderName
import com.yapp.web2.domain.account.entity.Account

class SharedBookmark : BookmarkInterface {
var remindAccountList = mutableListOf<Long?>()
var rootFolderId: Long? = -1

constructor(
account: Account,
link: String,
title: String,
image: String?,
description: String,
rootFolderId: Long?
) : super(account, link, title, image, description) {
this.rootFolderId = rootFolderId
}

constructor()

override fun moveFolder(nextFolderId: Long) {
this.folderId = nextFolderId
Expand All @@ -51,4 +34,8 @@ class SharedBookmark(var rootFolderId: Long) : BookmarkInterface {
override fun remindOff() {
throw RuntimeException()
}

fun isSameRootFolderId(folderId: Long?): Boolean {
return this.rootFolderId == folderId
}
}

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit d81f200

Please sign in to comment.