-
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.
Browse files
Browse the repository at this point in the history
[#168] 공유 관련 수정
- Loading branch information
Showing
6 changed files
with
52 additions
and
48 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -43,34 +43,6 @@ class Account( | |
const val BASIC_IMAGE_URL: String = "https://yapp-bucket-test.s3.ap-northeast-2.amazonaws.com/basicImage.png" | ||
} | ||
|
||
constructor(email: String, password: String) : this(email) { | ||
this.password = password | ||
} | ||
|
||
constructor(email: String, encryptPassword: String, fcmToken: String, name: String) : this(email) { | ||
this.password = encryptPassword | ||
this.fcmToken = fcmToken | ||
this.name = name | ||
} | ||
|
||
constructor(email: String, image: String, nickname: String, socialType: String, fcmToken: String) : this(email) { | ||
this.image = image | ||
this.name = nickname | ||
this.socialType = socialType | ||
this.fcmToken = fcmToken | ||
} | ||
|
||
fun addAccountFolder(accountFolder: AccountFolder) { | ||
this.accountFolderList.add(accountFolder) | ||
} | ||
|
||
@Transactional | ||
fun isInsideAccountFolder(accountFolder: AccountFolder): Boolean { | ||
accountFolderList.forEach { | ||
if (it.folder.id == accountFolder.folder.id) return true | ||
} | ||
return false | ||
} | ||
|
||
@Column(nullable = true) | ||
var password: String? = null | ||
|
@@ -99,9 +71,38 @@ class Account( | |
@Column | ||
var deleted: Boolean = false | ||
|
||
@OneToMany(mappedBy = "account", cascade = [CascadeType.ALL]) | ||
@OneToMany(mappedBy = "account", cascade = [CascadeType.ALL], orphanRemoval = true) | ||
var accountFolderList: MutableList<AccountFolder> = mutableListOf() | ||
|
||
constructor(email: String, password: String) : this(email) { | ||
this.password = password | ||
} | ||
|
||
constructor(email: String, encryptPassword: String, fcmToken: String, name: String) : this(email) { | ||
this.password = encryptPassword | ||
this.fcmToken = fcmToken | ||
this.name = name | ||
} | ||
|
||
constructor(email: String, image: String, nickname: String, socialType: String, fcmToken: String) : this(email) { | ||
this.image = image | ||
this.name = nickname | ||
this.socialType = socialType | ||
this.fcmToken = fcmToken | ||
} | ||
|
||
fun addAccountFolder(accountFolder: AccountFolder) { | ||
this.accountFolderList.add(accountFolder) | ||
} | ||
|
||
@Transactional | ||
fun isInsideAccountFolder(accountFolder: AccountFolder): Boolean { | ||
accountFolderList.forEach { | ||
if (it.folder.id == accountFolder.folder.id) return true | ||
} | ||
return false | ||
} | ||
|
||
@ApiModel(description = "소셜로그인 DTO") | ||
class AccountProfile( | ||
@ApiModelProperty(value = "이메일", required = true, example = "[email protected]") | ||
|
@@ -168,11 +169,9 @@ class Account( | |
) | ||
|
||
fun removeFolderInAccountFolder(folder: Folder) { | ||
for(af in this.accountFolderList) | ||
if (af.folder == folder) { | ||
accountFolderList.remove(af) | ||
return | ||
} | ||
this.accountFolderList.let { | ||
it.removeIf { af -> af.folder == folder } | ||
} | ||
} | ||
|
||
fun softDeleteAccount() { | ||
|
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
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