|
@@ -35,15 +35,20 @@ public class GetPicture {
|
|
|
@RequestMapping("/get")
|
|
|
public void getCarRecord(HttpServletRequest request, HttpServletResponse response ,
|
|
|
@RequestParam(name = "fileUrl" ,required = false) String fileUrl,
|
|
|
- @RequestParam(name = "alarmPicture", required = false) String alarmPicture
|
|
|
+ @RequestParam(name = "alarmPicture", required = false) String alarmPicture,
|
|
|
+ @RequestParam(name = "path", required = false) String path
|
|
|
) throws IOException, ClientException {
|
|
|
String url;
|
|
|
IClient iClient = new DefaultClient();
|
|
|
//如果 fileURL不为空 就认为是拿摄像头抓拍图片
|
|
|
if(StringUtilsWork.isNotEmpty(fileUrl)){
|
|
|
url =IPAndPort+"/evo-apigw/"+fileUrl;
|
|
|
+ }else if(StringUtilsWork.isNotEmpty(path)){
|
|
|
+ //档案的图片
|
|
|
+ IccTokenResponse.IccToken token = iClient.getAccessToken(IccProfile.grantType);
|
|
|
+ url =IPAndPort+"/evo-pic/"+path+"?token="+token.getAccess_token()+"&oss_addr=172.16.3.223:9876";
|
|
|
}else {
|
|
|
- //IccProfile 授权类型,根据你的初始化使用的password,client_credentials
|
|
|
+ //事件的图片
|
|
|
IccTokenResponse.IccToken token = iClient.getAccessToken(IccProfile.grantType);
|
|
|
url =IPAndPort+"/evo-pic/"+alarmPicture+"?token="+token.getAccess_token()+"&oss_addr=172.16.3.223:8925";
|
|
|
}
|