Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
holmes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
holmes
Commits
7937a21b
Commit
7937a21b
authored
May 10, 2021
by
黎博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'auto' into mock
parents
54efe9ee
8e076c1e
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
112 additions
and
25 deletions
+112
-25
InterfaceController.java
...ava/cn/qg/holmes/controller/auto/InterfaceController.java
+14
-1
SceneController.java
...in/java/cn/qg/holmes/controller/auto/SceneController.java
+4
-10
TestcaseController.java
...java/cn/qg/holmes/controller/auto/TestcaseController.java
+14
-10
Scene.java
src/main/java/cn/qg/holmes/entity/auto/Scene.java
+3
-0
Testcase.java
src/main/java/cn/qg/holmes/entity/auto/Testcase.java
+5
-0
InterfaceMapper.java
src/main/java/cn/qg/holmes/mapper/auto/InterfaceMapper.java
+1
-1
SceneMapper.java
src/main/java/cn/qg/holmes/mapper/auto/SceneMapper.java
+2
-0
TestcaseMapper.java
src/main/java/cn/qg/holmes/mapper/auto/TestcaseMapper.java
+2
-0
InterfaceService.java
...main/java/cn/qg/holmes/service/auto/InterfaceService.java
+1
-1
SceneService.java
src/main/java/cn/qg/holmes/service/auto/SceneService.java
+3
-0
TestcaseService.java
src/main/java/cn/qg/holmes/service/auto/TestcaseService.java
+3
-0
InterfaceServiceImpl.java
.../cn/qg/holmes/service/auto/impl/InterfaceServiceImpl.java
+2
-2
SceneServiceImpl.java
...java/cn/qg/holmes/service/auto/impl/SceneServiceImpl.java
+11
-0
TestcaseServiceImpl.java
...a/cn/qg/holmes/service/auto/impl/TestcaseServiceImpl.java
+8
-0
InterfaceMapper.xml
src/main/resources/mapper/auto/InterfaceMapper.xml
+3
-0
SceneMapper.xml
src/main/resources/mapper/auto/SceneMapper.xml
+18
-0
TestcaseMapper.xml
src/main/resources/mapper/auto/TestcaseMapper.xml
+18
-0
No files found.
src/main/java/cn/qg/holmes/controller/auto/InterfaceController.java
View file @
7937a21b
...
@@ -34,20 +34,33 @@ public class InterfaceController {
...
@@ -34,20 +34,33 @@ public class InterfaceController {
* @param moduleId 非必传
* @param moduleId 非必传
* @param pageNum 第几页
* @param pageNum 第几页
* @param pageSize 每页数量
* @param pageSize 每页数量
* @param interfaceName 接口名称
* @return
* @return
*/
*/
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
JsonResult
getInterfaceList
(
Integer
projectId
,
public
JsonResult
getInterfaceList
(
Integer
projectId
,
Integer
moduleId
,
Integer
moduleId
,
String
interfaceName
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
IPage
<
Interface
>
interfaceIPageEntity
=
interfaceService
.
getInterfaceList
(
projectId
,
moduleId
,
pageNum
,
pageSize
);
IPage
<
Interface
>
interfaceIPageEntity
=
interfaceService
.
getInterfaceList
(
projectId
,
moduleId
,
interfaceName
,
pageNum
,
pageSize
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"total"
,
interfaceIPageEntity
.
getTotal
());
map
.
put
(
"total"
,
interfaceIPageEntity
.
getTotal
());
map
.
put
(
"list"
,
interfaceIPageEntity
.
getRecords
());
map
.
put
(
"list"
,
interfaceIPageEntity
.
getRecords
());
return
JsonResult
.
buildSuccessResult
(
map
);
return
JsonResult
.
buildSuccessResult
(
map
);
}
}
/**
* 获取接口详情
* @param interfaceId 接口id
* @return
*/
@GetMapping
(
"/detail"
)
public
JsonResult
getInterfaceDetail
(
Integer
interfaceId
)
{
Interface
anInterface
=
interfaceService
.
getById
(
interfaceId
);
return
JsonResult
.
buildSuccessResult
(
anInterface
);
}
/**
/**
* 新增接口
* 新增接口
* @param interfaceEntity 接口类实体
* @param interfaceEntity 接口类实体
...
...
src/main/java/cn/qg/holmes/controller/auto/SceneController.java
View file @
7937a21b
...
@@ -29,24 +29,18 @@ public class SceneController {
...
@@ -29,24 +29,18 @@ public class SceneController {
AutoProjectService
autoProjectService
;
AutoProjectService
autoProjectService
;
/**
/**
* 获取场景列表
* @param projectId 项目id
* @param sceneName 场景名称
* @param pageNum 第几页
* @param pageNum 第几页
* @param pageSize 每页多少个
* @param pageSize 每页多少个
* @return
* @return
*/
*/
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
JsonResult
getSceneList
(
Integer
projectId
,
public
JsonResult
getSceneList
(
Integer
projectId
,
String
sceneName
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
IPage
<
Scene
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
IPage
<
Scene
>
sceneIPage
=
sceneService
.
getSceneList
(
projectId
,
sceneName
,
pageNum
,
pageSize
);
IPage
<
Scene
>
sceneIPage
;
if
(
projectId
==
null
)
{
sceneIPage
=
sceneService
.
page
(
page
);
}
else
{
QueryWrapper
<
Scene
>
sceneQueryWrapper
=
new
QueryWrapper
<>();
sceneQueryWrapper
.
eq
(
"project_id"
,
projectId
);
sceneIPage
=
sceneService
.
page
(
page
,
sceneQueryWrapper
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"list"
,
sceneIPage
.
getRecords
());
map
.
put
(
"list"
,
sceneIPage
.
getRecords
());
map
.
put
(
"total"
,
sceneIPage
.
getTotal
());
map
.
put
(
"total"
,
sceneIPage
.
getTotal
());
...
...
src/main/java/cn/qg/holmes/controller/auto/TestcaseController.java
View file @
7937a21b
...
@@ -5,7 +5,6 @@ import cn.qg.holmes.entity.auto.Testcase;
...
@@ -5,7 +5,6 @@ import cn.qg.holmes.entity.auto.Testcase;
import
cn.qg.holmes.service.auto.TestcaseService
;
import
cn.qg.holmes.service.auto.TestcaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -33,23 +32,28 @@ public class TestcaseController {
...
@@ -33,23 +32,28 @@ public class TestcaseController {
*/
*/
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
JsonResult
getTestcaseList
(
Integer
moduleId
,
public
JsonResult
getTestcaseList
(
Integer
moduleId
,
String
testcaseName
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
)
{
IPage
<
Testcase
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
IPage
<
Testcase
>
testcaseIPageEntity
=
testcaseService
.
getTestcaseList
(
moduleId
,
testcaseName
,
pageNum
,
pageSize
);
IPage
<
Testcase
>
testcaseIPageEntity
;
if
(
moduleId
!=
null
)
{
QueryWrapper
<
Testcase
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"module_id"
,
moduleId
);
testcaseIPageEntity
=
testcaseService
.
page
(
page
,
queryWrapper
);
}
else
{
testcaseIPageEntity
=
testcaseService
.
page
(
page
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"total"
,
testcaseIPageEntity
.
getTotal
());
map
.
put
(
"total"
,
testcaseIPageEntity
.
getTotal
());
map
.
put
(
"list"
,
testcaseIPageEntity
.
getRecords
());
map
.
put
(
"list"
,
testcaseIPageEntity
.
getRecords
());
return
JsonResult
.
buildSuccessResult
(
map
);
return
JsonResult
.
buildSuccessResult
(
map
);
}
}
/**
* 根据接口id获取对应的用例列表
* @param interfaceId 接口id
* @return
*/
@GetMapping
(
"/byInterface"
)
public
JsonResult
getTestcaseListByInterface
(
Integer
interfaceId
)
{
QueryWrapper
<
Testcase
>
testcaseQueryWrapper
=
new
QueryWrapper
<>();
testcaseQueryWrapper
.
eq
(
"interface_id"
,
interfaceId
);
return
JsonResult
.
buildSuccessResult
(
testcaseService
.
list
(
testcaseQueryWrapper
));
}
/**
/**
* 新增单接口用例
* 新增单接口用例
* @param testcase
* @param testcase
...
...
src/main/java/cn/qg/holmes/entity/auto/Scene.java
View file @
7937a21b
package
cn
.
qg
.
holmes
.
entity
.
auto
;
package
cn
.
qg
.
holmes
.
entity
.
auto
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
...
@@ -23,4 +24,6 @@ public class Scene {
...
@@ -23,4 +24,6 @@ public class Scene {
private
Date
createTime
;
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
private
Date
updateTime
;
@TableField
(
exist
=
false
)
private
String
projectName
;
}
}
src/main/java/cn/qg/holmes/entity/auto/Testcase.java
View file @
7937a21b
package
cn
.
qg
.
holmes
.
entity
.
auto
;
package
cn
.
qg
.
holmes
.
entity
.
auto
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
...
@@ -31,4 +32,8 @@ public class Testcase {
...
@@ -31,4 +32,8 @@ public class Testcase {
private
Date
createTime
;
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
private
Date
updateTime
;
@TableField
(
exist
=
false
)
private
String
interfaceName
;
@TableField
(
exist
=
false
)
private
String
moduleName
;
}
}
src/main/java/cn/qg/holmes/mapper/auto/InterfaceMapper.java
View file @
7937a21b
...
@@ -5,5 +5,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -5,5 +5,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
public
interface
InterfaceMapper
extends
BaseMapper
<
Interface
>
{
public
interface
InterfaceMapper
extends
BaseMapper
<
Interface
>
{
IPage
<
Interface
>
getInterfaceList
(
IPage
<
Interface
>
page
,
Integer
projectId
,
Integer
moduleId
);
IPage
<
Interface
>
getInterfaceList
(
IPage
<
Interface
>
page
,
Integer
projectId
,
Integer
moduleId
,
String
interfaceName
);
}
}
src/main/java/cn/qg/holmes/mapper/auto/SceneMapper.java
View file @
7937a21b
...
@@ -2,6 +2,8 @@ package cn.qg.holmes.mapper.auto;
...
@@ -2,6 +2,8 @@ package cn.qg.holmes.mapper.auto;
import
cn.qg.holmes.entity.auto.Scene
;
import
cn.qg.holmes.entity.auto.Scene
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
public
interface
SceneMapper
extends
BaseMapper
<
Scene
>
{
public
interface
SceneMapper
extends
BaseMapper
<
Scene
>
{
IPage
<
Scene
>
getSceneList
(
IPage
<
Scene
>
page
,
Integer
projectId
,
String
sceneName
);
}
}
src/main/java/cn/qg/holmes/mapper/auto/TestcaseMapper.java
View file @
7937a21b
...
@@ -2,6 +2,8 @@ package cn.qg.holmes.mapper.auto;
...
@@ -2,6 +2,8 @@ package cn.qg.holmes.mapper.auto;
import
cn.qg.holmes.entity.auto.Testcase
;
import
cn.qg.holmes.entity.auto.Testcase
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
public
interface
TestcaseMapper
extends
BaseMapper
<
Testcase
>
{
public
interface
TestcaseMapper
extends
BaseMapper
<
Testcase
>
{
IPage
<
Testcase
>
getTestcaseList
(
IPage
<
Testcase
>
page
,
Integer
moduleId
,
String
testcaseName
);
}
}
src/main/java/cn/qg/holmes/service/auto/InterfaceService.java
View file @
7937a21b
...
@@ -5,5 +5,5 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -5,5 +5,5 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
public
interface
InterfaceService
extends
IService
<
Interface
>
{
public
interface
InterfaceService
extends
IService
<
Interface
>
{
IPage
<
Interface
>
getInterfaceList
(
Integer
projectId
,
Integer
moduleId
,
Integer
pageNum
,
Integer
pageSize
);
IPage
<
Interface
>
getInterfaceList
(
Integer
projectId
,
Integer
moduleId
,
String
interfaceName
,
Integer
pageNum
,
Integer
pageSize
);
}
}
src/main/java/cn/qg/holmes/service/auto/SceneService.java
View file @
7937a21b
package
cn
.
qg
.
holmes
.
service
.
auto
;
package
cn
.
qg
.
holmes
.
service
.
auto
;
import
cn.qg.holmes.entity.auto.Scene
;
import
cn.qg.holmes.entity.auto.Scene
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
public
interface
SceneService
extends
IService
<
Scene
>
{
public
interface
SceneService
extends
IService
<
Scene
>
{
IPage
<
Scene
>
getSceneList
(
Integer
projectId
,
String
sceneName
,
Integer
pageNum
,
Integer
pageSize
);
}
}
src/main/java/cn/qg/holmes/service/auto/TestcaseService.java
View file @
7937a21b
package
cn
.
qg
.
holmes
.
service
.
auto
;
package
cn
.
qg
.
holmes
.
service
.
auto
;
import
cn.qg.holmes.entity.auto.Testcase
;
import
cn.qg.holmes.entity.auto.Testcase
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
public
interface
TestcaseService
extends
IService
<
Testcase
>
{
public
interface
TestcaseService
extends
IService
<
Testcase
>
{
IPage
<
Testcase
>
getTestcaseList
(
Integer
moduleId
,
String
testcaseName
,
Integer
pageNum
,
Integer
pageSize
);
String
singleTestcaseExecutor
(
String
namespace
,
Integer
testcaseId
,
String
batch
);
String
singleTestcaseExecutor
(
String
namespace
,
Integer
testcaseId
,
String
batch
);
String
executeTestcaseByModuleId
(
String
namespace
,
Integer
moduleId
,
String
batch
);
String
executeTestcaseByModuleId
(
String
namespace
,
Integer
moduleId
,
String
batch
);
...
...
src/main/java/cn/qg/holmes/service/auto/impl/InterfaceServiceImpl.java
View file @
7937a21b
...
@@ -21,9 +21,9 @@ public class InterfaceServiceImpl extends ServiceImpl<InterfaceMapper, Interface
...
@@ -21,9 +21,9 @@ public class InterfaceServiceImpl extends ServiceImpl<InterfaceMapper, Interface
InterfaceMapper
interfaceMapper
;
InterfaceMapper
interfaceMapper
;
@Override
@Override
public
IPage
<
Interface
>
getInterfaceList
(
Integer
projectId
,
Integer
moduleId
,
Integer
pageNum
,
Integer
pageSize
)
{
public
IPage
<
Interface
>
getInterfaceList
(
Integer
projectId
,
Integer
moduleId
,
String
interfaceName
,
Integer
pageNum
,
Integer
pageSize
)
{
IPage
<
Interface
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
IPage
<
Interface
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
IPage
<
Interface
>
interfaceIPage
=
interfaceMapper
.
getInterfaceList
(
page
,
projectId
,
moduleId
);
IPage
<
Interface
>
interfaceIPage
=
interfaceMapper
.
getInterfaceList
(
page
,
projectId
,
moduleId
,
interfaceName
);
return
interfaceIPage
;
return
interfaceIPage
;
}
}
}
}
src/main/java/cn/qg/holmes/service/auto/impl/SceneServiceImpl.java
View file @
7937a21b
...
@@ -3,10 +3,21 @@ package cn.qg.holmes.service.auto.impl;
...
@@ -3,10 +3,21 @@ package cn.qg.holmes.service.auto.impl;
import
cn.qg.holmes.entity.auto.Scene
;
import
cn.qg.holmes.entity.auto.Scene
;
import
cn.qg.holmes.mapper.auto.SceneMapper
;
import
cn.qg.holmes.mapper.auto.SceneMapper
;
import
cn.qg.holmes.service.auto.SceneService
;
import
cn.qg.holmes.service.auto.SceneService
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
@Service
@Service
public
class
SceneServiceImpl
extends
ServiceImpl
<
SceneMapper
,
Scene
>
implements
SceneService
{
public
class
SceneServiceImpl
extends
ServiceImpl
<
SceneMapper
,
Scene
>
implements
SceneService
{
@Autowired
SceneMapper
sceneMapper
;
@Override
public
IPage
<
Scene
>
getSceneList
(
Integer
projectId
,
String
sceneName
,
Integer
pageNum
,
Integer
pageSize
)
{
IPage
<
Scene
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
return
sceneMapper
.
getSceneList
(
page
,
projectId
,
sceneName
);
}
}
}
src/main/java/cn/qg/holmes/service/auto/impl/TestcaseServiceImpl.java
View file @
7937a21b
...
@@ -9,6 +9,8 @@ import cn.qg.holmes.service.auto.*;
...
@@ -9,6 +9,8 @@ import cn.qg.holmes.service.auto.*;
import
cn.qg.holmes.utils.HttpClientUtils
;
import
cn.qg.holmes.utils.HttpClientUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -42,6 +44,12 @@ public class TestcaseServiceImpl extends ServiceImpl<TestcaseMapper, Testcase> i
...
@@ -42,6 +44,12 @@ public class TestcaseServiceImpl extends ServiceImpl<TestcaseMapper, Testcase> i
@Autowired
@Autowired
TestcaseReportService
testcaseReportService
;
TestcaseReportService
testcaseReportService
;
@Override
public
IPage
<
Testcase
>
getTestcaseList
(
Integer
moduleId
,
String
testcaseName
,
Integer
pageNum
,
Integer
pageSize
)
{
IPage
<
Testcase
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
return
testcaseMapper
.
getTestcaseList
(
page
,
moduleId
,
testcaseName
);
}
/**
/**
* 执行单接口用例
* 执行单接口用例
* @param namespace 环境
* @param namespace 环境
...
...
src/main/resources/mapper/auto/InterfaceMapper.xml
View file @
7937a21b
...
@@ -14,5 +14,8 @@
...
@@ -14,5 +14,8 @@
<if
test=
"moduleId != null and moduleId != ''"
>
<if
test=
"moduleId != null and moduleId != ''"
>
AND am.`id` = #{moduleId}
AND am.`id` = #{moduleId}
</if>
</if>
<if
test=
"interfaceName != null and interfaceName != ''"
>
AND it.`name` like CONCAT('%', #{interfaceName}, '%')
</if>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mapper/auto/SceneMapper.xml
0 → 100644
View file @
7937a21b
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"cn.qg.holmes.mapper.auto.SceneMapper"
>
<select
id=
"getSceneList"
resultType=
"cn.qg.holmes.entity.auto.Scene"
>
SELECT sc.*, ap.name as projectName
FROM `scene` as sc
INNER JOIN `auto_project` as ap
ON sc.`project_id` = ap.`id`
WHERE 1=1
<if
test=
"projectId != null and projectId != ''"
>
AND sc.`project_id` = #{projectId}
</if>
<if
test=
"sceneName != null and sceneName !=''"
>
AND sc.`name` like CONCAT('%', #{sceneName}, '%')
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/auto/TestcaseMapper.xml
0 → 100644
View file @
7937a21b
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"cn.qg.holmes.mapper.auto.TestcaseMapper"
>
<select
id=
"getTestcaseList"
resultType=
"cn.qg.holmes.entity.auto.Testcase"
>
SELECT tc.*, am.`name` as moduleName, it.`name` as interfaceName
FROM `testcase` as tc
INNER JOIN `auto_module` as am ON tc.`module_id` = am.`id`
INNER JOIN `interface` as it ON tc.`interface_id` = it.`id`
WHERE 1=1
<if
test=
"moduleId != null and moduleId !=''"
>
AND tc.`module_id` = #{moduleId}
</if>
<if
test=
"testcaseName != null and testcaseName !=''"
>
AND tc.`name` LIKE CONCAT('%', #{testcaseName}, '%')
</if>
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment