Commit 0d94b29d authored by 黎博's avatar 黎博

将上传ocr及提交授信的域名改成by namespace

parent 3ecfef88
......@@ -108,6 +108,39 @@ public class Vcc {
log.info("上传身份证正面结果:" + result);
}
/**
* 身份证正面-namespace
*/
public static void uploadFrontIdCardNew(String namespace, String vccToken, String uuid, String vccChannel) throws IOException {
String url = "https://auth-" + namespace + ".liangkebang.net/auth-center/h5/api/ocr/auth_sdk.json";
Map<String, Object> headers = new HashMap<>();
headers.put("x-auth-token", vccToken);
// 待参数化
headers.put("vccchannel", vccChannel);
headers.put("content-type", "application/x-www-form-urlencoded");
Map<String, Object> params = new HashMap<>();
Map<String, Object> map = new HashMap<>();
map.put("clarity", 74);
map.put("multiWarning", "00010010");
map.put("birth", "19900104");
map.put("nation", "汉");
map.put("type", "xyqb");
map.put("code", 0);
map.put("isShootPagePortrait", true);
map.put("address", "北京市海淀区码农村22号");
map.put("idNo", "320101199001040432");
map.put("orderNo", uuid.concat("1"));
map.put("warning", "00010000");
map.put("msg", "OCR获取成功");
map.put("name", "张三");
map.put("sex", "男");
String frontBase64Str = Vcc.readTxt("front.txt");
map.put("base64Str", frontBase64Str);
params.put("idCard", JSON.toJSONString(map));
JSONObject result = HttpClientUtils.doPost(url, params, headers);
log.info("上传身份证正面结果:" + result);
}
/**
* 身份证反面
*/
......@@ -137,6 +170,35 @@ public class Vcc {
log.info("上传身份证反面:" + result);
}
/**
* 上传身份证反面-namespace
*/
public static void uploadBackIdCardNew(String namespace, String vccToken, String uuid, String vccChannel) throws IOException{
String url = "https://auth-" + namespace + ".liangkebang.net/auth-center/h5/api/ocr/auth_sdk.json";
Map<String, Object> headers = new HashMap<>();
headers.put("x-auth-token", vccToken);
// 待参数化
headers.put("vccchannel", vccChannel);
headers.put("content-type", "application/x-www-form-urlencoded");
Map<String, Object> params = new HashMap<>();
Map<String, Object> map = new HashMap<>();
map.put("validDate", "20051008-20251008");
map.put("authority", "上海市公安局徐汇分局");
map.put("isShootPagePortrait", false);
map.put("code", 0);
map.put("orderNo", uuid.concat("2"));
map.put("clarity", 60);
map.put("msg", "OCR获取成功");
map.put("type", "xyqb");
map.put("warning", "00010000");
map.put("multiWarning", "00010000");
String backBase64Str = Vcc.readTxt("back.txt");
map.put("base64Str", backBase64Str);
params.put("idCard", JsonTransUtils.mapToJson(map));
JSONObject result = HttpClientUtils.doPost(url, params, headers);
log.info("上传身份证反面:" + result);
}
/**
* 避免身份证重复,修改
*/
......@@ -178,6 +240,22 @@ public class Vcc {
log.info("提交OCR:" + result);
}
/**
* 提交ocr-namespace
*/
public static void submitOcrNew(String namespace, String vccToken, String vccChannel) {
String url = "https://auth-" + namespace + ".liangkebang.net/auth-center/h5/api/ocr/submit.json";
Map<String, Object> headers = new HashMap<>();
Map<String, Object> params = new HashMap<>();
headers.put("x-auth-token", vccToken);
headers.put("vccchannel", vccChannel);
headers.put("content-type", "application/x-www-form-urlencoded");
params.put("real_name", "张三");
params.put("id_card_no", "320101199001040432");
JSONObject result = HttpClientUtils.doPost(url, params, headers);
log.info("提交OCR:" + result);
}
/**
* 提交授信
*/
......
......@@ -83,15 +83,18 @@ public class VccDataServiceImpl implements VccDataService {
// credit url
String vccToken = Vcc.creditUrl(namespace, token, vccChannel);
// 身份证正面
Vcc.uploadFrontIdCard(vccToken, uuid, vccChannel);
// Vcc.uploadFrontIdCard(vccToken, uuid, vccChannel);
Vcc.uploadFrontIdCardNew(namespace, vccToken, uuid, vccChannel);
// 身份证反面
Vcc.uploadBackIdCard(vccToken, uuid, vccChannel);
// Vcc.uploadBackIdCard(vccToken, uuid, vccChannel);
Vcc.uploadBackIdCardNew(namespace, vccToken, uuid, vccChannel);
// 放置身份证重复
Vcc.modifyExistIdNo(namespace);
// talos保存用户信息
Vcc.saveUserDetails(namespace, token, vccChannel);
// 提交ocr
Vcc.submitOcr(vccToken, vccChannel);
// Vcc.submitOcr(vccToken, vccChannel);
Vcc.submitOcrNew(namespace, vccToken, vccChannel);
// 提交授信
Vcc.submitCredit(namespace, token, vccChannel);
// 授信结果查询
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment