Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
3dd24695
提交
3dd24695
authored
3月 31, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(base): get请求restful风格
上级
1b902988
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
78 行增加
和
92 行删除
+78
-92
pom.xml
kt-base/pom.xml
+6
-0
Parameter.java
...e/src/main/java/org/matrix/database/entity/Parameter.java
+6
-0
ConnectController.java
...ava/org/matrix/autotest/controller/ConnectController.java
+14
-20
DynamicVariableController.java
...matrix/autotest/controller/DynamicVariableController.java
+14
-20
EnvironmentController.java
...org/matrix/autotest/controller/EnvironmentController.java
+14
-20
MoveController.java
...n/java/org/matrix/autotest/controller/MoveController.java
+12
-15
SwaggerController.java
...ava/org/matrix/autotest/controller/SwaggerController.java
+2
-0
TestCaseController.java
...va/org/matrix/autotest/controller/TestCaseController.java
+10
-17
没有找到文件。
kt-base/pom.xml
浏览文件 @
3dd24695
...
@@ -120,6 +120,12 @@
...
@@ -120,6 +120,12 @@
<version>
2.9.2
</version>
<version>
2.9.2
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
2.0.7
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.google.inject
</groupId>
<groupId>
com.google.inject
</groupId>
<artifactId>
guice
</artifactId>
<artifactId>
guice
</artifactId>
...
...
kt-base/src/main/java/org/matrix/database/entity/Parameter.java
浏览文件 @
3dd24695
...
@@ -35,4 +35,10 @@ public class Parameter {
...
@@ -35,4 +35,10 @@ public class Parameter {
@ApiModelProperty
(
value
=
"in"
)
@ApiModelProperty
(
value
=
"in"
)
private
String
in
;
private
String
in
;
/**
* schema
*/
@ApiModelProperty
(
value
=
"schema"
)
private
String
schema
;
}
}
kt-web/src/main/java/org/matrix/autotest/controller/ConnectController.java
浏览文件 @
3dd24695
...
@@ -71,11 +71,10 @@ public class ConnectController {
...
@@ -71,11 +71,10 @@ public class ConnectController {
*
*
* @param pageSize 每页多少条数据
* @param pageSize 每页多少条数据
* @param pageNum 当前第几页
* @param pageNum 当前第几页
* @param name 数据库名称
* @return 分页查询的结果, 数据库信息
* @return 分页查询的结果, 数据库信息
*/
*/
@ApiOperation
(
value
=
"分页查询数据库信息"
)
@ApiOperation
(
value
=
"分页查询数据库信息"
)
@GetMapping
(
"/
{projectId}
"
)
@GetMapping
(
"/
page
"
)
@Cacheable
(
cacheNames
=
"connectPageCache"
,
@Cacheable
(
cacheNames
=
"connectPageCache"
,
key
=
"#pageSize + '_' + #pageNum + '_' + #projectId"
,
key
=
"#pageSize + '_' + #pageNum + '_' + #projectId"
,
condition
=
"#pageNum != null && #pageSize != null"
,
condition
=
"#pageNum != null && #pageSize != null"
,
...
@@ -83,12 +82,10 @@ public class ConnectController {
...
@@ -83,12 +82,10 @@ public class ConnectController {
public
ResponseEntity
<
CommonResultObj
<
Page
<
Connect
>>>
findPageConnects
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
Connect
>>>
findPageConnects
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
Long
projectId
)
{
@PathVariable
Long
projectId
)
{
Page
<
Connect
>
results
=
Optional
.
ofNullable
(
connectService
.
page
(
Page
.
of
(
pageNum
,
pageSize
),
Wrappers
.
lambdaQuery
(
Connect
.
class
)
Page
<
Connect
>
results
=
Optional
.
ofNullable
(
connectService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
.
eq
(
Connect:
:
getProjectId
,
projectId
)))
,
Wrappers
.
lambdaQuery
(
Connect
.
class
).
eq
(
Connect:
:
getProjectId
,
projectId
)
.
orElse
(
new
Page
<>());
.
like
(
StringUtils
.
hasLength
(
name
)
,
Connect:
:
getName
,
name
))).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
}
...
@@ -102,16 +99,16 @@ public class ConnectController {
...
@@ -102,16 +99,16 @@ public class ConnectController {
* @return 分页查询的结果, 数据库信息
* @return 分页查询的结果, 数据库信息
*/
*/
@ApiOperation
(
value
=
"条件查询数据库信息"
)
@ApiOperation
(
value
=
"条件查询数据库信息"
)
@GetMapping
(
"/condition
/{projectId}
"
)
@GetMapping
(
"/condition"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
Connect
>>>
findConditionConnects
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
Connect
>>>
findConditionConnects
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@
PathVariable
Long
projectId
)
{
@
RequestParam
Long
projectId
)
{
Page
<
Connect
>
results
=
Optional
.
ofNullable
(
connectService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
Page
<
Connect
>
results
=
Optional
.
ofNullable
(
connectService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
Connect
.
class
)
,
Wrappers
.
lambdaQuery
(
Connect
.
class
)
.
eq
(
Connect:
:
getProjectId
,
projectId
)
.
eq
(
Connect:
:
getProjectId
,
projectId
)
.
like
(
StringUtils
.
hasLength
(
name
)
.
like
(
StringUtils
.
hasLength
(
name
)
,
Connect:
:
getName
,
name
)))
,
Connect:
:
getName
,
name
)))
.
orElse
(
new
Page
<>());
.
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
}
...
@@ -131,8 +128,7 @@ public class ConnectController {
...
@@ -131,8 +128,7 @@ public class ConnectController {
evict
=
{
@CacheEvict
(
cacheNames
=
"connectPageCache"
,
allEntries
=
true
)}
evict
=
{
@CacheEvict
(
cacheNames
=
"connectPageCache"
,
allEntries
=
true
)}
)
)
public
ResponseEntity
<
CommonResultObj
<
Connect
>>
insertConnect
(
@RequestBody
Connect
connect
)
{
public
ResponseEntity
<
CommonResultObj
<
Connect
>>
insertConnect
(
@RequestBody
Connect
connect
)
{
return
CommonResult
.
pred
(
connectService:
:
save
,
connect
return
CommonResult
.
pred
(
connectService:
:
save
,
connect
,
"添加成功"
,
"添加失败"
);
,
"添加成功"
,
"添加失败"
);
}
}
/**
/**
...
@@ -150,8 +146,7 @@ public class ConnectController {
...
@@ -150,8 +146,7 @@ public class ConnectController {
evict
=
{
@CacheEvict
(
cacheNames
=
"connectPageCache"
,
allEntries
=
true
)}
evict
=
{
@CacheEvict
(
cacheNames
=
"connectPageCache"
,
allEntries
=
true
)}
)
)
public
ResponseEntity
<
CommonResultObj
<
Connect
>>
updateConnect
(
@RequestBody
Connect
connect
)
{
public
ResponseEntity
<
CommonResultObj
<
Connect
>>
updateConnect
(
@RequestBody
Connect
connect
)
{
return
CommonResult
.
pred
(
connectService:
:
updateById
,
connect
return
CommonResult
.
pred
(
connectService:
:
updateById
,
connect
,
"修改成功"
,
"修改失败"
);
,
"修改成功"
,
"修改失败"
);
}
}
/**
/**
...
@@ -164,8 +159,7 @@ public class ConnectController {
...
@@ -164,8 +159,7 @@ public class ConnectController {
@DeleteMapping
(
"/{id}"
)
@DeleteMapping
(
"/{id}"
)
@CacheEvict
(
cacheNames
=
"connectPageCache"
,
allEntries
=
true
,
condition
=
"#p0 != null"
)
@CacheEvict
(
cacheNames
=
"connectPageCache"
,
allEntries
=
true
,
condition
=
"#p0 != null"
)
public
ResponseEntity
<
CommonResultObj
<
Long
>>
deleteConnect
(
@PathVariable
Long
id
)
{
public
ResponseEntity
<
CommonResultObj
<
Long
>>
deleteConnect
(
@PathVariable
Long
id
)
{
return
CommonResult
.
pred
(
connectService:
:
removeById
,
id
return
CommonResult
.
pred
(
connectService:
:
removeById
,
id
,
"删除成功"
,
"删除失败或id不存在"
);
,
"删除成功"
,
"删除失败或id不存在"
);
}
}
}
}
kt-web/src/main/java/org/matrix/autotest/controller/DynamicVariableController.java
浏览文件 @
3dd24695
...
@@ -44,12 +44,11 @@ public class DynamicVariableController {
...
@@ -44,12 +44,11 @@ public class DynamicVariableController {
*
*
* @param pageSize 每页多少条数据
* @param pageSize 每页多少条数据
* @param pageNum 当前第几页
* @param pageNum 当前第几页
* @param name 动参名称
* @param projectId 项目id
* @param projectId 项目id
* @return 分页查询的结果, 动参
* @return 分页查询的结果, 动参
*/
*/
@ApiOperation
(
value
=
"分页查询动参"
)
@ApiOperation
(
value
=
"分页查询动参"
)
@GetMapping
(
"/
{projectId}
"
)
@GetMapping
(
"/
page
"
)
@Cacheable
(
cacheNames
=
"dynamicVariablePageCache"
,
@Cacheable
(
cacheNames
=
"dynamicVariablePageCache"
,
key
=
"#pageSize + '_' + #pageNum + '_' + #projectId"
,
key
=
"#pageSize + '_' + #pageNum + '_' + #projectId"
,
condition
=
"#pageNum != null && #pageSize != null"
,
condition
=
"#pageNum != null && #pageSize != null"
,
...
@@ -57,12 +56,10 @@ public class DynamicVariableController {
...
@@ -57,12 +56,10 @@ public class DynamicVariableController {
public
ResponseEntity
<
CommonResultObj
<
Page
<
DynamicVariable
>>>
findPageDynamicVariable
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
DynamicVariable
>>>
findPageDynamicVariable
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
Long
projectId
)
{
@PathVariable
Long
projectId
)
{
Page
<
DynamicVariable
>
results
=
Optional
.
ofNullable
(
dynamicVariableService
.
page
(
Page
.
of
(
pageNum
,
pageSize
),
Wrappers
.
lambdaQuery
(
DynamicVariable
.
class
)
Page
<
DynamicVariable
>
results
=
Optional
.
ofNullable
(
dynamicVariableService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
.
eq
(
DynamicVariable:
:
getProjectId
,
projectId
)))
,
Wrappers
.
lambdaQuery
(
DynamicVariable
.
class
).
eq
(
DynamicVariable:
:
getProjectId
,
projectId
)
.
orElse
(
new
Page
<>());
.
like
(
StringUtils
.
hasLength
(
name
)
,
DynamicVariable:
:
getName
,
name
))).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
}
...
@@ -77,16 +74,16 @@ public class DynamicVariableController {
...
@@ -77,16 +74,16 @@ public class DynamicVariableController {
* @return 分页查询的结果, 动参
* @return 分页查询的结果, 动参
*/
*/
@ApiOperation
(
value
=
"条件查询动参"
)
@ApiOperation
(
value
=
"条件查询动参"
)
@GetMapping
(
"/condition
/{projectId}
"
)
@GetMapping
(
"/condition"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
DynamicVariable
>>>
findConditionDynamicVariable
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
DynamicVariable
>>>
findConditionDynamicVariable
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@
PathVariable
Long
projectId
)
{
@
RequestParam
Long
projectId
)
{
Page
<
DynamicVariable
>
results
=
Optional
.
ofNullable
(
dynamicVariableService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
Page
<
DynamicVariable
>
results
=
Optional
.
ofNullable
(
dynamicVariableService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
DynamicVariable
.
class
)
,
Wrappers
.
lambdaQuery
(
DynamicVariable
.
class
)
.
eq
(
DynamicVariable:
:
getProjectId
,
projectId
)
.
eq
(
DynamicVariable:
:
getProjectId
,
projectId
)
.
like
(
StringUtils
.
hasLength
(
name
)
.
like
(
StringUtils
.
hasLength
(
name
)
,
DynamicVariable:
:
getName
,
name
)))
,
DynamicVariable:
:
getName
,
name
)))
.
orElse
(
new
Page
<>());
.
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
}
...
@@ -106,8 +103,7 @@ public class DynamicVariableController {
...
@@ -106,8 +103,7 @@ public class DynamicVariableController {
evict
=
{
@CacheEvict
(
cacheNames
=
"dynamicVariablePageCache"
,
allEntries
=
true
)}
evict
=
{
@CacheEvict
(
cacheNames
=
"dynamicVariablePageCache"
,
allEntries
=
true
)}
)
)
public
ResponseEntity
<
CommonResultObj
<
DynamicVariable
>>
insertDynamicVariable
(
@RequestBody
DynamicVariable
dynamicVariable
)
{
public
ResponseEntity
<
CommonResultObj
<
DynamicVariable
>>
insertDynamicVariable
(
@RequestBody
DynamicVariable
dynamicVariable
)
{
return
CommonResult
.
pred
(
dynamicVariableService:
:
save
,
dynamicVariable
return
CommonResult
.
pred
(
dynamicVariableService:
:
save
,
dynamicVariable
,
"添加成功"
,
"添加失败"
);
,
"添加成功"
,
"添加失败"
);
}
}
/**
/**
...
@@ -125,8 +121,7 @@ public class DynamicVariableController {
...
@@ -125,8 +121,7 @@ public class DynamicVariableController {
evict
=
{
@CacheEvict
(
cacheNames
=
"dynamicVariablePageCache"
,
allEntries
=
true
)}
evict
=
{
@CacheEvict
(
cacheNames
=
"dynamicVariablePageCache"
,
allEntries
=
true
)}
)
)
public
ResponseEntity
<
CommonResultObj
<
DynamicVariable
>>
updateDynamicVariable
(
@RequestBody
DynamicVariable
dynamicVariable
)
{
public
ResponseEntity
<
CommonResultObj
<
DynamicVariable
>>
updateDynamicVariable
(
@RequestBody
DynamicVariable
dynamicVariable
)
{
return
CommonResult
.
pred
(
dynamicVariableService:
:
updateById
,
dynamicVariable
return
CommonResult
.
pred
(
dynamicVariableService:
:
updateById
,
dynamicVariable
,
"修改成功"
,
"修改失败"
);
,
"修改成功"
,
"修改失败"
);
}
}
/**
/**
...
@@ -139,8 +134,7 @@ public class DynamicVariableController {
...
@@ -139,8 +134,7 @@ public class DynamicVariableController {
@DeleteMapping
(
"/{id}"
)
@DeleteMapping
(
"/{id}"
)
@CacheEvict
(
cacheNames
=
"dynamicVariablePageCache"
,
allEntries
=
true
,
condition
=
"#p0 != null"
)
@CacheEvict
(
cacheNames
=
"dynamicVariablePageCache"
,
allEntries
=
true
,
condition
=
"#p0 != null"
)
public
ResponseEntity
<
CommonResultObj
<
Long
>>
deleteDynamicVariable
(
@PathVariable
Long
id
)
{
public
ResponseEntity
<
CommonResultObj
<
Long
>>
deleteDynamicVariable
(
@PathVariable
Long
id
)
{
return
CommonResult
.
pred
(
dynamicVariableService:
:
removeById
,
id
return
CommonResult
.
pred
(
dynamicVariableService:
:
removeById
,
id
,
"删除成功"
,
"删除失败或id不存在"
);
,
"删除成功"
,
"删除失败或id不存在"
);
}
}
}
}
kt-web/src/main/java/org/matrix/autotest/controller/EnvironmentController.java
浏览文件 @
3dd24695
...
@@ -44,12 +44,11 @@ public class EnvironmentController {
...
@@ -44,12 +44,11 @@ public class EnvironmentController {
*
*
* @param pageSize 每页多少条数据
* @param pageSize 每页多少条数据
* @param pageNum 当前第几页
* @param pageNum 当前第几页
* @param name 环境名称
* @param projectId 项目id
* @param projectId 项目id
* @return 分页查询的结果, 环境
* @return 分页查询的结果, 环境
*/
*/
@ApiOperation
(
value
=
"分页查询环境"
)
@ApiOperation
(
value
=
"分页查询环境"
)
@GetMapping
(
"/
{projectId}
"
)
@GetMapping
(
"/
page
"
)
@Cacheable
(
cacheNames
=
"environmentPageCache"
,
@Cacheable
(
cacheNames
=
"environmentPageCache"
,
key
=
"#pageSize + '_' + #pageNum + '_' + #projectId"
,
key
=
"#pageSize + '_' + #pageNum + '_' + #projectId"
,
condition
=
"#pageNum != null && #pageSize != null"
,
condition
=
"#pageNum != null && #pageSize != null"
,
...
@@ -57,12 +56,10 @@ public class EnvironmentController {
...
@@ -57,12 +56,10 @@ public class EnvironmentController {
public
ResponseEntity
<
CommonResultObj
<
Page
<
Environment
>>>
findPageEnvironment
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
Environment
>>>
findPageEnvironment
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
Long
projectId
)
{
@PathVariable
Long
projectId
)
{
Page
<
Environment
>
results
=
Optional
.
ofNullable
(
environmentService
.
page
(
Page
.
of
(
pageNum
,
pageSize
),
Wrappers
.
lambdaQuery
(
Environment
.
class
)
Page
<
Environment
>
results
=
Optional
.
ofNullable
(
environmentService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
.
eq
(
Environment:
:
getProjectId
,
projectId
)))
,
Wrappers
.
lambdaQuery
(
Environment
.
class
).
eq
(
Environment:
:
getProjectId
,
projectId
)
.
orElse
(
new
Page
<>());
.
like
(
StringUtils
.
hasLength
(
name
)
,
Environment:
:
getName
,
name
))).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
}
...
@@ -77,16 +74,16 @@ public class EnvironmentController {
...
@@ -77,16 +74,16 @@ public class EnvironmentController {
* @return 分页查询的结果, 环境
* @return 分页查询的结果, 环境
*/
*/
@ApiOperation
(
value
=
"条件查询环境"
)
@ApiOperation
(
value
=
"条件查询环境"
)
@GetMapping
(
"/condition
/{projectId}
"
)
@GetMapping
(
"/condition"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
Environment
>>>
findConditionEnvironment
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
Environment
>>>
findConditionEnvironment
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@
PathVariable
Long
projectId
)
{
@
RequestParam
Long
projectId
)
{
Page
<
Environment
>
results
=
Optional
.
ofNullable
(
environmentService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
Page
<
Environment
>
results
=
Optional
.
ofNullable
(
environmentService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
Environment
.
class
)
,
Wrappers
.
lambdaQuery
(
Environment
.
class
)
.
eq
(
Environment:
:
getProjectId
,
projectId
)
.
eq
(
Environment:
:
getProjectId
,
projectId
)
.
like
(
StringUtils
.
hasLength
(
name
)
.
like
(
StringUtils
.
hasLength
(
name
)
,
Environment:
:
getName
,
name
)))
,
Environment:
:
getName
,
name
)))
.
orElse
(
new
Page
<>());
.
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
}
...
@@ -106,8 +103,7 @@ public class EnvironmentController {
...
@@ -106,8 +103,7 @@ public class EnvironmentController {
evict
=
{
@CacheEvict
(
cacheNames
=
"environmentPageCache"
,
allEntries
=
true
)}
evict
=
{
@CacheEvict
(
cacheNames
=
"environmentPageCache"
,
allEntries
=
true
)}
)
)
public
ResponseEntity
<
CommonResultObj
<
Environment
>>
insertEnvironment
(
@RequestBody
Environment
environment
)
{
public
ResponseEntity
<
CommonResultObj
<
Environment
>>
insertEnvironment
(
@RequestBody
Environment
environment
)
{
return
CommonResult
.
pred
(
environmentService:
:
save
,
environment
return
CommonResult
.
pred
(
environmentService:
:
save
,
environment
,
"添加成功"
,
"添加失败"
);
,
"添加成功"
,
"添加失败"
);
}
}
/**
/**
...
@@ -125,8 +121,7 @@ public class EnvironmentController {
...
@@ -125,8 +121,7 @@ public class EnvironmentController {
evict
=
{
@CacheEvict
(
cacheNames
=
"environmentPageCache"
,
allEntries
=
true
)}
evict
=
{
@CacheEvict
(
cacheNames
=
"environmentPageCache"
,
allEntries
=
true
)}
)
)
public
ResponseEntity
<
CommonResultObj
<
Environment
>>
updateEnvironment
(
@RequestBody
Environment
environment
)
{
public
ResponseEntity
<
CommonResultObj
<
Environment
>>
updateEnvironment
(
@RequestBody
Environment
environment
)
{
return
CommonResult
.
pred
(
environmentService:
:
updateById
,
environment
return
CommonResult
.
pred
(
environmentService:
:
updateById
,
environment
,
"修改成功"
,
"修改失败"
);
,
"修改成功"
,
"修改失败"
);
}
}
/**
/**
...
@@ -139,8 +134,7 @@ public class EnvironmentController {
...
@@ -139,8 +134,7 @@ public class EnvironmentController {
@DeleteMapping
(
"/{id}"
)
@DeleteMapping
(
"/{id}"
)
@CacheEvict
(
cacheNames
=
"environmentPageCache"
,
allEntries
=
true
,
condition
=
"#p0 != null"
)
@CacheEvict
(
cacheNames
=
"environmentPageCache"
,
allEntries
=
true
,
condition
=
"#p0 != null"
)
public
ResponseEntity
<
CommonResultObj
<
Long
>>
deleteEnvironment
(
@PathVariable
Long
id
)
{
public
ResponseEntity
<
CommonResultObj
<
Long
>>
deleteEnvironment
(
@PathVariable
Long
id
)
{
return
CommonResult
.
pred
(
environmentService:
:
removeById
,
id
return
CommonResult
.
pred
(
environmentService:
:
removeById
,
id
,
"删除成功"
,
"删除失败或id不存在"
);
,
"删除成功"
,
"删除失败或id不存在"
);
}
}
}
}
kt-web/src/main/java/org/matrix/autotest/controller/MoveController.java
浏览文件 @
3dd24695
...
@@ -68,12 +68,11 @@ public class MoveController {
...
@@ -68,12 +68,11 @@ public class MoveController {
*
*
* @param pageSize 每页多少条数据
* @param pageSize 每页多少条数据
* @param pageNum 当前第几页
* @param pageNum 当前第几页
* @param name 行为名称
* @param projectId 项目id
* @param projectId 项目id
* @return 分页查询的结果, 行为
* @return 分页查询的结果, 行为
*/
*/
@ApiOperation
(
value
=
"分页查询行为"
)
@ApiOperation
(
value
=
"分页查询行为"
)
@GetMapping
(
"/
{projectId}
"
)
@GetMapping
(
"/
page
"
)
@Cacheable
(
cacheNames
=
"movePageName"
,
@Cacheable
(
cacheNames
=
"movePageName"
,
key
=
"#pageNum + '_' + #pageSize + '_' + #projectId"
,
key
=
"#pageNum + '_' + #pageSize + '_' + #projectId"
,
condition
=
"#pageNum != null && #pageSize != null"
,
condition
=
"#pageNum != null && #pageSize != null"
,
...
@@ -81,12 +80,10 @@ public class MoveController {
...
@@ -81,12 +80,10 @@ public class MoveController {
public
ResponseEntity
<
CommonResultObj
<
Page
<
Move
>>>
findPageConnects
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
Move
>>>
findPageConnects
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
Long
projectId
)
{
@PathVariable
Long
projectId
)
{
Page
<
Move
>
results
=
Optional
.
ofNullable
(
moveService
.
page
(
Page
.
of
(
pageNum
,
pageSize
),
Wrappers
.
lambdaQuery
(
Move
.
class
)
Page
<
Move
>
results
=
Optional
.
ofNullable
(
moveService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
.
eq
(
Move:
:
getProjectId
,
projectId
)))
,
Wrappers
.
lambdaQuery
(
Move
.
class
).
eq
(
Move:
:
getProjectId
,
projectId
)
.
orElse
(
new
Page
<>());
.
like
(
StringUtils
.
hasLength
(
name
)
,
Move:
:
getName
,
name
))).
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
}
...
@@ -101,16 +98,16 @@ public class MoveController {
...
@@ -101,16 +98,16 @@ public class MoveController {
* @return 分页查询的结果, 行为
* @return 分页查询的结果, 行为
*/
*/
@ApiOperation
(
value
=
"条件查询行为"
)
@ApiOperation
(
value
=
"条件查询行为"
)
@GetMapping
(
"/condition
/{projectId}
"
)
@GetMapping
(
"/condition"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
Move
>>>
findConditionConnects
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
Move
>>>
findConditionConnects
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@
PathVariable
Long
projectId
)
{
@
RequestParam
Long
projectId
)
{
Page
<
Move
>
results
=
Optional
.
ofNullable
(
moveService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
Page
<
Move
>
results
=
Optional
.
ofNullable
(
moveService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
,
Wrappers
.
lambdaQuery
(
Move
.
class
)
,
Wrappers
.
lambdaQuery
(
Move
.
class
)
.
eq
(
Move:
:
getProjectId
,
projectId
)
.
eq
(
Move:
:
getProjectId
,
projectId
)
.
like
(
StringUtils
.
hasLength
(
name
)
.
like
(
StringUtils
.
hasLength
(
name
)
,
Move:
:
getName
,
name
)))
,
Move:
:
getName
,
name
)))
.
orElse
(
new
Page
<>());
.
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
}
}
...
@@ -122,7 +119,7 @@ public class MoveController {
...
@@ -122,7 +119,7 @@ public class MoveController {
* @return {@link MoveAction}
* @return {@link MoveAction}
*/
*/
@ApiOperation
(
value
=
"根据行为id查,行为以及,行为下的动作"
)
@ApiOperation
(
value
=
"根据行为id查,行为以及,行为下的动作"
)
@GetMapping
(
"/
move/
{moveId}"
)
@GetMapping
(
"/{moveId}"
)
@Cacheable
(
cacheNames
=
"moveNames"
,
@Cacheable
(
cacheNames
=
"moveNames"
,
key
=
"#moveId"
,
key
=
"#moveId"
,
condition
=
"#p0 != null"
,
condition
=
"#p0 != null"
,
...
...
kt-web/src/main/java/org/matrix/autotest/controller/SwaggerController.java
浏览文件 @
3dd24695
...
@@ -170,6 +170,7 @@ public class SwaggerController {
...
@@ -170,6 +170,7 @@ public class SwaggerController {
String
methodIn
=
parameterMaps
.
get
(
"in"
);
String
methodIn
=
parameterMaps
.
get
(
"in"
);
String
methodName
=
parameterMaps
.
get
(
"name"
);
String
methodName
=
parameterMaps
.
get
(
"name"
);
String
methodType
=
parameterMaps
.
get
(
"type"
);
String
methodType
=
parameterMaps
.
get
(
"type"
);
// String methodSchema = parameterMaps.get("schema");
Parameter
parameter
=
new
Parameter
();
Parameter
parameter
=
new
Parameter
();
//传参格式
//传参格式
parameter
.
setIn
(
methodIn
);
parameter
.
setIn
(
methodIn
);
...
@@ -177,6 +178,7 @@ public class SwaggerController {
...
@@ -177,6 +178,7 @@ public class SwaggerController {
parameter
.
setName
(
methodName
);
parameter
.
setName
(
methodName
);
//拿到参数类型
//拿到参数类型
parameter
.
setType
(
methodType
);
parameter
.
setType
(
methodType
);
// parameter.setSchema(methodSchema);
parameterAllList
.
add
(
parameter
);
parameterAllList
.
add
(
parameter
);
}
}
interfaceInformation
.
setId
(
i
++);
interfaceInformation
.
setId
(
i
++);
...
...
kt-web/src/main/java/org/matrix/autotest/controller/TestCaseController.java
浏览文件 @
3dd24695
...
@@ -57,11 +57,10 @@ public class TestCaseController {
...
@@ -57,11 +57,10 @@ public class TestCaseController {
*
*
* @param pageSize 每页多少条数据
* @param pageSize 每页多少条数据
* @param pageNum 当前第几页
* @param pageNum 当前第几页
* @param name 行为名称
* @param projectId 项目id
* @param projectId 项目id
* @return 分页查询的结果, 用例
* @return 分页查询的结果, 用例
*/
*/
@GetMapping
(
"/
{projectId}
"
)
@GetMapping
(
"/
page
"
)
@ApiOperation
(
value
=
"分页查询用例"
)
@ApiOperation
(
value
=
"分页查询用例"
)
@Cacheable
(
cacheNames
=
"casePageCache"
,
@Cacheable
(
cacheNames
=
"casePageCache"
,
key
=
"#pageNum + '_' + #pageSize + '_' + #projectId "
,
key
=
"#pageNum + '_' + #pageSize + '_' + #projectId "
,
...
@@ -70,13 +69,9 @@ public class TestCaseController {
...
@@ -70,13 +69,9 @@ public class TestCaseController {
public
ResponseEntity
<
CommonResultObj
<
Page
<
TestCase
>>>
findPageTestCase
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
TestCase
>>>
findPageTestCase
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
Long
projectId
)
{
@PathVariable
Long
projectId
)
{
Page
<
TestCase
>
results
=
Optional
.
ofNullable
(
testCaseService
.
page
(
Page
.
of
(
pageNum
,
pageSize
),
Wrappers
.
lambdaQuery
(
TestCase
.
class
)
.
eq
(
TestCase:
:
getProjectId
,
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
<>());
.
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
...
@@ -91,18 +86,16 @@ public class TestCaseController {
...
@@ -91,18 +86,16 @@ public class TestCaseController {
* @param projectId 项目id
* @param projectId 项目id
* @return 分页查询的结果, 用例
* @return 分页查询的结果, 用例
*/
*/
@GetMapping
(
"/condition
/{projectId}
"
)
@GetMapping
(
"/condition"
)
@ApiOperation
(
value
=
"条件查询用例"
)
@ApiOperation
(
value
=
"条件查询用例"
)
public
ResponseEntity
<
CommonResultObj
<
Page
<
TestCase
>>>
findConditionTestCase
(
public
ResponseEntity
<
CommonResultObj
<
Page
<
TestCase
>>>
findConditionTestCase
(
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
int
pageSize
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
name
,
@PathVariable
Long
projectId
)
{
@RequestParam
Long
projectId
)
{
Page
<
TestCase
>
results
=
Optional
.
ofNullable
(
testCaseService
.
page
(
Page
.
of
(
pageNum
,
pageSize
),
Wrappers
.
lambdaQuery
(
TestCase
.
class
)
Page
<
TestCase
>
results
=
Optional
.
ofNullable
(
testCaseService
.
page
(
Page
.
of
(
pageNum
,
pageSize
)
.
eq
(
TestCase:
:
getProjectId
,
projectId
)
,
Wrappers
.
lambdaQuery
(
TestCase
.
class
)
.
like
(
StringUtils
.
hasLength
(
name
),
TestCase:
:
getName
,
name
)))
.
eq
(
TestCase:
:
getProjectId
,
projectId
)
.
like
(
StringUtils
.
hasLength
(
name
),
TestCase:
:
getName
,
name
)))
.
orElse
(
new
Page
<>());
.
orElse
(
new
Page
<>());
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
PageTools
.
pageTool
(
pageSize
,
pageNum
,
results
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
return
CommonResult
.
success
(
results
,
"查询成功"
);
...
@@ -114,7 +107,7 @@ public class TestCaseController {
...
@@ -114,7 +107,7 @@ public class TestCaseController {
* @param testCaseId 用例id
* @param testCaseId 用例id
* @return {@link TestCaseData}
* @return {@link TestCaseData}
*/
*/
@GetMapping
(
"/
testCase/
{testCaseId}"
)
@GetMapping
(
"/{testCaseId}"
)
@ApiOperation
(
value
=
"根据用例id查,用例以及,用例下的数据组"
)
@ApiOperation
(
value
=
"根据用例id查,用例以及,用例下的数据组"
)
@Cacheable
(
cacheNames
=
"caseCache"
,
@Cacheable
(
cacheNames
=
"caseCache"
,
key
=
"#testCaseId"
,
condition
=
"#p0 !=null"
,
key
=
"#testCaseId"
,
condition
=
"#p0 !=null"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论