Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
92f57363
提交
92f57363
authored
3月 08, 2020
作者:
马晨俊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mcj:更新git上传接口
上级
245fec19
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
4 行删除
+13
-4
InspectController.java
...n/java/com/zjty/inspect/controller/InspectController.java
+6
-2
GitLabUtil.java
src/main/java/com/zjty/inspect/utils/GitLabUtil.java
+7
-2
没有找到文件。
src/main/java/com/zjty/inspect/controller/InspectController.java
浏览文件 @
92f57363
...
...
@@ -125,7 +125,7 @@ public class InspectController {
@PostMapping
(
"/git"
)
@ApiOperation
(
"git下载代码进行评估"
)
public
ResponseEntity
inspect1
(
@RequestBody
InspectParameter
inspectParameter
)
{
String
path
=
GitLabUtil
.
downLoadProject
(
inspectParameter
.
getGitAddress
()
,
inspectParameter
.
getGitName
()
);
String
path
=
GitLabUtil
.
downLoadProject
(
inspectParameter
.
getGitAddress
());
inspectParameter
.
setId
(
UUIDUtil
.
getUUID
());
inspectParameter
.
setSourceAddress
(
path
);
ReportVo
reportVo
=
new
ReportVo
();
...
...
@@ -378,7 +378,11 @@ public class InspectController {
}
@PostMapping
(
"/uploads"
)
private
ResponseEntity
uploads
(
@RequestParam
(
value
=
"file"
)
MultipartFile
multfile
){
private
ResponseEntity
uploads
(
@RequestParam
(
value
=
"file"
)
MultipartFile
multfile
,
String
gitAddress
){
if
(
gitAddress
!=
null
){
String
gitPath
=
GitLabUtil
.
downLoadProject
(
gitAddress
);
return
ResponseEntity
.
ok
(
gitPath
);
}
try
{
File
file
=
FileUtil
.
saveToLocal
(
multfile
);
String
name
=
file
.
getName
();
...
...
src/main/java/com/zjty/inspect/utils/GitLabUtil.java
浏览文件 @
92f57363
...
...
@@ -16,13 +16,13 @@ import java.time.LocalDate;
@Component
public
class
GitLabUtil
{
public
static
String
downLoadProject
(
String
path
,
String
name
)
{
public
static
String
downLoadProject
(
String
path
)
{
String
name1
=
LocalDate
.
now
().
toString
();
String
[]
split1
=
UUIDUtil
.
getUUID
().
split
(
"-"
);
//String REMOTE_URL = "https://git.yfzx.zjtys.com.cn:8888/912-system/monitor/adaptation-master.git";
CloneCommand
cloneCommand
=
Git
.
cloneRepository
();
cloneCommand
.
setURI
(
path
);
File
file
=
new
File
(
"./"
+
name1
+
"/"
+
split1
[
0
]+
"/"
+
name
);
File
file
=
new
File
(
"./"
+
name1
+
"/"
+
split1
[
0
]+
"/"
);
file
.
mkdirs
();
cloneCommand
.
setDirectory
(
file
);
try
{
...
...
@@ -38,6 +38,11 @@ public class GitLabUtil {
return
file
.
getAbsolutePath
();
}
public
static
void
main
(
String
[]
args
)
{
String
hostsss
=
GitLabUtil
.
downLoadProject
(
"https://git.yfzx.zjtys.com.cn/912-system/monitor/inspect.git"
);
System
.
out
.
println
(
hostsss
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论