Skip to content

Commit

Permalink
feat: MapArticleUseCase 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Jul 1, 2024
1 parent 994ab4e commit fa127f3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
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
)
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)
}
}
}

0 comments on commit fa127f3

Please sign in to comment.