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

트랜잭션 수정/auction에 bidder 추가 #94

Merged
merged 2 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.toyProject7.karrot.user.service.UserService
import org.springframework.context.annotation.Lazy
import org.springframework.data.repository.findByIdOrNull
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Propagation
import org.springframework.transaction.annotation.Transactional
import java.time.Instant
import java.time.temporal.ChronoUnit
Expand Down Expand Up @@ -134,7 +135,7 @@ class ArticleService(
articleRepository.delete(articleEntity)
}

@Transactional
@Transactional(propagation = Propagation.REQUIRES_NEW)
fun updateStatus(
request: UpdateStatusRequest,
articleId: Long,
Expand Down Expand Up @@ -268,7 +269,7 @@ class ArticleService(
return articles
}

@Transactional
@Transactional(propagation = Propagation.REQUIRES_NEW)
fun updateBuyer(
articleId: Long,
buyerId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import java.time.Instant
data class Auction(
val id: Long,
val seller: User,
val bidder: User?,
val title: String,
val content: String,
val tag: String,
Expand All @@ -26,6 +27,7 @@ data class Auction(
return Auction(
id = entity.id!!,
seller = User.fromEntity(entity.seller),
bidder = entity.bidder?.let { User.fromEntity(it) },
title = entity.title,
content = entity.content,
tag = entity.tag,
Expand Down