Update src/main/java/com/wb/domainserver/acikey/AciKeyTokenTasklet.java
This commit is contained in:
@@ -10,6 +10,7 @@ import org.springframework.http.*;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
// ACIKey 토큰 발급 테스트 배치 - API 호출 및 토큰 확인 로직
|
// ACIKey 토큰 발급 테스트 배치 - API 호출 및 토큰 확인 로직
|
||||||
@@ -42,15 +43,16 @@ public class AciKeyTokenTasklet implements Tasklet {
|
|||||||
HttpEntity<String> requestEntity = new HttpEntity<>("{}", headers);
|
HttpEntity<String> requestEntity = new HttpEntity<>("{}", headers);
|
||||||
|
|
||||||
// API 호출
|
// API 호출
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
ResponseEntity<String> response = restTemplate.exchange(
|
||||||
ResponseEntity<Map> response = restTemplate.exchange(
|
|
||||||
aciKeyUrl,
|
aciKeyUrl,
|
||||||
HttpMethod.POST,
|
HttpMethod.POST,
|
||||||
requestEntity,
|
requestEntity,
|
||||||
Map.class
|
String.class
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, Object> body = response.getBody();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
Map<String, Object> body = objectMapper.readValue(response.getBody(), Map.class);
|
||||||
|
|
||||||
log.info("[AciKeyBatch] 응답 전체: {}", body);
|
log.info("[AciKeyBatch] 응답 전체: {}", body);
|
||||||
|
|
||||||
String status = (String) body.get("Status");
|
String status = (String) body.get("Status");
|
||||||
|
|||||||
Reference in New Issue
Block a user