gagamel hace 5 años
padre
commit
aebd5aa13d

+ 4 - 10
style24.core/src/main/java/com/style24/core/biz/thirdparty/SafetyKoreaApi.java

@@ -13,8 +13,6 @@ import org.springframework.http.HttpMethod;
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
 import org.springframework.web.client.RestTemplate;
 
 import lombok.extern.slf4j.Slf4j;
@@ -55,21 +53,17 @@ public class SafetyKoreaApi {
 	 * @since 2020. 12. 1
 	 */
 	public String getKoreaCertifyNo(String goodsCd) throws Exception {
-		// Parameter
-		MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
-		params.add("conditionKey", "all");
-		params.add("conditionValue", goodsCd);
-		log.info("params: {}", params);
-
 		// Header
 		HttpHeaders headers = new HttpHeaders();
 		headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
 		headers.add("AuthKey", authKey);
 
-		URI url = URI.create(apiUrl);
+		String requestUrl = apiUrl + "?conditionKey=all&conditionValue=" + goodsCd;
+		log.info("requestUrl: {}", requestUrl);
+		URI url = URI.create(requestUrl);
 
 		// GET방식으로 호출
-		HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<MultiValueMap<String, String>>(params, headers);
+		HttpEntity<String> request = new HttpEntity<String>(headers);
 		ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.GET, request, String.class);
 		log.info("responseEntity.getStatusCode(): {} ", responseEntity.getStatusCode());