Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
9b546abc
提交
9b546abc
authored
1月 19, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(web): controller层Put请求修改
上级
d45fccad
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
67 行增加
和
67 行删除
+67
-67
ActionController.java
...java/org/matrix/autotest/controller/ActionController.java
+9
-9
ConnectController.java
...ava/org/matrix/autotest/controller/ConnectController.java
+7
-7
DynamicVariableController.java
...matrix/autotest/controller/DynamicVariableController.java
+9
-9
EnvironmentController.java
...org/matrix/autotest/controller/EnvironmentController.java
+9
-9
MoveController.java
...n/java/org/matrix/autotest/controller/MoveController.java
+8
-8
ProjectController.java
...ava/org/matrix/autotest/controller/ProjectController.java
+17
-17
TestCaseController.java
...va/org/matrix/autotest/controller/TestCaseController.java
+8
-8
没有找到文件。
kt-web/src/main/java/org/matrix/autotest/controller/ActionController.java
浏览文件 @
9b546abc
...
...
@@ -41,7 +41,7 @@ public class ActionController {
public
ResponseEntity
<
CommonResultObj
<
List
<
Action
>>>
findAllAction
()
{
List
<
Action
>
results
=
actionService
.
findAllAction
();
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -58,7 +58,7 @@ public class ActionController {
public
ResponseEntity
<
CommonResultObj
<
Action
>>
findByIdAction
(
@PathVariable
Integer
id
)
{
Action
result
=
actionService
.
findByIdAction
(
id
);
if
(
result
!=
null
)
{
return
CommonResult
.
success
(
result
,
"查询成功"
);
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -75,7 +75,7 @@ public class ActionController {
public
ResponseEntity
<
CommonResultObj
<
Action
>>
insertAction
(
@RequestBody
Action
action
)
{
int
i
=
actionService
.
insertAction
(
action
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
action
,
"添加成功"
);
return
CommonResult
.
success
(
action
,
"添加成功"
);
}
else
{
return
CommonResult
.
failed
(
"添加失败"
);
}
...
...
@@ -87,12 +87,12 @@ public class ActionController {
* @param action 动作
* @return 修改后的动作
*/
@ApiOperation
(
value
=
"
根据id
修改动作"
)
@PutMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"修改动作"
)
@PutMapping
public
ResponseEntity
<
CommonResultObj
<
Action
>>
updateAction
(
@RequestBody
Action
action
)
{
int
i
=
actionService
.
updateAction
(
action
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
action
,
"修改成功"
);
return
CommonResult
.
success
(
action
,
"修改成功"
);
}
else
{
return
CommonResult
.
failed
(
"修改失败"
);
}
...
...
@@ -109,7 +109,7 @@ public class ActionController {
public
ResponseEntity
<
CommonResultObj
<
String
>>
deleteAction
(
@PathVariable
Integer
id
)
{
int
i
=
actionService
.
deleteAction
(
id
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
}
else
{
return
CommonResult
.
failed
(
"删除失败,或不存在需要删除的数据"
);
}
...
...
@@ -126,7 +126,7 @@ public class ActionController {
public
ResponseEntity
<
CommonResultObj
<
List
<
Action
>>>
findByProjectIdAction
(
@PathVariable
Integer
projectId
)
{
List
<
Action
>
results
=
actionService
.
findByProjectIdAction
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -143,7 +143,7 @@ public class ActionController {
public
ResponseEntity
<
CommonResultObj
<
List
<
Action
>>>
findByMoveIdAction
(
@PathVariable
Integer
moveId
)
{
List
<
Action
>
results
=
actionService
.
findByMoveIdAction
(
moveId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
kt-web/src/main/java/org/matrix/autotest/controller/ConnectController.java
浏览文件 @
9b546abc
...
...
@@ -41,7 +41,7 @@ public class ConnectController {
public
ResponseEntity
<
CommonResultObj
<
List
<
Connect
>>>
findAllConnect
()
{
List
<
Connect
>
results
=
connectService
.
findAllConnect
();
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -58,7 +58,7 @@ public class ConnectController {
public
ResponseEntity
<
CommonResultObj
<
Connect
>>
findByIdConnect
(
@PathVariable
Integer
id
)
{
Connect
result
=
connectService
.
findByIdConnect
(
id
);
if
(
result
!=
null
)
{
return
CommonResult
.
success
(
result
,
"查询成功"
);
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -75,7 +75,7 @@ public class ConnectController {
public
ResponseEntity
<
CommonResultObj
<
Connect
>>
insertConnect
(
@RequestBody
Connect
connect
)
{
int
i
=
connectService
.
insertConnect
(
connect
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
connect
,
"添加成功"
);
return
CommonResult
.
success
(
connect
,
"添加成功"
);
}
else
{
return
CommonResult
.
failed
(
"添加失败"
);
}
...
...
@@ -87,12 +87,12 @@ public class ConnectController {
* @param connect 连接池
* @return 修改后的连接池
*/
@ApiOperation
(
value
=
"
根据id
修改连接池"
)
@PutMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"修改连接池"
)
@PutMapping
public
ResponseEntity
<
CommonResultObj
<
Connect
>>
updateConnect
(
@RequestBody
Connect
connect
)
{
int
i
=
connectService
.
updateConnect
(
connect
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
connect
,
"修改成功"
);
return
CommonResult
.
success
(
connect
,
"修改成功"
);
}
else
{
return
CommonResult
.
failed
(
"修改失败"
);
}
...
...
@@ -109,7 +109,7 @@ public class ConnectController {
public
ResponseEntity
<
CommonResultObj
<
String
>>
deleteConnect
(
@PathVariable
Integer
id
)
{
int
i
=
connectService
.
deleteConnect
(
id
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
}
else
{
return
CommonResult
.
failed
(
"删除失败,或不存在需要删除的数据"
);
}
...
...
kt-web/src/main/java/org/matrix/autotest/controller/DynamicVariableController.java
浏览文件 @
9b546abc
...
...
@@ -22,7 +22,7 @@ import java.util.List;
@CrossOrigin
@RestController
@RequestMapping
(
"/dynamicVariables"
)
@Api
(
tags
=
"对动
态变量表
dynamic_variable的基本操作"
)
@Api
(
tags
=
"对动
参
dynamic_variable的基本操作"
)
public
class
DynamicVariableController
{
private
final
DynamicVariableService
dynamicVariableService
;
...
...
@@ -41,7 +41,7 @@ public class DynamicVariableController {
public
ResponseEntity
<
CommonResultObj
<
List
<
DynamicVariable
>>>
findAllDynamicVariable
()
{
List
<
DynamicVariable
>
results
=
dynamicVariableService
.
findAllDynamicVariable
();
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -58,7 +58,7 @@ public class DynamicVariableController {
public
ResponseEntity
<
CommonResultObj
<
DynamicVariable
>>
findByIdDynamicVariable
(
@PathVariable
Integer
id
)
{
DynamicVariable
result
=
dynamicVariableService
.
findByIdDynamicVariable
(
id
);
if
(
result
!=
null
)
{
return
CommonResult
.
success
(
result
,
"查询成功"
);
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -75,7 +75,7 @@ public class DynamicVariableController {
public
ResponseEntity
<
CommonResultObj
<
DynamicVariable
>>
insertDynamicVariable
(
@RequestBody
DynamicVariable
dynamicVariable
)
{
int
i
=
dynamicVariableService
.
insertDynamicVariable
(
dynamicVariable
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
dynamicVariable
,
"添加成功"
);
return
CommonResult
.
success
(
dynamicVariable
,
"添加成功"
);
}
else
{
return
CommonResult
.
failed
(
"添加失败"
);
}
...
...
@@ -87,12 +87,12 @@ public class DynamicVariableController {
* @param dynamicVariable 动态变量
* @return 修改后的动态变量
*/
@ApiOperation
(
value
=
"
根据id
修改动态变量"
)
@PutMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"修改动态变量"
)
@PutMapping
public
ResponseEntity
<
CommonResultObj
<
DynamicVariable
>>
updateDynamicVariable
(
@RequestBody
DynamicVariable
dynamicVariable
)
{
int
i
=
dynamicVariableService
.
updateDynamicVariable
(
dynamicVariable
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
dynamicVariable
,
"修改成功"
);
return
CommonResult
.
success
(
dynamicVariable
,
"修改成功"
);
}
else
{
return
CommonResult
.
failed
(
"修改失败"
);
}
...
...
@@ -109,7 +109,7 @@ public class DynamicVariableController {
public
ResponseEntity
<
CommonResultObj
<
String
>>
deleteDynamicVariable
(
@PathVariable
Integer
id
)
{
int
i
=
dynamicVariableService
.
deleteDynamicVariable
(
id
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
}
else
{
return
CommonResult
.
failed
(
"删除失败,或不存在需要删除的数据"
);
}
...
...
@@ -126,7 +126,7 @@ public class DynamicVariableController {
public
ResponseEntity
<
CommonResultObj
<
List
<
DynamicVariable
>>>
findByProjectIdDynamicVariable
(
@PathVariable
Integer
projectId
)
{
List
<
DynamicVariable
>
results
=
dynamicVariableService
.
findByProjectIdDynamicVariable
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
kt-web/src/main/java/org/matrix/autotest/controller/EnvironmentController.java
浏览文件 @
9b546abc
...
...
@@ -22,7 +22,7 @@ import java.util.List;
@CrossOrigin
@RestController
@RequestMapping
(
"/environments"
)
@Api
(
tags
=
"对
实例
表environment的基本操作"
)
@Api
(
tags
=
"对
环境
表environment的基本操作"
)
public
class
EnvironmentController
{
private
final
EnvironmentService
environmentService
;
...
...
@@ -41,7 +41,7 @@ public class EnvironmentController {
public
ResponseEntity
<
CommonResultObj
<
List
<
Environment
>>>
findAllEnvironment
()
{
List
<
Environment
>
results
=
environmentService
.
findAllEnvironment
();
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -58,7 +58,7 @@ public class EnvironmentController {
public
ResponseEntity
<
CommonResultObj
<
Environment
>>
findByIdEnvironment
(
@PathVariable
Integer
id
)
{
Environment
result
=
environmentService
.
findByIdEnvironment
(
id
);
if
(
result
!=
null
)
{
return
CommonResult
.
success
(
result
,
"查询成功"
);
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -75,7 +75,7 @@ public class EnvironmentController {
public
ResponseEntity
<
CommonResultObj
<
Environment
>>
insertEnvironment
(
@RequestBody
Environment
environment
)
{
int
i
=
environmentService
.
insertEnvironment
(
environment
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
environment
,
"添加成功"
);
return
CommonResult
.
success
(
environment
,
"添加成功"
);
}
else
{
return
CommonResult
.
failed
(
"添加失败"
);
}
...
...
@@ -87,12 +87,12 @@ public class EnvironmentController {
* @param environment 实例
* @return 修改后的实例
*/
@ApiOperation
(
value
=
"
根据id
修改实例"
)
@PutMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"修改实例"
)
@PutMapping
public
ResponseEntity
<
CommonResultObj
<
Environment
>>
updateEnvironment
(
@RequestBody
Environment
environment
)
{
int
i
=
environmentService
.
updateEnvironment
(
environment
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
environment
,
"修改成功"
);
return
CommonResult
.
success
(
environment
,
"修改成功"
);
}
else
{
return
CommonResult
.
failed
(
"修改失败"
);
}
...
...
@@ -109,7 +109,7 @@ public class EnvironmentController {
public
ResponseEntity
<
CommonResultObj
<
String
>>
deleteEnvironment
(
@PathVariable
Integer
id
)
{
int
i
=
environmentService
.
deleteEnvironment
(
id
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
}
else
{
return
CommonResult
.
failed
(
"删除失败,或不存在需要删除的数据"
);
}
...
...
@@ -126,7 +126,7 @@ public class EnvironmentController {
public
ResponseEntity
<
CommonResultObj
<
List
<
Environment
>>>
findByProjectIdEnvironment
(
@PathVariable
Integer
projectId
)
{
List
<
Environment
>
results
=
environmentService
.
findByProjectIdEnvironment
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
kt-web/src/main/java/org/matrix/autotest/controller/MoveController.java
浏览文件 @
9b546abc
...
...
@@ -41,7 +41,7 @@ public class MoveController {
public
ResponseEntity
<
CommonResultObj
<
List
<
Move
>>>
findAllMove
()
{
List
<
Move
>
results
=
moveService
.
findAllMove
();
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -58,7 +58,7 @@ public class MoveController {
public
ResponseEntity
<
CommonResultObj
<
Move
>>
findByIdMove
(
@PathVariable
Integer
id
)
{
Move
result
=
moveService
.
findByIdMove
(
id
);
if
(
result
!=
null
)
{
return
CommonResult
.
success
(
result
,
"查询成功"
);
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -75,7 +75,7 @@ public class MoveController {
public
ResponseEntity
<
CommonResultObj
<
Move
>>
insertMove
(
@RequestBody
Move
move
)
{
int
i
=
moveService
.
insertMove
(
move
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
move
,
"添加成功"
);
return
CommonResult
.
success
(
move
,
"添加成功"
);
}
else
{
return
CommonResult
.
failed
(
"添加失败"
);
}
...
...
@@ -87,12 +87,12 @@ public class MoveController {
* @param move 行为
* @return 修改后的行为
*/
@ApiOperation
(
value
=
"
根据id
修改行为"
)
@PutMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"修改行为"
)
@PutMapping
public
ResponseEntity
<
CommonResultObj
<
Move
>>
updateMove
(
@RequestBody
Move
move
)
{
int
i
=
moveService
.
updateMove
(
move
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
move
,
"修改成功"
);
return
CommonResult
.
success
(
move
,
"修改成功"
);
}
else
{
return
CommonResult
.
failed
(
"修改失败"
);
}
...
...
@@ -109,7 +109,7 @@ public class MoveController {
public
ResponseEntity
<
CommonResultObj
<
String
>>
deleteMove
(
@PathVariable
Integer
id
)
{
int
i
=
moveService
.
deleteMove
(
id
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
}
else
{
return
CommonResult
.
failed
(
"删除失败,或不存在需要删除的数据"
);
}
...
...
@@ -126,7 +126,7 @@ public class MoveController {
public
ResponseEntity
<
CommonResultObj
<
List
<
Move
>>>
findByProjectIdMove
(
@PathVariable
Integer
projectId
)
{
List
<
Move
>
results
=
moveService
.
findByProjectIdMove
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
kt-web/src/main/java/org/matrix/autotest/controller/ProjectController.java
浏览文件 @
9b546abc
...
...
@@ -40,9 +40,9 @@ public class ProjectController {
@GetMapping
public
ResponseEntity
<
CommonResultObj
<
List
<
Project
>>>
findAllProject
()
{
List
<
Project
>
results
=
projectService
.
findAllProject
();
if
(
results
!=
null
&&
results
.
size
()
!=
0
){
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
...
...
@@ -57,9 +57,9 @@ public class ProjectController {
@GetMapping
(
"/{id}"
)
public
ResponseEntity
<
CommonResultObj
<
Project
>>
findByIdProject
(
@PathVariable
Integer
id
)
{
Project
result
=
projectService
.
findByIdProject
(
id
);
if
(
result
!=
null
){
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
else
{
if
(
result
!=
null
)
{
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
...
...
@@ -74,9 +74,9 @@ public class ProjectController {
@PostMapping
public
ResponseEntity
<
CommonResultObj
<
Project
>>
insertProject
(
@RequestBody
Project
project
)
{
int
i
=
projectService
.
insertProject
(
project
);
if
(
i
!=
0
){
return
CommonResult
.
success
(
project
,
"添加成功"
);
}
else
{
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
project
,
"添加成功"
);
}
else
{
return
CommonResult
.
failed
(
"添加失败"
);
}
}
...
...
@@ -87,13 +87,13 @@ public class ProjectController {
* @param project 项目
* @return 修改后的项目
*/
@ApiOperation
(
value
=
"
根据id
修改项目"
)
@PutMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"修改项目"
)
@PutMapping
public
ResponseEntity
<
CommonResultObj
<
Project
>>
updateProject
(
@RequestBody
Project
project
)
{
int
i
=
projectService
.
updateProject
(
project
);
if
(
i
!=
0
){
return
CommonResult
.
success
(
project
,
"修改成功"
);
}
else
{
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
project
,
"修改成功"
);
}
else
{
return
CommonResult
.
failed
(
"修改失败"
);
}
}
...
...
@@ -108,9 +108,9 @@ public class ProjectController {
@DeleteMapping
(
"/{id}"
)
public
ResponseEntity
<
CommonResultObj
<
String
>>
deleteProject
(
@PathVariable
Integer
id
)
{
int
i
=
projectService
.
deleteProject
(
id
);
if
(
i
!=
0
){
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
}
else
{
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
}
else
{
return
CommonResult
.
failed
(
"删除失败,或不存在需要删除的数据"
);
}
}
...
...
kt-web/src/main/java/org/matrix/autotest/controller/TestCaseController.java
浏览文件 @
9b546abc
...
...
@@ -41,7 +41,7 @@ public class TestCaseController {
public
ResponseEntity
<
CommonResultObj
<
List
<
TestCase
>>>
findAllTestCase
()
{
List
<
TestCase
>
results
=
testCaseService
.
findAllTestCase
();
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -58,7 +58,7 @@ public class TestCaseController {
public
ResponseEntity
<
CommonResultObj
<
TestCase
>>
findByIdTestCase
(
@PathVariable
Integer
id
)
{
TestCase
result
=
testCaseService
.
findByIdTestCase
(
id
);
if
(
result
!=
null
)
{
return
CommonResult
.
success
(
result
,
"查询成功"
);
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
@@ -75,7 +75,7 @@ public class TestCaseController {
public
ResponseEntity
<
CommonResultObj
<
TestCase
>>
insertTestCase
(
@RequestBody
TestCase
testCase
)
{
int
i
=
testCaseService
.
insertTestCase
(
testCase
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
testCase
,
"添加成功"
);
return
CommonResult
.
success
(
testCase
,
"添加成功"
);
}
else
{
return
CommonResult
.
failed
(
"添加失败"
);
}
...
...
@@ -87,12 +87,12 @@ public class TestCaseController {
* @param testCase 用例
* @return 修改后的用例
*/
@ApiOperation
(
value
=
"
根据id
修改用例"
)
@PutMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"修改用例"
)
@PutMapping
public
ResponseEntity
<
CommonResultObj
<
TestCase
>>
updateTestCase
(
@RequestBody
TestCase
testCase
)
{
int
i
=
testCaseService
.
updateTestCase
(
testCase
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
testCase
,
"修改成功"
);
return
CommonResult
.
success
(
testCase
,
"修改成功"
);
}
else
{
return
CommonResult
.
failed
(
"修改失败"
);
}
...
...
@@ -109,7 +109,7 @@ public class TestCaseController {
public
ResponseEntity
<
CommonResultObj
<
String
>>
deleteTestCase
(
@PathVariable
Integer
id
)
{
int
i
=
testCaseService
.
deleteTestCase
(
id
);
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
return
CommonResult
.
success
(
"id: "
+
id
+
"已删除"
,
"删除成功"
);
}
else
{
return
CommonResult
.
failed
(
"删除失败,或不存在需要删除的数据"
);
}
...
...
@@ -126,7 +126,7 @@ public class TestCaseController {
public
ResponseEntity
<
CommonResultObj
<
List
<
TestCase
>>>
findByProjectIdTestCase
(
@PathVariable
Integer
projectId
)
{
List
<
TestCase
>
results
=
testCaseService
.
findByProjectIdTestCase
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论