Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
Jenkins-master
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
mry
Jenkins-master
Commits
6f5d93fc
提交
6f5d93fc
authored
11月 05, 2021
作者:
mrunyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
不需要文件上传,删除了文件上传功能
上级
8f15d6bb
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
0 行增加
和
67 行删除
+0
-67
FileController.java
src/main/java/com/jenkins/controller/FileController.java
+0
-37
FileService.java
src/main/java/com/jenkins/service/FileService.java
+0
-8
FileServiceImpl.java
src/main/java/com/jenkins/service/Impl/FileServiceImpl.java
+0
-22
没有找到文件。
src/main/java/com/jenkins/controller/FileController.java
deleted
100644 → 0
浏览文件 @
8f15d6bb
package
com
.
jenkins
.
controller
;
import
com.jenkins.service.FileService
;
import
com.jenkins.vo.FileVo
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.nio.channels.MulticastChannel
;
@CrossOrigin
@RestController
@RequestMapping
(
"/files"
)
@Api
(
tags
=
"添加文件"
,
description
=
"上床文件到本地"
)
public
class
FileController
{
private
final
FileService
fileService
;
public
FileController
(
FileService
fileService
)
{
this
.
fileService
=
fileService
;
}
@PostMapping
public
ResponseEntity
<
FileVo
>
upload
(
MultipartFile
file
){
FileVo
fileVo
=
fileService
.
upload
(
file
);
if
(
fileVo
==
null
){
return
ResponseEntity
.
status
(
404
).
body
(
fileVo
);
}
else
{
return
ResponseEntity
.
ok
(
fileVo
);
}
}
}
src/main/java/com/jenkins/service/FileService.java
deleted
100644 → 0
浏览文件 @
8f15d6bb
package
com
.
jenkins
.
service
;
import
com.jenkins.vo.FileVo
;
import
org.springframework.web.multipart.MultipartFile
;
public
interface
FileService
{
FileVo
upload
(
MultipartFile
file
);
}
src/main/java/com/jenkins/service/Impl/FileServiceImpl.java
deleted
100644 → 0
浏览文件 @
8f15d6bb
package
com
.
jenkins
.
service
.
Impl
;
import
com.jenkins.service.FileService
;
import
com.jenkins.vo.FileVo
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
@Service
public
class
FileServiceImpl
implements
FileService
{
@Value
(
"${file.localDirPath}"
)
private
String
localDirPath
;
//本地磁盘地址
@Override
public
FileVo
upload
(
MultipartFile
file
)
{
String
fileName
=
file
.
getOriginalFilename
();
fileName
=
fileName
.
toLowerCase
();
//文件名称全小写
return
null
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论