NiceOn 업무요청 수정

This commit is contained in:
jaewohong
2025-12-19 16:19:35 +09:00
parent 0aa9dbee6f
commit 409dafa475
@@ -7,6 +7,7 @@ import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -729,7 +730,8 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
private void setNiceOnAuthHeaders(HttpUriRequestBase method, String auth) throws Exception {
method.setHeader("Authorization",
String.format("%s %s", AccessTokenVO.BEARER_TYPE, auth)); // 나이스지키미 format임
method.setHeader("ProductID", "2303345072");
String productId = PropManager.getInstance().getProperty("NiceOnProperty","productId.value");
method.setHeader("ProductID", productId);
//method.setHeader("Authorization",
// String.format("%s %s", AccessTokenVO.BEARER_TYPE, accessToken.getAccessToken()));
}
@@ -1101,11 +1103,27 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
//break;
}
Map<String, Object> map = new HashMap<>();
map.put(encryptedJsonKey, encryptedMessage);
JSONObject json = new JSONObject();
json.putAll(map);
return json.toJSONString();
if (encryptAlgorithm.equals("AES256-NICEON")) {
String goodsCls = PropManager.getInstance().getProperty("NiceOnProperty","goods.cls.value");
Map<String, Object> map = new HashMap<>();
SimpleDateFormat sdfDateTime =new SimpleDateFormat("yyyyMMddHHmmss");
map.put("req_dtm", sdfDateTime);
map.put("goods_cls", goodsCls);
map.put(encryptedJsonKey, encryptedMessage);
JSONObject dataBody = new JSONObject();
dataBody.putAll(map);
JSONObject json = new JSONObject();
json.put("dataBody", dataBody);
return json.toJSONString();
} else {
Map<String, Object> map = new HashMap<>();
map.put(encryptedJsonKey, encryptedMessage);
JSONObject json = new JSONObject();
json.putAll(map);
return json.toJSONString();
}
//return encryptedMessage;
}
@@ -1303,7 +1321,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
jsonKey = "encryptedData";
break;
case "AES256-NICEON":
jsonKey = "preScreeningRequest";
jsonKey = "enc_data";
break;
case "AES256GCM":
break;