|
@@ -0,0 +1,47 @@
|
|
|
+package com.nokia.domainb.capability;
|
|
|
+
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.UUID;
|
|
|
+
|
|
|
+import com.nokia.domainb.util.AESUtil;
|
|
|
+
|
|
|
+import cn.chinaunicom.open.common.Const;
|
|
|
+import cn.chinaunicom.open.nlgxptconnection.COMPConnection;
|
|
|
+import cn.chinaunicom.open.nlgxptconnection.COMPConnectionContext;
|
|
|
+import cn.chinaunicom.open.nlgxptconnection.impl.COMPJsonConnection;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 智能客服一线定界结果查询接口
|
|
|
+ * json_chinaUnicom_hb18_complaintManagement_northFirstLine
|
|
|
+ * 智能客服支撑北一接口的v2版本
|
|
|
+ */
|
|
|
+public class NorthFirstLine extends AbstractQuery {
|
|
|
+ // 上线后记得找一下正式url
|
|
|
+ private static final String url = "";
|
|
|
+ private static final String urlTest = "http://10.124.150.230:8000/api/chinaUnicom/hb18/complaintManagement/northFirstLine/v1";
|
|
|
+
|
|
|
+ public COMPConnectionContext query(String phoneNumber, boolean test) throws Exception {
|
|
|
+ String realAppSecret = test ? appSecretTest : appSecret;
|
|
|
+ String realUrl = test ? urlTest : url;
|
|
|
+ COMPConnection compConnection = new COMPJsonConnection(appId, realAppSecret);
|
|
|
+
|
|
|
+ // REQ
|
|
|
+ Map<String, Object> req = new HashMap<>();
|
|
|
+
|
|
|
+ Map<String, Object> insideReq = new HashMap<>();
|
|
|
+ req.put("NORTH_FIRST_LINE_REQ", insideReq);
|
|
|
+
|
|
|
+ insideReq.put("phone", phoneNumber);
|
|
|
+ insideReq.put("reqid", UUID.randomUUID().toString());
|
|
|
+
|
|
|
+ String str = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + "_test";
|
|
|
+ String key = "qg4uY8byXoC5UXtB";
|
|
|
+ String loginid = AESUtil.Encrypt(str, key);
|
|
|
+ insideReq.put("loginid", loginid);
|
|
|
+
|
|
|
+ return compConnection.excute(Const.HttpMethodType.POST, realUrl, req, false);
|
|
|
+ }
|
|
|
+}
|