Compare commits
No commits in common. '938f2ef619227bb6f1b6e9a1fc87abb1983da56d' and '9af57be30604f10cd149159a729374ecd2af6c71' have entirely different histories.
938f2ef619
...
9af57be306
@ -1,29 +1,19 @@
|
|||||||
package wanijo.wanijo2.domain.handler
|
package wanijo.wanijo2.domain.handler
|
||||||
|
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
import org.springframework.transaction.annotation.Transactional
|
|
||||||
import wanijo.wanijo2.domain.DocumentDao
|
|
||||||
import wanijo.wanijo2.domain.DocumentTaggingDao
|
import wanijo.wanijo2.domain.DocumentTaggingDao
|
||||||
import wanijo.wanijo2.domain.event.DeleteTaggingCommand
|
import wanijo.wanijo2.domain.event.DeleteTaggingCommand
|
||||||
import wanijo.wanijo2.http.DocumentNotFound
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
class DeleteTaggingHandler(
|
class DeleteTaggingHandler(
|
||||||
val taggingDao: DocumentTaggingDao,
|
val taggingDao: DocumentTaggingDao
|
||||||
val documentDao: DocumentDao
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@Transactional
|
|
||||||
fun exec(command: DeleteTaggingCommand) {
|
fun exec(command: DeleteTaggingCommand) {
|
||||||
taggingDao.delete(
|
taggingDao.delete(
|
||||||
command.documentId,
|
command.documentId,
|
||||||
command.tagId
|
command.tagId
|
||||||
)
|
)
|
||||||
documentDao.save(
|
|
||||||
(documentDao
|
|
||||||
.findById(command.documentId) ?: throw DocumentNotFound())
|
|
||||||
.updated()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue