Skip to content

Commit

Permalink
tag에 writer 속성을 추가한다
Browse files Browse the repository at this point in the history
  • Loading branch information
anjeongkyun committed Nov 13, 2023
1 parent 86ea65b commit 08cccb9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package org.tagwonder.commands

data class CreateTagsCommand(
val titles: List<String>,
val memberId: Long
val memberId: Long,
val writer: String?
) {
constructor() : this(emptyList(), 0L)
constructor() : this(emptyList(), 0L, "")
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ class TagDataMapper {
return Tag(
id = dataModel.id!!,
title = dataModel.title,
memberId = dataModel.memberId
memberId = dataModel.memberId,
writer = dataModel.writer
)
}

fun toDataModel(entity: Tag): TagDataModel {
return TagDataModel(
id = entity.id,
title = entity.title,
memberId = entity.memberId
memberId = entity.memberId,
writer = entity.writer
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ data class TagDataModel(
val title: String = "",

@Column(name = "member_id")
val memberId: Long = 0L
val memberId: Long = 0L,

val writer: String? = ""
)
3 changes: 2 additions & 1 deletion domain-model/src/main/kotlin/org/tagwonder/entities/Tag.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ package org.tagwonder.entities
data class Tag(
val id: Long? = null,
val title: String,
val memberId: Long
val memberId: Long,
val writer: String? = null
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class CreateTagsCommandExecutor(
command.titles.map {
Tag(
title = it,
memberId = command.memberId
memberId = command.memberId,
writer = command.writer ?: null
)
}
)
Expand Down

0 comments on commit 08cccb9

Please sign in to comment.