Skip to content

Commit

Permalink
[FIX] 계좌 생성 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
csb9427 committed Aug 28, 2024
1 parent 56b0861 commit b347531
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public class AccountService {
@Value("${api.key}")
private String apiKey;

// 계좌 생성 메서드
public AccountCreateResponse createAccount(AccountCreateRequest request, String userKey, Long memberId) throws JsonProcessingException {
// 외부 API를 통해 계좌를 생성
String accountNo = callCreateAccountApi(request, userKey);
Expand All @@ -59,7 +58,6 @@ public AccountCreateResponse createAccount(AccountCreateRequest request, String
Account account = Account.builder()
.accountTitle(request.getAccountTitle())
.accountNumber(accountNo)
.accountColor(request.getAccountColor())
.member(member)
.build();

Expand All @@ -69,7 +67,6 @@ public AccountCreateResponse createAccount(AccountCreateRequest request, String
return AccountCreateResponse.builder()
.accountNumber(savedAccount.getAccountNumber())
.accountTitle(savedAccount.getAccountTitle())
.accountColor(savedAccount.getAccountColor())
.build();
}

Expand Down Expand Up @@ -133,8 +130,6 @@ private String callCreateAccountApi(AccountCreateRequest request, String userKey
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyyMMdd");
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HHmmss");

String accountTypeUniqueNo = "001-1-82fe5fa7eca441";

// Header 생성
Map<String, String> header = new HashMap<>();
header.put("apiName", "createDemandDepositAccount");
Expand All @@ -151,9 +146,7 @@ private String callCreateAccountApi(AccountCreateRequest request, String userKey
Map<String, Object> body = new HashMap<>();
body.put("Header", header);
body.put("accountTitle", request.getAccountTitle());
body.put("accountImage", request.getAccountImage());
body.put("accountColor", request.getAccountColor());
body.put("accountTypeUniqueNo", accountTypeUniqueNo);
body.put("accountTypeUniqueNo", request.getAccountTypeUniqueNo());

// HttpHeaders 설정
HttpHeaders headers = new HttpHeaders();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@
@NoArgsConstructor
public class AccountCreateRequest {
private String accountTitle;
private String accountImage;
private String accountColor;
private String accountNumber;
private String accountTypeUniqueNo;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@
public class AccountCreateResponse {
private String accountNumber;
private String accountTitle;
private String accountImage;
private String accountColor;
}

0 comments on commit b347531

Please sign in to comment.