Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDLE-000] 즐겨찾기 facade service에 트랜잭션 추가 #206

Merged
merged 9 commits into from
Oct 23, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class JobPostingFavoriteService(
val jobPostingFavorite = jobPostingFavoriteJpaRepository.findByJobPostingIdAndCarerId(
jobPostingId = jobPostingId,
carerId = carerId
) ?: jobPostingFavoriteJpaRepository.save(
)?.let {
it.active()
} ?: jobPostingFavoriteJpaRepository.save(
JobPostingFavorite(
carerId = carerId,
jobPostingId = jobPostingId,
jobPostingType = jobPostingType,
)
)

jobPostingFavorite.active()
}

@Transactional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.swm.idle.application.jobposting.domain.JobPostingService
import com.swm.idle.application.user.carer.domain.CarerService
import com.swm.idle.domain.jobposting.enums.JobPostingType
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import java.util.*

@Service
Expand All @@ -14,6 +15,7 @@ data class JobPostingFavoriteFacadeService(
private val jobPostingService: JobPostingService,
) {

@Transactional
fun createJobPostingFavorite(
jobPostingId: UUID,
carerId: UUID,
Expand All @@ -31,6 +33,7 @@ data class JobPostingFavoriteFacadeService(
)
}

@Transactional
fun deleteJobPostingFavorite(
jobPostingId: UUID,
carerId: UUID,
Expand Down
Loading