Skip to content
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

[FIX] 내 계좌 정보 조회하기 response body값 수정 #88

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,13 @@ public AccountInfoResponse getAccountInfo(Long memberId, String userKey) throws
if (!optionalAccount.isPresent()) {
throw new RuntimeException("해당 회원의 계좌를 찾을 수 없습니다.");
}

String accountTitle = optionalAccount.get().getAccountTitle();
String accountNumber = optionalAccount.get().getAccountNumber();

// 2. 외부 API를 통해 계좌 잔액 조회
Map<String, Object> responseMap = callInquireAccountBalanceApi(accountNumber, userKey);

String balance = (String) responseMap.get("accountBalance");
int accountBalance = Integer.parseInt((String) responseMap.get("accountBalance"));
String accountCode = (String) responseMap.get("accountCode");

// 3. 계좌 코드와 매핑된 계좌 이름 가져오기
Expand All @@ -311,8 +311,9 @@ public AccountInfoResponse getAccountInfo(Long memberId, String userKey) throws

// 4. 응답 데이터 생성
return AccountInfoResponse.builder()
.accountTitle(accountTitle)
.accountNumber(accountNumber)
.balance(balance)
.accountBalance(accountBalance)
.bankName(accountName)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
@Data
@Builder
public class AccountInfoResponse {
private String accountTitle;
private String accountNumber;
private String balance;
private int accountBalance;
private String bankName;
}
Loading