Skip to content

Commit 82df16f

Browse files
committed
fix: 트랜젝션 처리
1 parent 599e90e commit 82df16f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

apps/commerce-api/src/main/java/com/loopers/domain/point/PointService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.loopers.support.error.ErrorType;
88
import lombok.RequiredArgsConstructor;
99
import org.springframework.stereotype.Component;
10+
import org.springframework.transaction.annotation.Transactional;
1011

1112
@RequiredArgsConstructor
1213
@Component
@@ -20,6 +21,7 @@ public Integer getPoint(String userId) {
2021
.orElse(null);
2122
}
2223

24+
@Transactional
2325
public PointResponse charge(String userId, int amount) {
2426
User user = userRepository.findByUserId(userId)
2527
.orElseThrow(() -> new CoreException(ErrorType.NOT_FOUND, "유저를 찾을 수 없습니다."));

0 commit comments

Comments
 (0)