Commit feeea077 by Guojunfeng

对接云天励飞接口-根据小图获取大图,返回人脸小图在大图中的位置、根据大图获取小图

parent a874a731
......@@ -112,5 +112,53 @@ public class YtlfController {
}
return MapRestResult.build(500,"请求失败",null);
}
@OperLog(message = "根据小图获取大图信息,返回人脸小图在大图中的位置",operation = OperationType.QUERY)
@ApiOperation(value = "根据小图获取大图信息,返回人脸小图在大图中的位置")
@GetMapping("/getImageAndLocationByFaceId/{FaceId}")
public MapRestResult getImageAndLocationByFaceId(@PathVariable Long FaceId){
try{
String accessToken = TokenUtils.getYtgsToken();
String url = "http://26.3.12.56:8083/api/intellif/image/face/json/"+FaceId;
String Authorization = "Bearer "+accessToken;
Map header = new HashMap<String,String>();
header.put("Authorization",Authorization);
String result = null;
try {
result = HttpClient.doGet(url,header,null);
}catch (Exception e){
e.printStackTrace();
}
JSONObject jsonObject = JSONArray.parseObject(result);
return MapRestResult.build(200,"成功根据小图获取大图信息,返回人脸小图在大图中的位置",jsonObject);
}catch (Exception e){
e.printStackTrace();
}
return MapRestResult.build(500,"请求失败",null);
}
@OperLog(message = "根据大图id获取所有小图信息,这里的id来自上传图片接口返回的id",operation = OperationType.QUERY)
@ApiOperation(value = "根据大图id获取所有小图信息,这里的id来自上传图片接口返回的id")
@GetMapping("/getImageByBigImageId/{BigImageId}")
public MapRestResult getImageByBigImageId(@PathVariable Long BigImageId){
try{
String accessToken = TokenUtils.getYtgsToken();
String url = "http://26.3.12.56:8083/api/intellif/face/image/"+BigImageId;
String Authorization = "Bearer "+accessToken;
Map header = new HashMap<String,String>();
header.put("Authorization",Authorization);
String result = null;
try {
result = HttpClient.doGet(url,header,null);
}catch (Exception e){
e.printStackTrace();
}
JSONObject jsonObject = JSONArray.parseObject(result);
return MapRestResult.build(200,"成功根据大图id获取所有小图信息,这里的id来自上传图片接口返回的id",jsonObject);
}catch (Exception e){
e.printStackTrace();
}
return MapRestResult.build(500,"请求失败",null);
}
}
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