Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
b6fff3b6
提交
b6fff3b6
authored
2月 28, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(base): 修改了entity
上级
d3e6a4b5
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
16 行删除
+19
-16
TestData.java
...se/src/main/java/org/matrix/database/entity/TestData.java
+3
-0
MoveController.java
...n/java/org/matrix/autotest/controller/MoveController.java
+5
-5
TestCaseController.java
...va/org/matrix/autotest/controller/TestCaseController.java
+11
-11
没有找到文件。
kt-base/src/main/java/org/matrix/database/entity/TestData.java
浏览文件 @
b6fff3b6
...
...
@@ -24,6 +24,9 @@ import lombok.NoArgsConstructor;
@ApiModel
(
value
=
"TestData对象"
,
description
=
"测试用例用到的数据组"
)
public
class
TestData
extends
BaseEntity
{
@ApiModelProperty
(
"名称"
)
private
String
name
;
@ApiModelProperty
(
"是否进行异常检验,0为否,1为是"
)
private
Integer
abnormalCheckpoint
=
0
;
...
...
kt-web/src/main/java/org/matrix/autotest/controller/MoveController.java
浏览文件 @
b6fff3b6
...
...
@@ -48,9 +48,9 @@ public class MoveController {
/**
* 分页查询所有行为
*
* @param pageSize 每页多少条数据
* @param pageNum 当前第几页
* @param name 行为名称
* @param pageSize
每页多少条数据
* @param pageNum
当前第几页
* @param name
行为名称
* @param projectId 项目id
* @return 分页查询的结果, 行为
*/
...
...
@@ -137,7 +137,7 @@ public class MoveController {
);
Boolean
saveOrUpdate
=
Optional
.
of
(
actionService
.
saveOrUpdateBatch
(
moveAction
.
getAction
()))
.
orElseThrow
(()
->
new
GlobalException
(
"修改失败"
));
return
update
&&
saveOrUpdate
&&
delete
return
update
&&
saveOrUpdate
?
CommonResult
.
success
(
moveAction
,
"修改成功"
)
:
CommonResult
.
failed
(
moveAction
,
"修改失败"
);
}
...
...
@@ -154,7 +154,7 @@ public class MoveController {
Boolean
moveBoolean
=
Optional
.
of
(
moveService
.
removeById
(
moveId
))
.
orElseThrow
(()
->
new
GlobalException
(
String
.
format
(
"没有查到指定的行为,你提供的行为id是%d"
,
moveId
)));
Boolean
actionBoolean
=
Optional
.
of
(
actionService
.
remove
(
Wrappers
.
lambdaQuery
(
Action
.
class
)
.
eq
(
Action:
:
getMoveId
,
moveId
)))
.
eq
(
moveId
!=
0
,
Action:
:
getMoveId
,
moveId
)))
.
orElseThrow
(()
->
new
GlobalException
(
String
.
format
(
"没有查到指定的行为,你提供的行为id是%d"
,
moveId
)));
return
moveBoolean
&&
actionBoolean
?
CommonResult
.
success
(
"删除成功"
)
...
...
kt-web/src/main/java/org/matrix/autotest/controller/TestCaseController.java
浏览文件 @
b6fff3b6
...
...
@@ -57,7 +57,7 @@ public class TestCaseController {
*/
@ApiOperation
(
value
=
"分页查询用例"
)
@GetMapping
(
"/{projectId}"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
TestCase
>>>
findPage
Connects
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
TestCase
>>>
findPage
TestCase
(
int
pageSize
,
int
pageNum
,
String
name
,
@PathVariable
Long
projectId
)
{
...
...
@@ -78,7 +78,7 @@ public class TestCaseController {
*/
@ApiOperation
(
value
=
"根据用例id查,用例以及,用例下的数据组"
)
@GetMapping
(
"/testCase/{testCaseId}"
)
public
ResponseEntity
<
CommonResultObj
<
TestCaseData
>>
findById
MoveAction
(
@PathVariable
Long
testCaseId
)
{
public
ResponseEntity
<
CommonResultObj
<
TestCaseData
>>
findById
TestCaseData
(
@PathVariable
Long
testCaseId
)
{
TestCase
byId
=
testCaseService
.
getById
(
testCaseId
);
if
(
byId
==
null
)
{
throw
new
GlobalException
(
"不存在用例"
);
...
...
@@ -100,7 +100,7 @@ public class TestCaseController {
*/
@ApiOperation
(
value
=
"添加用例和数据组"
)
@PostMapping
public
ResponseEntity
<
CommonResultObj
<
TestCaseData
>>
insert
MoveAction
(
@RequestBody
TestCaseData
testCaseData
)
{
public
ResponseEntity
<
CommonResultObj
<
TestCaseData
>>
insert
TestCaseData
(
@RequestBody
TestCaseData
testCaseData
)
{
Boolean
testCaseBoolean
=
Optional
.
of
(
testCaseService
.
saveOrUpdate
(
testCaseData
.
getTestCase
()))
.
orElseThrow
(
GlobalException:
:
new
);
Long
id
=
testCaseData
.
getTestCase
().
getId
();
...
...
@@ -127,19 +127,19 @@ public class TestCaseController {
*/
@ApiOperation
(
value
=
"修改用例以及数据组"
)
@PutMapping
public
ResponseEntity
<
CommonResultObj
<
TestCaseData
>>
update
MoveAction
(
@RequestBody
TestCaseData
testCaseData
)
{
public
ResponseEntity
<
CommonResultObj
<
TestCaseData
>>
update
TestCaseData
(
@RequestBody
TestCaseData
testCaseData
)
{
Boolean
update
=
Optional
.
of
(
testCaseService
.
updateById
(
testCaseData
.
getTestCase
()))
.
orElseThrow
(
GlobalException:
:
new
);
Boolean
delete
=
Optional
.
of
(
testDataService
.
remove
(
Wrappers
.
lambdaQuery
(
TestData
.
class
)
.
eq
(
TestData:
:
getTestCaseId
,
testCaseData
.
getTestCase
().
getId
())))
.
orElseThrow
(()
->
new
GlobalException
(
"删除失败"
));
Long
id
=
testCaseData
.
getTestCase
().
getId
();
testCaseData
.
getTestData
().
forEach
(
action
->
action
.
setTestCaseId
(
id
)
);
Boolean
delete
=
Optional
.
of
(
testDataService
.
remove
(
Wrappers
.
lambdaQuery
(
TestData
.
class
)
.
eq
(
TestData:
:
getTestCaseId
,
testCaseData
.
getTestCase
().
getId
())))
.
orElseThrow
(
GlobalException:
:
new
);
Boolean
saveOrUpdate
=
Optional
.
of
(
testDataService
.
saveOrUpdateBatch
(
testCaseData
.
getTestData
()))
.
orElseThrow
(()
->
new
GlobalException
(
"
修改
失败"
));
return
update
&&
saveOrUpdate
&&
delete
.
orElseThrow
(()
->
new
GlobalException
(
"失败"
));
return
update
&&
saveOrUpdate
?
CommonResult
.
success
(
testCaseData
,
"修改成功"
)
:
CommonResult
.
failed
(
testCaseData
,
"修改失败"
);
}
...
...
@@ -152,12 +152,12 @@ public class TestCaseController {
*/
@ApiOperation
(
value
=
"删除行用例和数据组"
)
@DeleteMapping
(
"/{testCaseId}"
)
public
ResponseEntity
<
CommonResultObj
<
MoveAction
>>
delete
MoveAction
(
@PathVariable
Long
testCaseId
)
{
public
ResponseEntity
<
CommonResultObj
<
MoveAction
>>
delete
TestCaseData
(
@PathVariable
Long
testCaseId
)
{
Boolean
testCaseBoolean
=
Optional
.
of
(
testCaseService
.
removeById
(
testCaseId
))
.
orElseThrow
(()
->
new
GlobalException
(
String
.
format
(
"没有查到指定的用例,你提供的用例id是%d"
,
testCaseId
)));
Boolean
testDataBoolean
=
Optional
.
of
(
testDataService
.
remove
(
Wrappers
.
lambdaQuery
(
TestData
.
class
)
.
eq
(
TestData:
:
getTestCaseId
,
testCaseId
)))
.
orElseThrow
(()
->
new
GlobalException
(
String
.
format
(
"没有查到指定的
用例,你提供的用例
id是%d"
,
testCaseId
)));
.
orElseThrow
(()
->
new
GlobalException
(
String
.
format
(
"没有查到指定的
数据组,你提供的数据组
id是%d"
,
testCaseId
)));
return
testCaseBoolean
&&
testDataBoolean
?
CommonResult
.
success
(
"删除成功"
)
:
CommonResult
.
failed
(
"删除失败或不存在"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论