Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
szsy
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
szsy
Commits
36e4bcc2
提交
36e4bcc2
authored
1月 27, 2021
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
b05efc3e
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
5 行增加
和
11 行删除
+5
-11
FileController.java
...rc/main/java/com/zrqx/file/controller/FileController.java
+5
-11
没有找到文件。
app/file/src/main/java/com/zrqx/file/controller/FileController.java
浏览文件 @
36e4bcc2
...
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论