|
|
|
|
@ -1,13 +1,16 @@
|
|
|
|
|
package wanijo.wanijo2.domain.handler
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service
|
|
|
|
|
import wanijo.wanijo2.domain.DocumentDao
|
|
|
|
|
import wanijo.wanijo2.domain.DocumentTagging
|
|
|
|
|
import wanijo.wanijo2.domain.DocumentTaggingDao
|
|
|
|
|
import wanijo.wanijo2.domain.event.AssignTaggingCommand
|
|
|
|
|
import wanijo.wanijo2.http.DocumentNotFound
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
class AssignTaggingHandler(
|
|
|
|
|
val taggingDao: DocumentTaggingDao
|
|
|
|
|
val taggingDao: DocumentTaggingDao,
|
|
|
|
|
val documentDao: DocumentDao
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
fun exec(command: AssignTaggingCommand) {
|
|
|
|
|
@ -17,6 +20,11 @@ class AssignTaggingHandler(
|
|
|
|
|
command.tagId
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
documentDao.save(
|
|
|
|
|
(documentDao
|
|
|
|
|
.findById(command.documentId) ?: throw DocumentNotFound())
|
|
|
|
|
.updated()
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|