提交 36e4bcc2 authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 b05efc3e
......@@ -272,10 +272,7 @@ public class FileController {
filePath = entity.getPath() + "/" + entity.getFileName()+ entity.getSuffixName();;
}
}
}
}
File f = new File(rootPath + filePath);
logger.info(rootPath + filePath);
......@@ -283,7 +280,6 @@ public class FileController {
if (!f.exists()) {
throw new BaseException("没有找到该文件!");
}
response.reset(); // 非常重要
if (isOnLine) { // 在线打开方式
DownloadUtil.startOpen(response, realFile);
......@@ -812,14 +808,14 @@ public class FileController {
}
return vo;
}
@ApiOperation(value = "生成缩略图")
@RequestMapping(value = "/images", method = RequestMethod.GET)
public CallBack<Integer> getImages() {
int i=0;
public void getImages() {
try {
float width = 165;
float height = 215;
System.out.println("222222222222222222222222222222222222");
int i=0;
BufferedImage image = null;
BufferedImage bfImage = null;
FileOutputStream os = null;
......@@ -834,7 +830,7 @@ public class FileController {
logger.info("没找到图片路径"+filePath);
continue;
}
logger.info("图片存放路径:"+filePath);
logger.info(filePath);
/**
* 设置图片路径
*/
......@@ -874,8 +870,7 @@ public class FileController {
bfImage.getGraphics().drawImage(image.getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH), 0, 0, null);
os = new FileOutputStream(newPath);
ImageIO.write(bfImage, "jpeg", os);
i++;
System.out.println(i);
logger.info("生成数量:"+ i++);
os.flush();
os.close();
}
......@@ -884,7 +879,6 @@ public class FileController {
System.out.println("创建缩略图发生异常" + e.getMessage());
e.printStackTrace();
}
return CallBack.success(i);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论