@RequestMapping("/getoplogphotoimg")
@ResponseBody
public String getoplogphotoimg(HttpServletRequest request, HttpServletResponse response) throws Exception{
String photoId = request.getParameter("photoid");
OutputStream out = null;
try {
InspectOpLogPhoto photo = this.opLogService.queryOpLogPhotoData(photoId);
if (photo == null){
return null;
}
response.setContentType(ImageUtils.getImageContentType(photo.getImagetype(), ImageUtils.DEFAULT_IMAGE_CONTENTTYPE));
out = response.getOutputStream();
out.write(photo.getPhoto());
out.flush();
} catch(Exception e){
logger.error("getoplogphotoimg failed: "+photoId, e);
} finally {
IOUtils.closeQuietly(out);
}
return null;
}
IOUtils.closeQuietly();
最新推荐文章于 2023-01-29 16:56:12 发布