Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
EIP-Integration
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李炎
EIP-Integration
Commits
f04fc4df
提交
f04fc4df
authored
9月 13, 2021
作者:
李炎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改配置
上级
bc99a540
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
41 行增加
和
3 行删除
+41
-3
docker-compose-server.yml
docker-compose-server.yml
+3
-3
DownloadController.java
...modules/iost/API/controller/video/DownloadController.java
+38
-0
没有找到文件。
docker-compose-server.yml
浏览文件 @
f04fc4df
...
...
@@ -13,7 +13,7 @@
version
:
'
2'
services
:
eipsystem-mysql
:
image
:
1
92.168.2.144:5000
/eipsystem-mysql:latest
image
:
1
ar8696937.iok.la:22594
/eipsystem-mysql:latest
environment
:
MYSQL_ROOT_PASSWORD
:
gf^*i6%&9J83&(*kJ653F&L
restart
:
always
...
...
@@ -25,7 +25,7 @@ services:
--lower_case_table_names=1
--max_allowed_packet=128M
ports
:
-
13579
:3306
-
24680
:3306
eipsystem-redis
:
image
:
redis:5.0
...
...
@@ -35,7 +35,7 @@ services:
container_name
:
eipsystem-redis
eipsystem-system
:
image
:
1
92.168.2.144:5000
/eipsystem-system:latest
image
:
1
ar8696937.iok.la:22594
/eipsystem-system:latest
restart
:
always
container_name
:
eipsystem-system
volumes
:
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/video/DownloadController.java
0 → 100644
浏览文件 @
f04fc4df
package
org
.
jeecg
.
modules
.
iost
.
API
.
controller
.
video
;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
@Component
@Scope
(
"prototype"
)
@RequestMapping
(
"/downloadImg"
)
public
class
DownloadController
{
@RequestMapping
(
"download"
)
public
ResponseEntity
<
byte
[]>
download
(
HttpServletRequest
request
)
throws
IOException
{
//读取文件
File
file
=
new
File
(
"D:/test/DEMO.apk"
);
byte
[]
body
=
null
;
InputStream
is
=
new
FileInputStream
(
file
);
body
=
new
byte
[
is
.
available
()];
is
.
read
(
body
);
HttpHeaders
headers
=
new
HttpHeaders
();
//设置文件头
headers
.
add
(
"Content-Disposition"
,
"attchement;filename="
+
new
String
(
"火影2.jpg"
.
getBytes
(
"gb2312"
),
"ISO8859-1"
));
HttpStatus
statusCode
=
HttpStatus
.
OK
;
ResponseEntity
<
byte
[]>
entity
=
new
ResponseEntity
<
byte
[]>(
body
,
headers
,
statusCode
);
return
entity
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论