|
@@ -2,7 +2,6 @@ package com.rshy.project.hy.server;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.http.HttpRequest;
|
|
import cn.hutool.http.HttpRequest;
|
|
-import cn.hutool.http.HttpUtil;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.rshy.project.hy.baseRe.BaseException;
|
|
import com.rshy.project.hy.baseRe.BaseException;
|
|
@@ -10,7 +9,7 @@ import com.rshy.project.hy.server.dto.PersonIdentifyBodyDTO;
|
|
import com.rshy.project.hy.server.dto.PersonIdentifyDTO;
|
|
import com.rshy.project.hy.server.dto.PersonIdentifyDTO;
|
|
import com.rshy.project.hy.server.dto.PersonIdentifyImageDTO;
|
|
import com.rshy.project.hy.server.dto.PersonIdentifyImageDTO;
|
|
import com.rshy.project.hy.server.vo.PersonIdentifyVO;
|
|
import com.rshy.project.hy.server.vo.PersonIdentifyVO;
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -20,6 +19,7 @@ import org.springframework.stereotype.Component;
|
|
* @description: 省厅应用域常口库接口
|
|
* @description: 省厅应用域常口库接口
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
|
|
+@Slf4j
|
|
public class VIIDServer {
|
|
public class VIIDServer {
|
|
/**
|
|
/**
|
|
* 授权凭证请求头
|
|
* 授权凭证请求头
|
|
@@ -32,15 +32,16 @@ public class VIIDServer {
|
|
private String userIdentify;
|
|
private String userIdentify;
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
- * @param photo base64 图片
|
|
|
|
|
|
+ * @param photo base64 图片
|
|
* @param timeout
|
|
* @param timeout
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public PersonIdentifyDTO personIdentify(String photo, Integer timeout){
|
|
|
|
|
|
+ public PersonIdentifyDTO personIdentify(String photo, Integer timeout) {
|
|
PersonIdentifyBodyDTO bodyDTO = new PersonIdentifyBodyDTO().setProfileID("10111").setPriority("1");
|
|
PersonIdentifyBodyDTO bodyDTO = new PersonIdentifyBodyDTO().setProfileID("10111").setPriority("1");
|
|
bodyDTO.setFaceImageList(Lists.newArrayList(new PersonIdentifyImageDTO().setImageID("1").setData(photo).setShotTime(String.valueOf(System.currentTimeMillis())).setDeviceID("010101")));
|
|
bodyDTO.setFaceImageList(Lists.newArrayList(new PersonIdentifyImageDTO().setImageID("1").setData(photo).setShotTime(String.valueOf(System.currentTimeMillis())).setDeviceID("010101")));
|
|
|
|
+ //log.info("浙江省厅统一身份置信接口服务请求入参:{}", JSON.toJSONString(bodyDTO));
|
|
String body = HttpRequest.post(url).header(HEADERS_KEY, userIdentify).body(JSON.toJSONString(bodyDTO)).timeout(timeout).execute().body();
|
|
String body = HttpRequest.post(url).header(HEADERS_KEY, userIdentify).body(JSON.toJSONString(bodyDTO)).timeout(timeout).execute().body();
|
|
|
|
+ //log.info("浙江省厅统一身份置信接口服务响应信息:{}", body);
|
|
PersonIdentifyVO personIdentifyVO = JSON.parseObject(body, PersonIdentifyVO.class);
|
|
PersonIdentifyVO personIdentifyVO = JSON.parseObject(body, PersonIdentifyVO.class);
|
|
|
|
|
|
if (personIdentifyVO != null && !"0".equals(personIdentifyVO.getCode())) {
|
|
if (personIdentifyVO != null && !"0".equals(personIdentifyVO.getCode())) {
|