评分修改
This commit is contained in:
parent
b45d9dfb21
commit
cd75081b99
@ -33,10 +33,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static com.arcsoft.face.toolkit.ImageFactory.getRGBData;
|
import static com.arcsoft.face.toolkit.ImageFactory.getRGBData;
|
||||||
import static com.zhgd.xmgl.config.FaceRunner.faceEngine;
|
import static com.zhgd.xmgl.config.FaceRunner.faceEngine;
|
||||||
@ -107,6 +104,7 @@ public class UfaceRecognitionController {
|
|||||||
@ApiOperation(value = "海康检测人脸评分", notes = "海康检测人脸评分", httpMethod = "POST")
|
@ApiOperation(value = "海康检测人脸评分", notes = "海康检测人脸评分", httpMethod = "POST")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "fileUrl", value = "照片路径", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "fileUrl", value = "照片路径", paramType = "body", required = true, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "type", value = "1url、2base64", paramType = "body", required = false, dataType = "Integer"),
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/checkfaceHikvision")
|
@PostMapping(value = "/checkfaceHikvision")
|
||||||
public Result<Map<String, Object>> checkfaceHikvision(@RequestBody Map<String, Object> map) throws Exception {
|
public Result<Map<String, Object>> checkfaceHikvision(@RequestBody Map<String, Object> map) throws Exception {
|
||||||
@ -119,14 +117,14 @@ public class UfaceRecognitionController {
|
|||||||
}
|
}
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
String fileUrl = MapUtils.getString(map, "fileUrl");
|
String fileUrl = MapUtils.getString(map, "fileUrl");
|
||||||
String facePicBinaryData = MapUtils.getString(map, "facePicBinaryData");
|
if (StrUtil.isBlank(fileUrl)) {
|
||||||
if (StrUtil.isBlank(fileUrl) && StrUtil.isBlank(facePicBinaryData)) {
|
throw new OpenAlertException("fileUrl不能为空");
|
||||||
throw new OpenAlertException("fileUrl和facePicBinaryData不能同时为空");
|
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(fileUrl)) {
|
Integer type = MapUtils.getInteger(map, "type");
|
||||||
param.put("facePicUrl", PathUtil.reviseSlash(imageUrlPrefix + "/" + fileUrl));
|
if (Objects.equals(type, 2)) {
|
||||||
} else {
|
|
||||||
param.put("facePicBinaryData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(basePath + "/" + fileUrl)));
|
param.put("facePicBinaryData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(basePath + "/" + fileUrl)));
|
||||||
|
} else {
|
||||||
|
param.put("facePicUrl", PathUtil.reviseSlash(imageUrlPrefix + "/" + fileUrl));
|
||||||
}
|
}
|
||||||
boolean b = hikvisionCall.faceScore(project, param);
|
boolean b = hikvisionCall.faceScore(project, param);
|
||||||
//boolean b = true;
|
//boolean b = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user