diff --git a/contracts/src/main/kotlin/org/tagwonder/commands/CreateTagsCommand.kt b/contracts/src/main/kotlin/org/tagwonder/commands/CreateTagsCommand.kt index 0ec76f6..abceb25 100644 --- a/contracts/src/main/kotlin/org/tagwonder/commands/CreateTagsCommand.kt +++ b/contracts/src/main/kotlin/org/tagwonder/commands/CreateTagsCommand.kt @@ -2,7 +2,8 @@ package org.tagwonder.commands data class CreateTagsCommand( val titles: List, - val memberId: Long + val memberId: Long, + val writer: String? ) { - constructor() : this(emptyList(), 0L) + constructor() : this(emptyList(), 0L, "") } diff --git a/data-access/src/main/kotlin/org/tagwonder/mappers/TagDataMapper.kt b/data-access/src/main/kotlin/org/tagwonder/mappers/TagDataMapper.kt index 50d3b80..c421614 100644 --- a/data-access/src/main/kotlin/org/tagwonder/mappers/TagDataMapper.kt +++ b/data-access/src/main/kotlin/org/tagwonder/mappers/TagDataMapper.kt @@ -8,7 +8,8 @@ class TagDataMapper { return Tag( id = dataModel.id!!, title = dataModel.title, - memberId = dataModel.memberId + memberId = dataModel.memberId, + writer = dataModel.writer ) } @@ -16,7 +17,8 @@ class TagDataMapper { return TagDataModel( id = entity.id, title = entity.title, - memberId = entity.memberId + memberId = entity.memberId, + writer = entity.writer ) } } diff --git a/data-access/src/main/kotlin/org/tagwonder/models/TagDataModel.kt b/data-access/src/main/kotlin/org/tagwonder/models/TagDataModel.kt index 56f88c8..4d841ba 100644 --- a/data-access/src/main/kotlin/org/tagwonder/models/TagDataModel.kt +++ b/data-access/src/main/kotlin/org/tagwonder/models/TagDataModel.kt @@ -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? = "" ) diff --git a/domain-model/src/main/kotlin/org/tagwonder/entities/Tag.kt b/domain-model/src/main/kotlin/org/tagwonder/entities/Tag.kt index a63ba8f..28dc035 100644 --- a/domain-model/src/main/kotlin/org/tagwonder/entities/Tag.kt +++ b/domain-model/src/main/kotlin/org/tagwonder/entities/Tag.kt @@ -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 ) diff --git a/domain-model/src/main/kotlin/org/tagwonder/usecases/commands/CreateTagsCommandExecutor.kt b/domain-model/src/main/kotlin/org/tagwonder/usecases/commands/CreateTagsCommandExecutor.kt index 45303c3..6d5e18e 100644 --- a/domain-model/src/main/kotlin/org/tagwonder/usecases/commands/CreateTagsCommandExecutor.kt +++ b/domain-model/src/main/kotlin/org/tagwonder/usecases/commands/CreateTagsCommandExecutor.kt @@ -17,7 +17,8 @@ class CreateTagsCommandExecutor( command.titles.map { Tag( title = it, - memberId = command.memberId + memberId = command.memberId, + writer = command.writer ?: null ) } )