Skip to content

Commit

Permalink
fix: 벌레 0마리인 경우 내역 저장되지 않도록 수정 (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmebin authored Nov 30, 2023
1 parent fb8eb23 commit e8cac53
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/com/moabam/api/application/bug/BugService.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public PurchaseProductResponse purchaseBugProduct(Long memberId, Long productId,

@Transactional
public void use(Member member, BugType bugType, int count) {
if (count == 0) {
return;
}

Bug bug = member.getBug();

bug.use(bugType, count);
Expand All @@ -88,6 +92,10 @@ public void use(Member member, BugType bugType, int count) {

@Transactional
public void reward(Member member, BugType bugType, int count) {
if (count == 0) {
return;
}

Bug bug = member.getBug();

bug.increase(bugType, count);
Expand All @@ -104,6 +112,10 @@ public void charge(Long memberId, Product bugProduct) {

@Transactional
public void applyCoupon(Long memberId, BugType bugType, int count) {
if (count == 0) {
return;
}

Bug bug = getByMemberId(memberId);

bug.increase(bugType, count);
Expand Down

0 comments on commit e8cac53

Please sign in to comment.