-
Notifications
You must be signed in to change notification settings - Fork 2
prod : 환불액 조회 기능 추가 및 전화번호 검증 로직 추가 #289
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
Changes from all commits
9934b7d
2521b11
0a9d3ab
6527121
5de298d
56d4ffe
445393a
c0fa37c
348ff8a
e6b5d58
0373d2b
4cba953
95e6ff8
a63a58b
91ddf3a
f783688
13a6ca9
96f7f5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,9 @@ public enum Whitelist { | |
| FAQ("/api/v1/faq", WhitelistMethod.GET), | ||
| NOTICE("/api/v1/notice", WhitelistMethod.GET), | ||
| USER_ID_CHECK("/api/v1/user/check-id", WhitelistMethod.GET), | ||
| USER_PHONE_NUMBER_CHECK("/api/v1/user/check-phone-number", WhitelistMethod.GET), | ||
|
|
||
| CUSTOMER_KEY_CHECK("/api/v1/user/customer-key", WhitelistMethod.GET), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The endpoint |
||
| EXAM("/api/v1/exam", WhitelistMethod.GET), | ||
| EXAM_AREAS("/api/v1/exam/areas", WhitelistMethod.GET), | ||
| EXAM_ALL("/api/v1/exam/all", WhitelistMethod.GET), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,16 +4,19 @@ | |
| import life.mosu.mosuserver.global.annotation.UserId; | ||
| import life.mosu.mosuserver.global.util.ApiResponseWrapper; | ||
| import life.mosu.mosuserver.presentation.refund.dto.MergedRefundRequest; | ||
| import life.mosu.mosuserver.presentation.refund.dto.RefundAmountResponse; | ||
| import life.mosu.mosuserver.presentation.refund.dto.RefundRequest; | ||
| import lombok.RequiredArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.http.HttpStatus; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.security.access.prepost.PreAuthorize; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RequestParam; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
|
|
@@ -24,6 +27,15 @@ public class RefundController { | |
|
|
||
| private final RefundService refundService; | ||
|
|
||
| @GetMapping() | ||
| ResponseEntity<ApiResponseWrapper<RefundAmountResponse>> getRefundAmount( | ||
| @RequestParam(required = true) String paymentKey, | ||
| @RequestParam(required = true) Long examApplicationId) { | ||
| var response = refundService.getRefundAmount(paymentKey, examApplicationId); | ||
| return ResponseEntity.ok( | ||
| ApiResponseWrapper.success(HttpStatus.OK, "환불 금액 조회 성공", response)); | ||
| } | ||
|
Comment on lines
+30
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new |
||
|
|
||
| @PostMapping("/{paymentKey}") | ||
| @PreAuthorize("isAuthenticated() and hasRole('USER')") | ||
| ResponseEntity<ApiResponseWrapper<Void>> process( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package life.mosu.mosuserver.presentation.refund.dto; | ||
|
|
||
| public record RefundAmountResponse( | ||
| int amount | ||
| ) { | ||
|
|
||
| public static RefundAmountResponse of(int amount) { | ||
| return new RefundAmountResponse(amount); | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package life.mosu.mosuserver.presentation.user.dto.response; | ||
|
|
||
| public record IsPhoneNumberAvailableResponse( | ||
| Boolean isPhoneNumberAvailable | ||
| ) { | ||
|
|
||
| public static IsPhoneNumberAvailableResponse from(Boolean isPhoneNumberAvailable) { | ||
| return new IsPhoneNumberAvailableResponse(isPhoneNumberAvailable); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the user lookup from
loginId(email) tophoneNumberintroduces a potential issue in theorElseGetblock (lines 31-45). If no user is found by phone number, the code proceeds to create a new user usinginfo.email()as theloginId. However, it doesn't check if a user with thatloginIdalready exists. This can lead to an unhandledDataIntegrityViolationExceptionif the email is already in use by another account (e.g., one created via standard signup). This should be handled gracefully to avoid a 500 error.