Skip to content

Commit

Permalink
feat: SubscribeWorkbookUseCase Lock 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Sep 8, 2024
1 parent 9a3a60b commit acfded4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/src/main/kotlin/com/few/api/config/ApiConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.few.storage.image.config.ImageStorageConfig
import org.springframework.boot.context.properties.ConfigurationPropertiesScan
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.EnableAspectJAutoProxy
import org.springframework.context.annotation.Import
import org.springframework.scheduling.annotation.EnableAsync
import org.springframework.web.servlet.config.annotation.EnableWebMvc
Expand All @@ -23,6 +24,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc
)
@EnableWebMvc
@EnableAsync
@EnableAspectJAutoProxy
@ConfigurationPropertiesScan(basePackages = [ApiConfig.BASE_PACKAGE])
class ApiConfig {
companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.few.api.domain.subscription.usecase

import com.few.api.domain.common.lock.LockFor
import com.few.api.domain.common.lock.LockIdentifier
import com.few.api.domain.subscription.event.dto.WorkbookSubscriptionEvent
import com.few.api.repo.dao.subscription.SubscriptionDao
import com.few.api.repo.dao.subscription.command.InsertWorkbookSubscriptionCommand
Expand All @@ -21,6 +23,7 @@ class SubscribeWorkbookUseCase(
private val applicationEventPublisher: ApplicationEventPublisher,
) {

@LockFor(LockIdentifier.SUBSCRIPTION_MEMBER_ID_WORKBOOK_ID)
@Transactional
fun execute(useCaseIn: SubscribeWorkbookUseCaseIn) {
val subTargetWorkbookId = useCaseIn.workbookId
Expand Down

0 comments on commit acfded4

Please sign in to comment.