Compare commits
3 Commits
9af57be306
...
938f2ef619
| Author | SHA1 | Date |
|---|---|---|
|
|
938f2ef619 | 3 weeks ago |
|
|
67dc59c0e9 | 3 weeks ago |
|
|
38bab59e0f | 3 weeks ago |
@ -1,19 +1,29 @@
|
||||
package wanijo.wanijo2.domain.handler
|
||||
|
||||
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.event.DeleteTaggingCommand
|
||||
import wanijo.wanijo2.http.DocumentNotFound
|
||||
|
||||
@Service
|
||||
class DeleteTaggingHandler(
|
||||
val taggingDao: DocumentTaggingDao
|
||||
val taggingDao: DocumentTaggingDao,
|
||||
val documentDao: DocumentDao
|
||||
) {
|
||||
|
||||
@Transactional
|
||||
fun exec(command: DeleteTaggingCommand) {
|
||||
taggingDao.delete(
|
||||
command.documentId,
|
||||
command.tagId
|
||||
)
|
||||
documentDao.save(
|
||||
(documentDao
|
||||
.findById(command.documentId) ?: throw DocumentNotFound())
|
||||
.updated()
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue