Skip to content

Commit 884cefa

Browse files
authored
Merge pull request #131 from swyp-app-team-4/feat#129-point-event
Feat#129 포인트 버그 개선
2 parents 530a2b9 + 78da2d7 commit 884cefa

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/main/java/boombimapi/domain/member/presentation/controller/MemberController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import boombimapi.domain.member.presentation.dto.member.req.NicknameReq;
77
import boombimapi.domain.member.presentation.dto.member.res.*;
88
import boombimapi.domain.member.presentation.dto.member.res.mypage.GetCongestionHistoryRes;
9+
import boombimapi.domain.member.presentation.dto.member.res.mypage.GetMemberResV1;
910
import boombimapi.domain.member.presentation.dto.member.res.mypage.GetMemberResV2;
1011
import boombimapi.global.response.BaseOKResponse;
1112
import io.swagger.v3.oas.annotations.Operation;
@@ -42,7 +43,7 @@ public class MemberController {
4243
})
4344
@PatchMapping("/name")
4445
public ResponseEntity<BaseOKResponse<Void>> updateNickname(@AuthenticationPrincipal String userId, @RequestBody NicknameReq req) {
45-
memberService1.updateNickname(userId, req.name());
46+
memberService.updateNickname(userId, req.name());
4647
return ResponseEntity.ok(
4748
BaseOKResponse.of(
4849
HttpStatus.OK,
@@ -55,8 +56,8 @@ public ResponseEntity<BaseOKResponse<Void>> updateNickname(@AuthenticationPrinci
5556
@ApiResponse(responseCode = "404", description = "유저 존재하지 않음")
5657
})
5758
@GetMapping
58-
public ResponseEntity<GetMemberResV2> getMember(@AuthenticationPrincipal String userId) {
59-
return ResponseEntity.ok(memberService.getMember(userId));
59+
public ResponseEntity<GetMemberResV1> getMember(@AuthenticationPrincipal String userId) {
60+
return ResponseEntity.ok(memberService1.getMember(userId));
6061
}
6162

6263

src/main/java/boombimapi/domain/point/application/impl/PointServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ public void usePointForEvent(String memberId, Long balance) {
8080
Point point = pointRepository.findByMember(member)
8181
.orElseThrow(() -> new BoombimException(POINT_NOT_EXIST));
8282

83-
if (point.getBalance() - balance <= 0) {
83+
if (point.getBalance() - balance < 0) {
8484
throw new BoombimException(INSUFFICIENT_POINT_FOR_EVENT);
8585
}
8686

8787
if (point.getApplyEventCount() == 5) {
88-
throw new BoombimException(INSUFFICIENT_POINT_FOR_EVENT);
88+
throw new BoombimException(EVENT_PARTICIPATION_LIMIT_EXCEEDED);
8989
}
9090

9191
point.subtractBalance(balance);

src/main/java/boombimapi/domain/point/domain/entity/PointHistory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class PointHistory {
2525
private Long id;
2626

2727
@OneToOne(fetch = FetchType.LAZY)
28-
@JoinColumn(name = "member_id", nullable = false, unique = true)
28+
@JoinColumn(name = "member_id", nullable = false)
2929
private Member member;
3030

3131
@Enumerated(EnumType.STRING)

0 commit comments

Comments
 (0)