Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
DolphinScheduler
提交
0963640e
DolphinScheduler
项目概览
apache
/
DolphinScheduler
上一次同步 1 年多
通知
704
Star
9572
Fork
3514
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
0963640e
编写于
1月 19, 2021
作者:
青
青年
提交者:
GitHub
1月 19, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Improvement-#4481][API] ProcessDefinitionController save API optimization
Co-authored-by:
N
lei.zou
<
lei.zou@rootcloud.com
>
上级
690e4eae
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
40 deletion
+4
-40
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
...eduler/api/service/impl/ProcessDefinitionServiceImpl.java
+3
-39
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionControllerTest.java
...duler/api/controller/ProcessDefinitionControllerTest.java
+1
-1
未找到文件。
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
浏览文件 @
0963640e
...
...
@@ -221,9 +221,8 @@ public class ProcessDefinitionServiceImpl extends BaseService implements
processDefineMapper
.
updateVersionByProcessDefinitionId
(
processDefine
.
getId
(),
version
);
// return processDefinition object with ID
result
.
put
(
Constants
.
DATA_LIST
,
processDefine
Mapper
.
selectById
(
processDefine
.
getId
()
));
result
.
put
(
Constants
.
DATA_LIST
,
processDefine
.
getId
(
));
putMsg
(
result
,
Status
.
SUCCESS
);
result
.
put
(
PROCESSDEFINITIONID
,
processDefine
.
getId
());
return
result
;
}
...
...
@@ -888,8 +887,8 @@ public class ProcessDefinitionServiceImpl extends BaseService implements
//create process definition
Integer
processDefinitionId
=
Objects
.
isNull
(
createProcessResult
.
get
(
PROCESSDEFINITIONID
))
?
null
:
Integer
.
parseInt
(
createProcessResult
.
get
(
PROCESSDEFINITIONID
).
toString
());
Objects
.
isNull
(
createProcessResult
.
get
(
Constants
.
DATA_LIST
))
?
null
:
Integer
.
parseInt
(
createProcessResult
.
get
(
Constants
.
DATA_LIST
).
toString
());
//scheduler param
return
getImportProcessScheduleResult
(
loginUser
,
...
...
@@ -1516,41 +1515,6 @@ public class ProcessDefinitionServiceImpl extends BaseService implements
}
}
/**
* copy process definition
*
* @param loginUser login user
* @param projectName project name
* @param processId process definition id
* @return copy result code
*/
public
Map
<
String
,
Object
>
copyProcessDefinition
(
User
loginUser
,
String
projectName
,
Integer
processId
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
Project
project
=
projectMapper
.
queryByName
(
projectName
);
Map
<
String
,
Object
>
checkResult
=
projectService
.
checkProjectAndAuth
(
loginUser
,
project
,
projectName
);
Status
resultStatus
=
(
Status
)
checkResult
.
get
(
Constants
.
STATUS
);
if
(
resultStatus
!=
Status
.
SUCCESS
)
{
return
checkResult
;
}
ProcessDefinition
processDefinition
=
processDefineMapper
.
selectById
(
processId
);
if
(
processDefinition
==
null
)
{
putMsg
(
result
,
Status
.
PROCESS_DEFINE_NOT_EXIST
,
processId
);
return
result
;
}
else
{
return
createProcessDefinition
(
loginUser
,
projectName
,
processDefinition
.
getName
()
+
"_copy_"
+
System
.
currentTimeMillis
(),
processDefinition
.
getProcessDefinitionJson
(),
processDefinition
.
getDescription
(),
processDefinition
.
getLocations
(),
processDefinition
.
getConnects
());
}
}
/**
* batch copy process definition
*
...
...
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionControllerTest.java
浏览文件 @
0963640e
...
...
@@ -94,7 +94,7 @@ public class ProcessDefinitionControllerTest {
String
connects
=
"[]"
;
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
putMsg
(
result
,
Status
.
SUCCESS
);
result
.
put
(
"processDefinitionId"
,
1
);
result
.
put
(
Constants
.
DATA_LIST
,
1
);
Mockito
.
when
(
processDefinitionService
.
createProcessDefinition
(
user
,
projectName
,
name
,
json
,
description
,
locations
,
connects
)).
thenReturn
(
result
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录