Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
e194cc04
提交
e194cc04
authored
3月 10, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(web): 修改了分页超出无数据的问题
上级
5edb1db7
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
31 行增加
和
20 行删除
+31
-20
ConnectController.java
...ava/org/matrix/autotest/controller/ConnectController.java
+4
-2
DynamicVariableController.java
...matrix/autotest/controller/DynamicVariableController.java
+4
-2
EnvironmentController.java
...org/matrix/autotest/controller/EnvironmentController.java
+4
-2
ExecutionRecordController.java
...matrix/autotest/controller/ExecutionRecordController.java
+4
-2
MoveController.java
...n/java/org/matrix/autotest/controller/MoveController.java
+4
-2
SwaggerController.java
...ava/org/matrix/autotest/controller/SwaggerController.java
+3
-6
TestCaseController.java
...va/org/matrix/autotest/controller/TestCaseController.java
+4
-2
TestTaskController.java
...va/org/matrix/autotest/controller/TestTaskController.java
+4
-2
没有找到文件。
kt-web/src/main/java/org/matrix/autotest/controller/ConnectController.java
浏览文件 @
e194cc04
...
...
@@ -4,6 +4,7 @@ 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.Connect
;
import
org.matrix.database.service.IConnectService
;
import
org.matrix.database.vo.CommonResult
;
...
...
@@ -45,13 +46,14 @@ public class ConnectController {
@ApiOperation
(
value
=
"分页查询数据库信息"
)
@GetMapping
public
ResponseEntity
<
CommonResultObj
<
Page
<
Connect
>>>
findPageConnects
(
int
pageSize
,
int
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
String
name
)
{
Page
<
Connect
>
results
=
Optional
.
ofNullable
(
connectService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
Connect
.
class
)
.
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
,
"查询失败或无数据"
);
...
...
kt-web/src/main/java/org/matrix/autotest/controller/DynamicVariableController.java
浏览文件 @
e194cc04
...
...
@@ -4,6 +4,7 @@ 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.DynamicVariable
;
import
org.matrix.database.service.IDynamicVariableService
;
import
org.matrix.database.vo.CommonResult
;
...
...
@@ -46,13 +47,14 @@ public class DynamicVariableController {
@ApiOperation
(
value
=
"分页查询动参"
)
@GetMapping
(
"/{projectId}"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
DynamicVariable
>>>
findPageConnects
(
int
pageSize
,
int
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
String
name
,
@PathVariable
Long
projectId
)
{
Page
<
DynamicVariable
>
results
=
Optional
.
ofNullable
(
dynamicVariableService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
DynamicVariable
.
class
).
eq
(
DynamicVariable:
:
getProjectId
,
projectId
)
.
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
,
"查询失败或无数据"
);
...
...
kt-web/src/main/java/org/matrix/autotest/controller/EnvironmentController.java
浏览文件 @
e194cc04
...
...
@@ -4,6 +4,7 @@ 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.Environment
;
import
org.matrix.database.service.IEnvironmentService
;
import
org.matrix.database.vo.CommonResult
;
...
...
@@ -46,13 +47,14 @@ public class EnvironmentController {
@ApiOperation
(
value
=
"分页查询环境"
)
@GetMapping
(
"/{projectId}"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
Environment
>>>
findPageConnects
(
int
pageSize
,
int
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
String
name
,
@PathVariable
Long
projectId
)
{
Page
<
Environment
>
results
=
Optional
.
ofNullable
(
environmentService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
Environment
.
class
).
eq
(
Environment:
:
getProjectId
,
projectId
)
.
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
,
"查询失败或无数据"
);
...
...
kt-web/src/main/java/org/matrix/autotest/controller/ExecutionRecordController.java
浏览文件 @
e194cc04
...
...
@@ -4,6 +4,7 @@ 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.service.IExecutionRecordService
;
import
org.matrix.database.vo.CommonResult
;
...
...
@@ -47,8 +48,8 @@ public class ExecutionRecordController {
@ApiOperation
(
"分页查询执行记录"
)
@GetMapping
public
ResponseEntity
<
CommonResultObj
<
Page
<
ExecutionRecord
>>>
findPageExecutionRecord
(
int
pageSize
,
int
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
Long
userId
,
Long
testDataId
,
Long
testCaseId
,
...
...
@@ -64,6 +65,7 @@ public class ExecutionRecordController {
.
eq
(
status
!=
null
,
ExecutionRecord:
:
getStatus
,
status
)
.
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
,
"查询失败或无数据"
);
...
...
kt-web/src/main/java/org/matrix/autotest/controller/MoveController.java
浏览文件 @
e194cc04
...
...
@@ -4,6 +4,7 @@ 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.Action
;
import
org.matrix.database.entity.Move
;
import
org.matrix.database.service.IActionService
;
...
...
@@ -58,13 +59,14 @@ public class MoveController {
@ApiOperation
(
value
=
"分页查询行为"
)
@GetMapping
(
"/{projectId}"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
Move
>>>
findPageConnects
(
int
pageSize
,
int
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
String
name
,
@PathVariable
Long
projectId
)
{
Page
<
Move
>
results
=
Optional
.
ofNullable
(
moveService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
Move
.
class
).
eq
(
Move:
:
getProjectId
,
projectId
)
.
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
,
"查询失败或无数据"
);
...
...
kt-web/src/main/java/org/matrix/autotest/controller/SwaggerController.java
浏览文件 @
e194cc04
...
...
@@ -11,10 +11,7 @@ import org.matrix.database.service.IEnvironmentService;
import
org.matrix.database.vo.CommonPage
;
import
org.matrix.exception.GlobalException
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
...
...
@@ -178,8 +175,8 @@ public class SwaggerController {
public
CommonPage
<
List
<
InterfaceInformation
>>
parameter
(
Long
projectId
,
Long
id
,
int
pageSize
,
int
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
String
name
,
String
swaggerUrl
)
{
//将所有的默认选项置为false
...
...
kt-web/src/main/java/org/matrix/autotest/controller/TestCaseController.java
浏览文件 @
e194cc04
...
...
@@ -4,6 +4,7 @@ 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.TestCase
;
import
org.matrix.database.entity.TestData
;
import
org.matrix.database.service.ITestCaseService
;
...
...
@@ -59,13 +60,14 @@ public class TestCaseController {
@ApiOperation
(
value
=
"分页查询用例"
)
@GetMapping
(
"/{projectId}"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
TestCase
>>>
findPageTestCase
(
int
pageSize
,
int
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
String
name
,
@PathVariable
Long
projectId
)
{
Page
<
TestCase
>
results
=
Optional
.
ofNullable
(
testCaseService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
TestCase
.
class
).
eq
(
TestCase:
:
getProjectId
,
projectId
)
.
like
(
StringUtils
.
hasLength
(
name
)
,
TestCase:
:
getName
,
name
))).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
results
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
...
...
kt-web/src/main/java/org/matrix/autotest/controller/TestTaskController.java
浏览文件 @
e194cc04
...
...
@@ -4,6 +4,7 @@ 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.TestTask
;
import
org.matrix.database.service.ITestTaskService
;
import
org.matrix.database.vo.CommonResult
;
...
...
@@ -56,12 +57,13 @@ public class TestTaskController {
@ApiOperation
(
value
=
"分页查询测试任务"
)
@GetMapping
(
"/page"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
TestTask
>>>
findPageTestTasks
(
int
pageSize
,
int
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
String
name
)
{
Page
<
TestTask
>
results
=
Optional
.
of
(
testTaskService
.
page
(
Page
.
of
(
pageNum
,
pageSize
),
Wrappers
.
lambdaQuery
(
TestTask
.
class
)
.
like
(
StringUtils
.
hasLength
(
name
),
TestTask:
:
getName
,
name
)))
.
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
results
.
getRecords
().
size
()
!=
0
?
CommonResult
.
success
(
results
,
"查询成功"
)
:
CommonResult
.
failed
(
results
,
"查询失败或无数据"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论