We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 599e90e commit 82df16fCopy full SHA for 82df16f
1 file changed
apps/commerce-api/src/main/java/com/loopers/domain/point/PointService.java
@@ -7,6 +7,7 @@
7
import com.loopers.support.error.ErrorType;
8
import lombok.RequiredArgsConstructor;
9
import org.springframework.stereotype.Component;
10
+import org.springframework.transaction.annotation.Transactional;
11
12
@RequiredArgsConstructor
13
@Component
@@ -20,6 +21,7 @@ public Integer getPoint(String userId) {
20
21
.orElse(null);
22
}
23
24
+ @Transactional
25
public PointResponse charge(String userId, int amount) {
26
User user = userRepository.findByUserId(userId)
27
.orElseThrow(() -> new CoreException(ErrorType.NOT_FOUND, "유저를 찾을 수 없습니다."));
0 commit comments