-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
994ab4e
commit fa127f3
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
api/src/main/kotlin/com/few/api/domain/admin/document/dto/MapArticleUseCaseIn.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.few.api.domain.admin.document.dto | ||
|
||
data class MapArticleUseCaseIn( | ||
val workbookId: Long, | ||
val articleId: Long, | ||
val dayCol: Int | ||
) |
19 changes: 19 additions & 0 deletions
19
api/src/main/kotlin/com/few/api/domain/admin/document/usecase/MapArticleUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} | ||
} |