Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
b1c96b9c
提交
b1c96b9c
authored
3月 17, 2022
作者:
Matrix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(CRUD): 优化了查询不到数据的错误处理
上级
5320067f
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
59 行增加
和
92 行删除
+59
-92
CommonResult.java
...se/src/main/java/org/matrix/database/vo/CommonResult.java
+6
-0
ConnectController.java
...ava/org/matrix/autotest/controller/ConnectController.java
+1
-3
DynamicVariableController.java
...matrix/autotest/controller/DynamicVariableController.java
+1
-3
EnvironmentController.java
...org/matrix/autotest/controller/EnvironmentController.java
+1
-3
ExecutionHistoryController.java
...atrix/autotest/controller/ExecutionHistoryController.java
+37
-42
ExecutionRecordController.java
...matrix/autotest/controller/ExecutionRecordController.java
+8
-21
MoveController.java
...n/java/org/matrix/autotest/controller/MoveController.java
+1
-3
ProjectController.java
...ava/org/matrix/autotest/controller/ProjectController.java
+1
-3
TestCaseController.java
...va/org/matrix/autotest/controller/TestCaseController.java
+1
-3
TestJobController.java
...ava/org/matrix/autotest/controller/TestJobController.java
+2
-11
没有找到文件。
kt-base/src/main/java/org/matrix/database/vo/CommonResult.java
浏览文件 @
b1c96b9c
package
org
.
matrix
.
database
.
vo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
...
...
@@ -9,6 +10,7 @@ import java.util.function.Predicate;
/**
* @author mry
*/
@Slf4j
public
class
CommonResult
{
/**
...
...
@@ -84,6 +86,7 @@ public class CommonResult {
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
ResponseEntity
<
CommonResultObj
<
T
>>
failed
(
T
data
,
HttpHeaders
headers
)
{
log
.
warn
(
"[接口错误] 错误数据 {} 错误头信息 {}"
,
data
,
headers
);
return
new
ResponseEntity
(
new
CommonResultObj
(
data
),
headers
,
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
...
...
@@ -95,6 +98,7 @@ public class CommonResult {
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
ResponseEntity
<
CommonResultObj
<
T
>>
failed
(
T
data
,
String
message
)
{
log
.
warn
(
"[接口错误] 错误数据 {} 错误信息 {}"
,
data
,
message
);
return
ResponseEntity
.
status
(
500
).
body
(
new
CommonResultObj
<>(
data
,
message
));
}
...
...
@@ -105,6 +109,7 @@ public class CommonResult {
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
ResponseEntity
<
CommonResultObj
<
T
>>
failed
(
String
message
)
{
log
.
warn
(
"[接口错误] 错误信息 {}"
,
message
);
return
ResponseEntity
.
status
(
500
).
body
(
new
CommonResultObj
<>(
null
,
message
));
}
...
...
@@ -115,6 +120,7 @@ public class CommonResult {
*/
@SuppressWarnings
(
value
=
"all"
)
public
static
<
T
>
ResponseEntity
<
CommonResultObj
<
T
>>
failed
(
T
data
)
{
log
.
warn
(
"[接口错误] 错误数据 {}"
,
data
);
return
ResponseEntity
.
status
(
500
).
body
(
new
CommonResultObj
<>(
data
));
}
...
...
kt-web/src/main/java/org/matrix/autotest/controller/ConnectController.java
浏览文件 @
b1c96b9c
...
...
@@ -54,9 +54,7 @@ public class ConnectController {
.
like
(
StringUtils
.
hasLength
(
name
)
,
Connect:
:
getName
,
name
))).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
results
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
/**
...
...
kt-web/src/main/java/org/matrix/autotest/controller/DynamicVariableController.java
浏览文件 @
b1c96b9c
...
...
@@ -55,9 +55,7 @@ public class DynamicVariableController {
.
like
(
StringUtils
.
hasLength
(
name
)
,
DynamicVariable:
:
getName
,
name
))).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
results
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
/**
...
...
kt-web/src/main/java/org/matrix/autotest/controller/EnvironmentController.java
浏览文件 @
b1c96b9c
...
...
@@ -55,9 +55,7 @@ public class EnvironmentController {
.
like
(
StringUtils
.
hasLength
(
name
)
,
Environment:
:
getName
,
name
))).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
results
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
/**
...
...
kt-web/src/main/java/org/matrix/autotest/controller/ExecutionHistoryController.java
浏览文件 @
b1c96b9c
...
...
@@ -3,10 +3,12 @@ package org.matrix.autotest.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.matrix.autotest.utils.PageTools
;
import
org.matrix.database.entity.ExecutionHistory
;
import
org.matrix.database.entity.ExecutionRecord
;
import
org.matrix.database.entity.TestData
;
import
org.matrix.database.service.IExecutionHistoryService
;
import
org.matrix.database.service.ITestDataService
;
...
...
@@ -19,7 +21,6 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
...
...
@@ -42,26 +43,26 @@ public class ExecutionHistoryController {
this
.
executionHistoryService
=
executionHistoryService
;
}
@ApiOperation
(
value
=
"分页查询执行历史详情"
,
notes
=
"假如查询测试用例的执行历史,请入参caseId,假如查询测试任务的执行历史,请入参jobId"
)
@ApiOperation
(
value
=
"分页查询执行历史详情"
,
notes
=
"假如查询测试用例的执行历史,请入参caseId,假如查询测试任务的执行历史,请入参jobId"
)
@GetMapping
(
"/executionHistoryDetail"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"页码"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageNum"
,
value
=
"当前页显示调试"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"uniqueKey"
,
value
=
"执行历史批次号"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"jobId"
,
value
=
"测试任务ID"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"caseId"
,
value
=
"测试用例ID"
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"页码"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageNum"
,
value
=
"当前页显示调试"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"uniqueKey"
,
value
=
"执行历史批次号"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"jobId"
,
value
=
"测试任务ID"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"caseId"
,
value
=
"测试用例ID"
,
paramType
=
"query"
)
})
public
ResponseEntity
<
CommonResultObj
<
IPage
<
ExecutionHistoryVo
>>>
executionHistoryDetail
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
public
ResponseEntity
<
CommonResultObj
<
IPage
<
ExecutionHistoryVo
>>>
executionHistoryDetail
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"-1"
)
Long
jobId
,
Long
caseId
,
String
uniqueKey
){
)
{
Page
<
ExecutionHistory
>
results
=
Optional
.
of
(
executionHistoryService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
ExecutionHistory
.
class
)
.
eq
(
jobId
!=
null
,
ExecutionHistory:
:
getJobId
,
jobId
)
.
eq
(
caseId
!=
null
,
ExecutionHistory:
:
getCaseId
,
caseId
)
.
eq
(
jobId
!=
null
,
ExecutionHistory:
:
getJobId
,
jobId
)
.
eq
(
caseId
!=
null
,
ExecutionHistory:
:
getCaseId
,
caseId
)
.
eq
(
StringUtils
.
hasLength
(
uniqueKey
),
ExecutionHistory:
:
getUniqueKey
,
uniqueKey
)
)).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
...
...
@@ -76,47 +77,41 @@ public class ExecutionHistoryController {
Page
<
ExecutionHistoryVo
>
resultPage
=
new
Page
<>();
BeanUtils
.
copyProperties
(
results
,
resultPage
);
resultPage
.
setRecords
(
collect
);
return
resultPage
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
resultPage
,
"查询成功"
)
:
CommonResult
.
failed
(
resultPage
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
resultPage
,
"查询成功"
);
}
@ApiOperation
(
value
=
"分页查询执行历史缩略"
,
notes
=
"假如查询测试用例的执行历史,请入参caseId,假如查询测试任务的执行历史,请入参jobId"
)
@ApiOperation
(
value
=
"分页查询执行历史缩略"
,
notes
=
"假如查询测试用例的执行历史,请入参caseId,假如查询测试任务的执行历史,请入参jobId"
)
@GetMapping
(
"/executionHistory"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"页码"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageNum"
,
value
=
"当前页显示调试"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"jobId"
,
value
=
"测试任务ID"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"caseId"
,
value
=
"测试用例ID"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"uniqueKey"
,
value
=
"执行历史批次号"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"页码"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"pageNum"
,
value
=
"当前页显示调试"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"jobId"
,
value
=
"测试任务ID"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"caseId"
,
value
=
"测试用例ID"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"uniqueKey"
,
value
=
"执行历史批次号"
,
paramType
=
"query"
),
})
public
ResponseEntity
<
CommonResultObj
<
IPage
<
ExecutionHistoryVo
>>>
findExecutionHistory
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"-1"
)
Long
jobId
,
Long
caseId
,
String
uniqueKey
){
IPage
<
ExecutionHistoryVo
>
page
=
executionHistoryService
.
pageExecutionHistoryVoByCaseIdAndJobId
(
caseId
,
jobId
,
uniqueKey
,
pageNum
,
pageSize
);
return
page
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
page
,
"查询成功"
)
:
CommonResult
.
failed
(
page
,
"查询失败或无数据"
);
public
ResponseEntity
<
CommonResultObj
<
IPage
<
ExecutionHistoryVo
>>>
findExecutionHistory
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"-1"
)
Long
jobId
,
Long
caseId
,
String
uniqueKey
)
{
IPage
<
ExecutionHistoryVo
>
page
=
executionHistoryService
.
pageExecutionHistoryVoByCaseIdAndJobId
(
caseId
,
jobId
,
uniqueKey
,
pageNum
,
pageSize
);
return
CommonResult
.
success
(
page
,
"查询成功"
);
}
@ApiOperation
(
value
=
"根据JobId或者caseId 取最近一次执行历史"
,
notes
=
"假如查询测试用例的执行历史,请入参caseId,假如查询测试任务的执行历史,请入参jobId"
)
@ApiOperation
(
value
=
"根据JobId或者caseId 取最近一次执行历史"
,
notes
=
"假如查询测试用例的执行历史,请入参caseId,假如查询测试任务的执行历史,请入参jobId"
)
@GetMapping
(
"/lastExecution"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"jobId"
,
value
=
"测试任务ID"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"caseId"
,
value
=
"测试用例ID"
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"jobId"
,
value
=
"测试任务ID"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"caseId"
,
value
=
"测试用例ID"
,
paramType
=
"query"
)
})
public
ResponseEntity
<
CommonResultObj
<
ExecutionHistoryVo
>>
lastExecution
(
public
ResponseEntity
<
CommonResultObj
<
ExecutionHistoryVo
>>
lastExecution
(
@RequestParam
(
defaultValue
=
"-1"
)
Long
jobId
,
Long
caseId
){
)
{
ExecutionHistoryVo
result
=
executionHistoryService
.
getLastExecutionHistory
(
caseId
,
jobId
);
return
result
!=
null
?
CommonResult
.
success
(
result
,
"查询成功"
)
:
CommonResult
.
failed
(
null
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
}
kt-web/src/main/java/org/matrix/autotest/controller/ExecutionRecordController.java
浏览文件 @
b1c96b9c
package
org
.
matrix
.
autotest
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.matrix.autotest.utils.PageTools
;
import
org.matrix.database.entity.ExecutionRecord
;
import
org.matrix.database.entity.TestJob
;
import
org.matrix.database.service.IExecutionRecordService
;
import
org.matrix.database.service.ITestCaseService
;
import
org.matrix.database.service.ITestDataService
;
...
...
@@ -21,16 +17,13 @@ import org.matrix.enums.ExecutionRecType;
import
org.matrix.exception.GlobalException
;
import
org.matrix.socket.enums.TestExecuteType
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
*
;
import
static
java
.
util
.
stream
.
Collectors
.
groupingBy
;
/**
* @author mry
...
...
@@ -41,16 +34,13 @@ import static java.util.stream.Collectors.*;
@Api
(
tags
=
"对执行记录execution_record的基本操作"
)
public
class
ExecutionRecordController
{
private
final
IExecutionRecordService
executionRecordService
;
final
ITestJobService
testJobService
;
final
ITestCaseService
testCaseService
;
final
ITestDataService
testDataService
;
private
final
IExecutionRecordService
executionRecordService
;
public
ExecutionRecordController
(
IExecutionRecordService
executionRecordService
,
ITestJobService
testJobService
,
ITestCaseService
testCaseService
,
ITestDataService
testDataService
)
{
this
.
executionRecordService
=
executionRecordService
;
...
...
@@ -92,9 +82,7 @@ public class ExecutionRecordController {
.
eq
(
type
!=
null
,
ExecutionRecord:
:
getType
,
type
)
)).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
results
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
/**
...
...
@@ -117,9 +105,8 @@ public class ExecutionRecordController {
TestExecuteType
type
)
{
List
<
ExecutionRecord
>
results
=
getExecutionRecords
(
userId
,
testDataId
,
testCaseId
,
uniqueKey
,
type
);
Map
<
Long
,
Map
<
Long
,
Map
<
Long
,
List
<
String
>>>>
resultMap
=
new
HashMap
<>();
return
results
.
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
/**
...
...
@@ -144,10 +131,10 @@ public class ExecutionRecordController {
List
<
ExecutionRecordVo
>
list
=
new
ArrayList
<>();
for
(
ExecutionRecord
result
:
results
)
{
ExecutionRecordVo
recordVo
=
new
ExecutionRecordVo
();
BeanUtils
.
copyProperties
(
result
,
recordVo
);
BeanUtils
.
copyProperties
(
result
,
recordVo
);
recordVo
.
setJobName
(
testJobService
.
getById
(
result
.
getTestJobId
()).
getName
());
recordVo
.
setCaseName
(
testCaseService
.
getById
(
result
.
getTestCaseId
()).
getName
());
if
(
recordVo
.
getTestDataId
()
!=-
1L
)
{
if
(
recordVo
.
getTestDataId
()
!=
-
1L
)
{
recordVo
.
setDataName
(
testDataService
.
getById
(
result
.
getTestDataId
()).
getName
());
}
list
.
add
(
recordVo
);
...
...
@@ -156,7 +143,7 @@ public class ExecutionRecordController {
groupingBy
(
ExecutionRecord:
:
getTestJobId
,
groupingBy
(
ExecutionRecord:
:
getTestCaseId
,
groupingBy
(
ExecutionRecord:
:
getTestDataId
))));
return
CommonResult
.
success
(
map
,
"查询成功"
);
return
CommonResult
.
success
(
map
,
"查询成功"
);
}
...
...
kt-web/src/main/java/org/matrix/autotest/controller/MoveController.java
浏览文件 @
b1c96b9c
...
...
@@ -67,9 +67,7 @@ public class MoveController {
.
like
(
StringUtils
.
hasLength
(
name
)
,
Move:
:
getName
,
name
))).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
results
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
/**
...
...
kt-web/src/main/java/org/matrix/autotest/controller/ProjectController.java
浏览文件 @
b1c96b9c
...
...
@@ -42,9 +42,7 @@ public class ProjectController {
@GetMapping
public
ResponseEntity
<
CommonResultObj
<
List
<
Project
>>>
findAllProjects
()
{
List
<
Project
>
results
=
Optional
.
ofNullable
(
projectService
.
list
()).
orElse
(
new
ArrayList
<>());
return
results
.
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
/**
...
...
kt-web/src/main/java/org/matrix/autotest/controller/TestCaseController.java
浏览文件 @
b1c96b9c
...
...
@@ -77,9 +77,7 @@ public class TestCaseController {
,
TestCase:
:
getName
,
name
))).
orElse
(
new
Page
<>());
// TODO 暂时注解掉,关于页码超出的范围要额外处理
// PageTools.pageTool(pageSize, pageNum, results);
return
results
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
/**
...
...
kt-web/src/main/java/org/matrix/autotest/controller/TestJobController.java
浏览文件 @
b1c96b9c
package
org
.
matrix
.
autotest
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.matrix.autotest.utils.PageTools
;
import
org.matrix.database.entity.TestJob
;
import
org.matrix.database.service.ITestJobService
;
import
org.matrix.database.vo.CommonResult
;
import
org.matrix.database.vo.CommonResultObj
;
import
org.matrix.database.vo.TestJobVo
;
import
org.matrix.exception.GlobalException
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
...
...
@@ -44,9 +39,7 @@ public class TestJobController {
@GetMapping
public
ResponseEntity
<
CommonResultObj
<
List
<
TestJob
>>>
findConnects
()
{
List
<
TestJob
>
results
=
Optional
.
ofNullable
(
testJobService
.
list
()).
orElse
(
new
ArrayList
<>());
return
results
.
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
/**
...
...
@@ -64,9 +57,7 @@ public class TestJobController {
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
String
name
)
{
IPage
<
TestJobVo
>
result
=
testJobService
.
pageTestJob
(
name
,
pageSize
,
pageNum
);
return
result
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
result
,
"查询成功"
)
:
CommonResult
.
failed
(
result
,
"查询失败或无数据"
);
return
CommonResult
.
success
(
result
,
"查询成功"
);
}
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论