From fa127f3576bec6dfd7e602d4c9c8f2fc8dc895c1 Mon Sep 17 00:00:00 2001 From: belljun3395 <195850@jnu.ac.kr> Date: Mon, 1 Jul 2024 10:13:54 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20MapArticleUseCase=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/document/dto/MapArticleUseCaseIn.kt | 7 +++++++ .../document/usecase/MapArticleUseCase.kt | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 api/src/main/kotlin/com/few/api/domain/admin/document/dto/MapArticleUseCaseIn.kt create mode 100644 api/src/main/kotlin/com/few/api/domain/admin/document/usecase/MapArticleUseCase.kt diff --git a/api/src/main/kotlin/com/few/api/domain/admin/document/dto/MapArticleUseCaseIn.kt b/api/src/main/kotlin/com/few/api/domain/admin/document/dto/MapArticleUseCaseIn.kt new file mode 100644 index 000000000..97fdee135 --- /dev/null +++ b/api/src/main/kotlin/com/few/api/domain/admin/document/dto/MapArticleUseCaseIn.kt @@ -0,0 +1,7 @@ +package com.few.api.domain.admin.document.dto + +data class MapArticleUseCaseIn( + val workbookId: Long, + val articleId: Long, + val dayCol: Int +) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/MapArticleUseCase.kt b/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/MapArticleUseCase.kt new file mode 100644 index 000000000..c1c014ad8 --- /dev/null +++ b/api/src/main/kotlin/com/few/api/domain/admin/document/usecase/MapArticleUseCase.kt @@ -0,0 +1,19 @@ +package com.few.api.domain.admin.document.usecase + +import com.few.api.domain.admin.document.dto.MapArticleUseCaseIn +import com.few.api.repo.dao.workbook.WorkbookDao +import com.few.api.repo.dao.workbook.command.MapWorkBookToArticleCommand +import org.springframework.stereotype.Component +import org.springframework.transaction.annotation.Transactional + +@Component +class MapArticleUseCase( + private val workbookDao: WorkbookDao +) { + @Transactional + fun execute(useCaseIn: MapArticleUseCaseIn) { + MapWorkBookToArticleCommand(useCaseIn.workbookId, useCaseIn.articleId, useCaseIn.dayCol).let { command -> + workbookDao.mapWorkBookToArticle(command) + } + } +} \ No newline at end of file