Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
047c7faf
提交
047c7faf
authored
1月 17, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(web): 完善crud,按行为id查询,按项目id查询
上级
8834ac31
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
176 行增加
和
12 行删除
+176
-12
ActionController.java
...java/org/matrix/autotest/controller/ActionController.java
+17
-2
DynamicVariableController.java
...matrix/autotest/controller/DynamicVariableController.java
+18
-0
EnvironmentController.java
...org/matrix/autotest/controller/EnvironmentController.java
+17
-0
MoveController.java
...n/java/org/matrix/autotest/controller/MoveController.java
+17
-0
TestCaseController.java
...va/org/matrix/autotest/controller/TestCaseController.java
+27
-10
ActionService.java
.../main/java/org/matrix/autotest/service/ActionService.java
+9
-0
DynamicVariableService.java
...a/org/matrix/autotest/service/DynamicVariableService.java
+8
-0
EnvironmentService.java
.../java/org/matrix/autotest/service/EnvironmentService.java
+8
-0
ActionServiceImpl.java
...a/org/matrix/autotest/service/Impl/ActionServiceImpl.java
+7
-0
DynamicVariableServiceImpl.java
...rix/autotest/service/Impl/DynamicVariableServiceImpl.java
+8
-0
EnvironmentServiceImpl.java
.../matrix/autotest/service/Impl/EnvironmentServiceImpl.java
+8
-0
MoveServiceImpl.java
...ava/org/matrix/autotest/service/Impl/MoveServiceImpl.java
+8
-0
TestCaseServiceImpl.java
...org/matrix/autotest/service/Impl/TestCaseServiceImpl.java
+8
-0
MoveService.java
...rc/main/java/org/matrix/autotest/service/MoveService.java
+8
-0
TestCaseService.java
...ain/java/org/matrix/autotest/service/TestCaseService.java
+8
-0
没有找到文件。
kt-web/src/main/java/org/matrix/autotest/controller/ActionController.java
浏览文件 @
047c7faf
...
@@ -119,7 +119,7 @@ public class ActionController {
...
@@ -119,7 +119,7 @@ public class ActionController {
* @return 符合项目id的动作
* @return 符合项目id的动作
*/
*/
@ApiOperation
(
value
=
"根据项目id查询所有"
)
@ApiOperation
(
value
=
"根据项目id查询所有"
)
@GetMapping
(
"/{projectId}"
)
@GetMapping
(
"/
project/
{projectId}"
)
public
CommonResult
<
List
<
Action
>>
findByProjectIdAction
(
@PathVariable
Integer
projectId
)
{
public
CommonResult
<
List
<
Action
>>
findByProjectIdAction
(
@PathVariable
Integer
projectId
)
{
List
<
Action
>
results
=
actionService
.
findByProjectIdAction
(
projectId
);
List
<
Action
>
results
=
actionService
.
findByProjectIdAction
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
...
@@ -127,9 +127,24 @@ public class ActionController {
...
@@ -127,9 +127,24 @@ public class ActionController {
}
else
{
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
//todo 未完成
}
}
/**
* 根据行为id查询动作
*
* @param moveId 行为id
* @return 符合行为id的动作
*/
@ApiOperation
(
value
=
"根据行为id查询所有"
)
@GetMapping
(
"/move/{moveId}"
)
public
CommonResult
<
List
<
Action
>>
findByMoveIdAction
(
@PathVariable
Integer
moveId
)
{
List
<
Action
>
results
=
actionService
.
findByMoveIdAction
(
moveId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
}
}
kt-web/src/main/java/org/matrix/autotest/controller/DynamicVariableController.java
浏览文件 @
047c7faf
...
@@ -112,4 +112,21 @@ public class DynamicVariableController {
...
@@ -112,4 +112,21 @@ public class DynamicVariableController {
}
}
}
}
/**
* 根据项目id查询动作
*
* @param projectId 项目id
* @return 符合项目id的动作
*/
@ApiOperation
(
value
=
"根据项目id查询所有"
)
@GetMapping
(
"/project/{projectId}"
)
public
CommonResult
<
List
<
DynamicVariable
>>
findByProjectIdDynamicVariable
(
@PathVariable
Integer
projectId
)
{
List
<
DynamicVariable
>
results
=
dynamicVariableService
.
findByProjectIdDynamicVariable
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
}
}
\ No newline at end of file
kt-web/src/main/java/org/matrix/autotest/controller/EnvironmentController.java
浏览文件 @
047c7faf
...
@@ -112,5 +112,22 @@ public class EnvironmentController {
...
@@ -112,5 +112,22 @@ public class EnvironmentController {
}
}
}
}
/**
* 根据项目id查询动作
*
* @param projectId 项目id
* @return 符合项目id的动作
*/
@ApiOperation
(
value
=
"根据项目id查询所有"
)
@GetMapping
(
"/project/{projectId}"
)
public
CommonResult
<
List
<
Environment
>>
findByProjectIdEnvironment
(
@PathVariable
Integer
projectId
)
{
List
<
Environment
>
results
=
environmentService
.
findByProjectIdEnvironment
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
}
}
kt-web/src/main/java/org/matrix/autotest/controller/MoveController.java
浏览文件 @
047c7faf
...
@@ -112,5 +112,22 @@ public class MoveController {
...
@@ -112,5 +112,22 @@ public class MoveController {
}
}
}
}
/**
* 根据项目id查询动作
*
* @param projectId 项目id
* @return 符合项目id的动作
*/
@ApiOperation
(
value
=
"根据项目id查询所有"
)
@GetMapping
(
"/project/{projectId}"
)
public
CommonResult
<
List
<
Move
>>
findByProjectIdMove
(
@PathVariable
Integer
projectId
)
{
List
<
Move
>
results
=
moveService
.
findByProjectIdMove
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
}
}
kt-web/src/main/java/org/matrix/autotest/controller/TestCaseController.java
浏览文件 @
047c7faf
...
@@ -37,9 +37,9 @@ public class TestCaseController {
...
@@ -37,9 +37,9 @@ public class TestCaseController {
@GetMapping
@GetMapping
public
CommonResult
<
List
<
TestCase
>>
findAllTestCase
()
{
public
CommonResult
<
List
<
TestCase
>>
findAllTestCase
()
{
List
<
TestCase
>
results
=
testCaseService
.
findAllTestCase
();
List
<
TestCase
>
results
=
testCaseService
.
findAllTestCase
();
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
);
return
CommonResult
.
success
(
results
);
}
else
{
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
}
}
...
@@ -54,9 +54,9 @@ public class TestCaseController {
...
@@ -54,9 +54,9 @@ public class TestCaseController {
@GetMapping
(
"/{id}"
)
@GetMapping
(
"/{id}"
)
public
CommonResult
<
TestCase
>
findByIdTestCase
(
@PathVariable
Integer
id
)
{
public
CommonResult
<
TestCase
>
findByIdTestCase
(
@PathVariable
Integer
id
)
{
TestCase
result
=
testCaseService
.
findByIdTestCase
(
id
);
TestCase
result
=
testCaseService
.
findByIdTestCase
(
id
);
if
(
result
!=
null
){
if
(
result
!=
null
)
{
return
CommonResult
.
success
(
result
);
return
CommonResult
.
success
(
result
);
}
else
{
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
}
}
...
@@ -71,9 +71,9 @@ public class TestCaseController {
...
@@ -71,9 +71,9 @@ public class TestCaseController {
@PostMapping
@PostMapping
public
CommonResult
<
TestCase
>
insertTestCase
(
@RequestBody
TestCase
testCase
)
{
public
CommonResult
<
TestCase
>
insertTestCase
(
@RequestBody
TestCase
testCase
)
{
int
i
=
testCaseService
.
insertTestCase
(
testCase
);
int
i
=
testCaseService
.
insertTestCase
(
testCase
);
if
(
i
!=
0
){
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
testCase
);
return
CommonResult
.
success
(
testCase
);
}
else
{
}
else
{
return
CommonResult
.
failed
(
"添加失败"
);
return
CommonResult
.
failed
(
"添加失败"
);
}
}
}
}
...
@@ -88,9 +88,9 @@ public class TestCaseController {
...
@@ -88,9 +88,9 @@ public class TestCaseController {
@PutMapping
(
"/{id}"
)
@PutMapping
(
"/{id}"
)
public
CommonResult
<
TestCase
>
updateTestCase
(
@RequestBody
TestCase
testCase
)
{
public
CommonResult
<
TestCase
>
updateTestCase
(
@RequestBody
TestCase
testCase
)
{
int
i
=
testCaseService
.
updateTestCase
(
testCase
);
int
i
=
testCaseService
.
updateTestCase
(
testCase
);
if
(
i
!=
0
){
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
testCase
);
return
CommonResult
.
success
(
testCase
);
}
else
{
}
else
{
return
CommonResult
.
failed
(
"修改失败"
);
return
CommonResult
.
failed
(
"修改失败"
);
}
}
}
}
...
@@ -105,12 +105,29 @@ public class TestCaseController {
...
@@ -105,12 +105,29 @@ public class TestCaseController {
@DeleteMapping
(
"/{id}"
)
@DeleteMapping
(
"/{id}"
)
public
CommonResult
<
TestCase
>
deleteTestCase
(
@PathVariable
Integer
id
)
{
public
CommonResult
<
TestCase
>
deleteTestCase
(
@PathVariable
Integer
id
)
{
int
i
=
testCaseService
.
deleteTestCase
(
id
);
int
i
=
testCaseService
.
deleteTestCase
(
id
);
if
(
i
!=
0
){
if
(
i
!=
0
)
{
return
CommonResult
.
success
(
"删除成功"
);
return
CommonResult
.
success
(
"删除成功"
);
}
else
{
}
else
{
return
CommonResult
.
failed
(
"删除失败,或不存在需要删除的数据"
);
return
CommonResult
.
failed
(
"删除失败,或不存在需要删除的数据"
);
}
}
}
}
/**
* 根据项目id查询动作
*
* @param projectId 项目id
* @return 符合项目id的动作
*/
@ApiOperation
(
value
=
"根据项目id查询所有"
)
@GetMapping
(
"/project/{projectId}"
)
public
CommonResult
<
List
<
TestCase
>>
findByProjectIdTestCase
(
@PathVariable
Integer
projectId
)
{
List
<
TestCase
>
results
=
testCaseService
.
findByProjectIdTestCase
(
projectId
);
if
(
results
!=
null
&&
results
.
size
()
!=
0
)
{
return
CommonResult
.
success
(
results
);
}
else
{
return
CommonResult
.
failed
(
"查询失败或无数据"
);
}
}
}
}
kt-web/src/main/java/org/matrix/autotest/service/ActionService.java
浏览文件 @
047c7faf
...
@@ -2,6 +2,7 @@ package org.matrix.autotest.service;
...
@@ -2,6 +2,7 @@ package org.matrix.autotest.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.matrix.autotest.entity.Action
;
import
org.matrix.autotest.entity.Action
;
import
org.matrix.autotest.entity.Move
;
import
java.util.List
;
import
java.util.List
;
...
@@ -62,4 +63,12 @@ public interface ActionService extends IService<Action> {
...
@@ -62,4 +63,12 @@ public interface ActionService extends IService<Action> {
*/
*/
List
<
Action
>
findByProjectIdAction
(
Integer
projectId
);
List
<
Action
>
findByProjectIdAction
(
Integer
projectId
);
/**
* 根据行为id查询动作
*
* @param moveId 行为id
* @return 符合行为id的动作
*/
List
<
Action
>
findByMoveIdAction
(
Integer
moveId
);
}
}
kt-web/src/main/java/org/matrix/autotest/service/DynamicVariableService.java
浏览文件 @
047c7faf
...
@@ -53,4 +53,12 @@ public interface DynamicVariableService extends IService<DynamicVariable> {
...
@@ -53,4 +53,12 @@ public interface DynamicVariableService extends IService<DynamicVariable> {
*/
*/
int
deleteDynamicVariable
(
Integer
id
);
int
deleteDynamicVariable
(
Integer
id
);
/**
* 根据项目id查询动作
*
* @param projectId 项目id
* @return 符合项目id的动作
*/
List
<
DynamicVariable
>
findByProjectIdDynamicVariable
(
Integer
projectId
);
}
}
kt-web/src/main/java/org/matrix/autotest/service/EnvironmentService.java
浏览文件 @
047c7faf
...
@@ -53,4 +53,12 @@ public interface EnvironmentService extends IService<Environment> {
...
@@ -53,4 +53,12 @@ public interface EnvironmentService extends IService<Environment> {
*/
*/
int
deleteEnvironment
(
Integer
id
);
int
deleteEnvironment
(
Integer
id
);
/**
* 根据项目id查询动作
*
* @param projectId 项目id
* @return 符合项目id的动作
*/
List
<
Environment
>
findByProjectIdEnvironment
(
Integer
projectId
);
}
}
kt-web/src/main/java/org/matrix/autotest/service/Impl/ActionServiceImpl.java
浏览文件 @
047c7faf
...
@@ -58,4 +58,11 @@ public class ActionServiceImpl extends ServiceImpl<ActionMapper, Action> impleme
...
@@ -58,4 +58,11 @@ public class ActionServiceImpl extends ServiceImpl<ActionMapper, Action> impleme
return
actionMapper
.
selectList
(
queryWrapper
);
return
actionMapper
.
selectList
(
queryWrapper
);
}
}
@Override
public
List
<
Action
>
findByMoveIdAction
(
Integer
moveId
)
{
QueryWrapper
<
Action
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"move_id"
,
moveId
);
return
actionMapper
.
selectList
(
queryWrapper
);
}
}
}
kt-web/src/main/java/org/matrix/autotest/service/Impl/DynamicVariableServiceImpl.java
浏览文件 @
047c7faf
package
org
.
matrix
.
autotest
.
service
.
Impl
;
package
org
.
matrix
.
autotest
.
service
.
Impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.matrix.autotest.dao.DynamicVariableMapper
;
import
org.matrix.autotest.dao.DynamicVariableMapper
;
import
org.matrix.autotest.entity.DynamicVariable
;
import
org.matrix.autotest.entity.DynamicVariable
;
...
@@ -51,4 +52,11 @@ public class DynamicVariableServiceImpl extends ServiceImpl<DynamicVariableMappe
...
@@ -51,4 +52,11 @@ public class DynamicVariableServiceImpl extends ServiceImpl<DynamicVariableMappe
return
dynamicVariableMapper
.
deleteById
(
id
);
return
dynamicVariableMapper
.
deleteById
(
id
);
}
}
@Override
public
List
<
DynamicVariable
>
findByProjectIdDynamicVariable
(
Integer
projectId
)
{
QueryWrapper
<
DynamicVariable
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"project_id"
,
projectId
);
return
dynamicVariableMapper
.
selectList
(
queryWrapper
);
}
}
}
kt-web/src/main/java/org/matrix/autotest/service/Impl/EnvironmentServiceImpl.java
浏览文件 @
047c7faf
package
org
.
matrix
.
autotest
.
service
.
Impl
;
package
org
.
matrix
.
autotest
.
service
.
Impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.matrix.autotest.dao.EnvironmentMapper
;
import
org.matrix.autotest.dao.EnvironmentMapper
;
import
org.matrix.autotest.entity.Environment
;
import
org.matrix.autotest.entity.Environment
;
...
@@ -50,4 +51,11 @@ public class EnvironmentServiceImpl extends ServiceImpl<EnvironmentMapper, Envir
...
@@ -50,4 +51,11 @@ public class EnvironmentServiceImpl extends ServiceImpl<EnvironmentMapper, Envir
return
environmentMapper
.
deleteById
(
id
);
return
environmentMapper
.
deleteById
(
id
);
}
}
@Override
public
List
<
Environment
>
findByProjectIdEnvironment
(
Integer
projectId
)
{
QueryWrapper
<
Environment
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"project_id"
,
projectId
);
return
environmentMapper
.
selectList
(
queryWrapper
);
}
}
}
kt-web/src/main/java/org/matrix/autotest/service/Impl/MoveServiceImpl.java
浏览文件 @
047c7faf
package
org
.
matrix
.
autotest
.
service
.
Impl
;
package
org
.
matrix
.
autotest
.
service
.
Impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.matrix.autotest.dao.MoveMapper
;
import
org.matrix.autotest.dao.MoveMapper
;
import
org.matrix.autotest.entity.Move
;
import
org.matrix.autotest.entity.Move
;
...
@@ -50,4 +51,11 @@ public class MoveServiceImpl extends ServiceImpl<MoveMapper, Move> implements Mo
...
@@ -50,4 +51,11 @@ public class MoveServiceImpl extends ServiceImpl<MoveMapper, Move> implements Mo
return
moveMapper
.
deleteById
(
id
);
return
moveMapper
.
deleteById
(
id
);
}
}
@Override
public
List
<
Move
>
findByProjectIdMove
(
Integer
projectId
)
{
QueryWrapper
<
Move
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"project_id"
,
projectId
);
return
moveMapper
.
selectList
(
queryWrapper
);
}
}
}
kt-web/src/main/java/org/matrix/autotest/service/Impl/TestCaseServiceImpl.java
浏览文件 @
047c7faf
package
org
.
matrix
.
autotest
.
service
.
Impl
;
package
org
.
matrix
.
autotest
.
service
.
Impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.matrix.autotest.dao.TestCaseMapper
;
import
org.matrix.autotest.dao.TestCaseMapper
;
import
org.matrix.autotest.entity.TestCase
;
import
org.matrix.autotest.entity.TestCase
;
...
@@ -50,4 +51,11 @@ public class TestCaseServiceImpl extends ServiceImpl<TestCaseMapper, TestCase> i
...
@@ -50,4 +51,11 @@ public class TestCaseServiceImpl extends ServiceImpl<TestCaseMapper, TestCase> i
return
testCaseMapper
.
deleteById
(
id
);
return
testCaseMapper
.
deleteById
(
id
);
}
}
@Override
public
List
<
TestCase
>
findByProjectIdTestCase
(
Integer
projectId
)
{
QueryWrapper
<
TestCase
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"project_id"
,
projectId
);
return
testCaseMapper
.
selectList
(
queryWrapper
);
}
}
}
kt-web/src/main/java/org/matrix/autotest/service/MoveService.java
浏览文件 @
047c7faf
...
@@ -53,4 +53,12 @@ public interface MoveService extends IService<Move> {
...
@@ -53,4 +53,12 @@ public interface MoveService extends IService<Move> {
*/
*/
int
deleteMove
(
Integer
id
);
int
deleteMove
(
Integer
id
);
/**
* 根据项目id查询动作
*
* @param projectId 项目id
* @return 符合项目id的动作
*/
List
<
Move
>
findByProjectIdMove
(
Integer
projectId
);
}
}
kt-web/src/main/java/org/matrix/autotest/service/TestCaseService.java
浏览文件 @
047c7faf
...
@@ -53,4 +53,12 @@ public interface TestCaseService extends IService<TestCase> {
...
@@ -53,4 +53,12 @@ public interface TestCaseService extends IService<TestCase> {
*/
*/
int
deleteTestCase
(
Integer
id
);
int
deleteTestCase
(
Integer
id
);
/**
* 根据项目id查询动作
*
* @param projectId 项目id
* @return 符合项目id的动作
*/
List
<
TestCase
>
findByProjectIdTestCase
(
Integer
projectId
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论