|
@@ -124,9 +124,11 @@ import org.apache.commons.lang3.ArrayUtils;
|
|
import org.apache.commons.lang3.RandomStringUtils;
|
|
import org.apache.commons.lang3.RandomStringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
import javax.imageio.ImageIO;
|
|
@@ -3955,5 +3957,57 @@ public class ApiController {
|
|
return R.failed(adRecordService.save(record));
|
|
return R.failed(adRecordService.save(record));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取e-token
|
|
|
|
+ * <p>
|
|
|
|
+ * 每人每天最多获取5次
|
|
|
|
+ *
|
|
|
|
+ * @return e-token
|
|
|
|
+ */
|
|
|
|
+ @GetMapping(value = "/eid")
|
|
|
|
+ public R<?> getEidToken(@RequestParam(value = "idCard") String idCard,
|
|
|
|
+ @RequestParam(value = "realName") String realName,
|
|
|
|
+ @RequestParam(value = "endType") String endType){
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ String tokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/eid?idCard={idCard}&realName={realName}&endType={endType}";
|
|
|
|
+
|
|
|
|
+ ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(tokenUrl, String.class, idCard,realName, endType);
|
|
|
|
+
|
|
|
|
+ log.info("获取e-token:{}", tokenResult.getBody());
|
|
|
|
+
|
|
|
|
+ cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(tokenResult.getBody());
|
|
|
|
+
|
|
|
|
+ return R.builder().code(jsonObject.getInt("code")).msg(jsonObject.getStr("msg")).data(jsonObject.getStr("data")).build();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取合身视频结果
|
|
|
|
+ *
|
|
|
|
+ * @param token e-token
|
|
|
|
+ * @return 合身视频结果
|
|
|
|
+ */
|
|
|
|
+ @GetMapping(value = "/eid/result")
|
|
|
|
+ public R<?> getEidResult(@RequestParam(value = "token") String token,
|
|
|
|
+ @RequestParam(value = "endType") String endType){
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ String tokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/eid/result?token={token}&endType={endType}";
|
|
|
|
+
|
|
|
|
+ ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(tokenUrl, String.class, token, endType);
|
|
|
|
+
|
|
|
|
+ log.info("获取e-token认证结果:{}", tokenResult.getBody());
|
|
|
|
+
|
|
|
|
+ cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(tokenResult.getBody());
|
|
|
|
+
|
|
|
|
+ return R.builder().code(jsonObject.getInt("code")).msg(jsonObject.getStr("msg")).data(jsonObject.getObj("data")).build();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|