Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
e0f6b694
提交
e0f6b694
authored
3月 01, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(web): 修改了部分bug
上级
b6fff3b6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
7 行增加
和
3 行删除
+7
-3
MoveController.java
...n/java/org/matrix/autotest/controller/MoveController.java
+4
-2
TestCaseController.java
...va/org/matrix/autotest/controller/TestCaseController.java
+3
-1
没有找到文件。
kt-web/src/main/java/org/matrix/autotest/controller/MoveController.java
浏览文件 @
e0f6b694
...
@@ -13,6 +13,7 @@ import org.matrix.database.vo.CommonResultObj;
...
@@ -13,6 +13,7 @@ import org.matrix.database.vo.CommonResultObj;
import
org.matrix.database.vo.MoveAction
;
import
org.matrix.database.vo.MoveAction
;
import
org.matrix.exception.GlobalException
;
import
org.matrix.exception.GlobalException
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -125,6 +126,7 @@ public class MoveController {
...
@@ -125,6 +126,7 @@ public class MoveController {
*/
*/
@ApiOperation
(
value
=
"修改行为以及动作"
)
@ApiOperation
(
value
=
"修改行为以及动作"
)
@PutMapping
@PutMapping
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
<
CommonResultObj
<
MoveAction
>>
updateMoveAction
(
@RequestBody
MoveAction
moveAction
)
{
public
ResponseEntity
<
CommonResultObj
<
MoveAction
>>
updateMoveAction
(
@RequestBody
MoveAction
moveAction
)
{
Boolean
update
=
Optional
.
of
(
moveService
.
updateById
(
moveAction
.
getMove
()))
Boolean
update
=
Optional
.
of
(
moveService
.
updateById
(
moveAction
.
getMove
()))
.
orElseThrow
(
GlobalException:
:
new
);
.
orElseThrow
(
GlobalException:
:
new
);
...
@@ -136,8 +138,8 @@ public class MoveController {
...
@@ -136,8 +138,8 @@ public class MoveController {
action
->
action
.
setMoveId
(
id
)
action
->
action
.
setMoveId
(
id
)
);
);
Boolean
saveOrUpdate
=
Optional
.
of
(
actionService
.
saveOrUpdateBatch
(
moveAction
.
getAction
()))
Boolean
saveOrUpdate
=
Optional
.
of
(
actionService
.
saveOrUpdateBatch
(
moveAction
.
getAction
()))
.
orElseThrow
(()
->
new
GlobalException
(
"
修改
失败"
));
.
orElseThrow
(()
->
new
GlobalException
(
"失败"
));
return
update
&&
saveOrUpdate
return
update
?
CommonResult
.
success
(
moveAction
,
"修改成功"
)
?
CommonResult
.
success
(
moveAction
,
"修改成功"
)
:
CommonResult
.
failed
(
moveAction
,
"修改失败"
);
:
CommonResult
.
failed
(
moveAction
,
"修改失败"
);
}
}
...
...
kt-web/src/main/java/org/matrix/autotest/controller/TestCaseController.java
浏览文件 @
e0f6b694
...
@@ -14,6 +14,7 @@ import org.matrix.database.vo.MoveAction;
...
@@ -14,6 +14,7 @@ import org.matrix.database.vo.MoveAction;
import
org.matrix.database.vo.TestCaseData
;
import
org.matrix.database.vo.TestCaseData
;
import
org.matrix.exception.GlobalException
;
import
org.matrix.exception.GlobalException
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -127,6 +128,7 @@ public class TestCaseController {
...
@@ -127,6 +128,7 @@ public class TestCaseController {
*/
*/
@ApiOperation
(
value
=
"修改用例以及数据组"
)
@ApiOperation
(
value
=
"修改用例以及数据组"
)
@PutMapping
@PutMapping
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
<
CommonResultObj
<
TestCaseData
>>
updateTestCaseData
(
@RequestBody
TestCaseData
testCaseData
)
{
public
ResponseEntity
<
CommonResultObj
<
TestCaseData
>>
updateTestCaseData
(
@RequestBody
TestCaseData
testCaseData
)
{
Boolean
update
=
Optional
.
of
(
testCaseService
.
updateById
(
testCaseData
.
getTestCase
()))
Boolean
update
=
Optional
.
of
(
testCaseService
.
updateById
(
testCaseData
.
getTestCase
()))
.
orElseThrow
(
GlobalException:
:
new
);
.
orElseThrow
(
GlobalException:
:
new
);
...
@@ -139,7 +141,7 @@ public class TestCaseController {
...
@@ -139,7 +141,7 @@ public class TestCaseController {
.
orElseThrow
(
GlobalException:
:
new
);
.
orElseThrow
(
GlobalException:
:
new
);
Boolean
saveOrUpdate
=
Optional
.
of
(
testDataService
.
saveOrUpdateBatch
(
testCaseData
.
getTestData
()))
Boolean
saveOrUpdate
=
Optional
.
of
(
testDataService
.
saveOrUpdateBatch
(
testCaseData
.
getTestData
()))
.
orElseThrow
(()
->
new
GlobalException
(
"失败"
));
.
orElseThrow
(()
->
new
GlobalException
(
"失败"
));
return
update
&&
saveOrUpdate
return
update
?
CommonResult
.
success
(
testCaseData
,
"修改成功"
)
?
CommonResult
.
success
(
testCaseData
,
"修改成功"
)
:
CommonResult
.
failed
(
testCaseData
,
"修改失败"
);
:
CommonResult
.
failed
(
testCaseData
,
"修改失败"
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论