feat: 测试计划接口用例关联
This commit is contained in:
parent
556ddddd84
commit
8090c2d700
|
@ -14,6 +14,7 @@ import io.metersphere.commons.constants.RoleConstants;
|
|||
import io.metersphere.commons.utils.PageUtils;
|
||||
import io.metersphere.commons.utils.Pager;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.track.request.testcase.ApiCaseRelevanceRequest;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -92,6 +93,11 @@ public class ApiDefinitionController {
|
|||
return apiDefinitionService.getDbResult(testId);
|
||||
}
|
||||
|
||||
@GetMapping("/report/getReport/{testId}/{type}")
|
||||
public APIReportResult getReport(@PathVariable String testId, @PathVariable String type) {
|
||||
return apiDefinitionService.getDbResult(testId, type);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/import", consumes = {"multipart/form-data"})
|
||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
public ApiDefinitionImport testCaseImport(@RequestPart(value = "file", required = false) MultipartFile file, @RequestPart("request") ApiTestImportRequest request) {
|
||||
|
@ -109,4 +115,8 @@ public class ApiDefinitionController {
|
|||
apiDefinitionService.editApiBath(request);
|
||||
}
|
||||
|
||||
@PostMapping("/relevance")
|
||||
public void testPlanRelevance(@RequestBody ApiCaseRelevanceRequest request) {
|
||||
apiDefinitionService.testPlanRelevance(request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,14 +3,17 @@ package io.metersphere.api.controller;
|
|||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.metersphere.api.dto.ApiCaseBatchRequest;
|
||||
import io.metersphere.api.dto.definition.*;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseResult;
|
||||
import io.metersphere.api.dto.definition.SaveApiTestCaseRequest;
|
||||
import io.metersphere.api.service.ApiTestCaseService;
|
||||
import io.metersphere.base.domain.ApiTestCase;
|
||||
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
|
||||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.commons.utils.PageUtils;
|
||||
import io.metersphere.commons.utils.Pager;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.track.request.testcase.ApiCaseRelevanceRequest;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -75,4 +78,9 @@ public class ApiTestCaseController {
|
|||
public void deleteBatch(@RequestBody List<String> ids) {
|
||||
apiTestCaseService.deleteBatch(ids);
|
||||
}
|
||||
|
||||
@PostMapping("/relevance")
|
||||
public void testPlanRelevance(@RequestBody ApiCaseRelevanceRequest request) {
|
||||
apiTestCaseService.relevanceByCase(request);
|
||||
}
|
||||
}
|
|
@ -11,6 +11,8 @@ import java.util.Map;
|
|||
@Setter
|
||||
public class ApiTestCaseRequest {
|
||||
private String id;
|
||||
private List<String> ids;
|
||||
private String planId;
|
||||
private String projectId;
|
||||
private String priority;
|
||||
private String name;
|
||||
|
@ -18,6 +20,7 @@ public class ApiTestCaseRequest {
|
|||
private String workspaceId;
|
||||
private String apiDefinitionId;
|
||||
private String status;
|
||||
private String protocol;
|
||||
private List<String> moduleIds;
|
||||
private List<OrderRequest> orders;
|
||||
private Map<String, List<String>> filters;
|
||||
|
|
|
@ -15,6 +15,8 @@ public class RunDefinitionRequest {
|
|||
|
||||
private String reportId;
|
||||
|
||||
private String type;
|
||||
|
||||
private String environmentId;
|
||||
|
||||
private MsTestElement testElement;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package io.metersphere.api.dto.definition;
|
||||
|
||||
import io.metersphere.base.domain.ApiTestCase;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class TestPlanApiCaseDTO extends ApiTestCaseDTO {
|
||||
private String environmentId;
|
||||
private String caseId;
|
||||
private String execResult;
|
||||
}
|
|
@ -165,13 +165,17 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
|||
apiDefinitionService.addResult(testResult);
|
||||
} else {
|
||||
apiDefinitionService.addResult(testResult);
|
||||
apiDefinitionExecResultService.saveApiResult(testResult);
|
||||
apiDefinitionExecResultService.saveApiResult(testResult, ApiRunMode.DELIMIT.name());
|
||||
}
|
||||
} else if (StringUtils.equals(this.runMode, ApiRunMode.API_PLAN.name())) {
|
||||
apiDefinitionService.addResult(testResult);
|
||||
apiDefinitionExecResultService.saveApiResult(testResult, ApiRunMode.API_PLAN.name());
|
||||
} else if (StringUtils.equals(this.runMode, ApiRunMode.SCENARIO.name())) {
|
||||
// 执行报告不需要存储,由用户确认后在存储
|
||||
testResult.setTestId(testId);
|
||||
apiScenarioReportService.complete(testResult);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
apiTestService.changeStatus(testId, APITestStatus.Completed);
|
||||
report = apiReportService.getRunningReport(testResult.getTestId());
|
||||
apiReportService.complete(testResult, report);
|
||||
|
|
|
@ -3,12 +3,14 @@ package io.metersphere.api.service;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import io.metersphere.api.jmeter.TestResult;
|
||||
import io.metersphere.base.domain.ApiDefinitionExecResult;
|
||||
import io.metersphere.base.domain.ApiDefinitionExecResultExample;
|
||||
import io.metersphere.base.mapper.ApiDefinitionExecResultMapper;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -18,7 +20,7 @@ public class ApiDefinitionExecResultService {
|
|||
@Resource
|
||||
private ApiDefinitionExecResultMapper apiDefinitionExecResultMapper;
|
||||
|
||||
public void saveApiResult(TestResult result) {
|
||||
public void saveApiResult(TestResult result, String type) {
|
||||
result.getScenarios().get(0).getRequestResults().forEach(item -> {
|
||||
ApiDefinitionExecResult saveResult = new ApiDefinitionExecResult();
|
||||
saveResult.setId(UUID.randomUUID().toString());
|
||||
|
@ -27,9 +29,22 @@ public class ApiDefinitionExecResultService {
|
|||
saveResult.setResourceId(item.getName());
|
||||
saveResult.setContent(JSON.toJSONString(item));
|
||||
saveResult.setStartTime(item.getStartTime());
|
||||
saveResult.setType(type);
|
||||
saveResult.setEndTime(item.getResponseResult().getResponseTime());
|
||||
saveResult.setStatus(item.getResponseResult().getResponseCode().equals("200") ? "success" : "error");
|
||||
apiDefinitionExecResultMapper.insert(saveResult);
|
||||
});
|
||||
}
|
||||
|
||||
public void deleteByResourceId(String resourceId) {
|
||||
ApiDefinitionExecResultExample example = new ApiDefinitionExecResultExample();
|
||||
example.createCriteria().andResourceIdEqualTo(resourceId);
|
||||
apiDefinitionExecResultMapper.deleteByExample(example);
|
||||
}
|
||||
|
||||
public void deleteByResourceIds(List<String> ids) {
|
||||
ApiDefinitionExecResultExample example = new ApiDefinitionExecResultExample();
|
||||
example.createCriteria().andResourceIdIn(ids);
|
||||
apiDefinitionExecResultMapper.deleteByExample(example);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,10 @@ import io.metersphere.commons.utils.ServiceUtils;
|
|||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.service.FileService;
|
||||
import io.metersphere.track.request.testcase.ApiCaseRelevanceRequest;
|
||||
import io.metersphere.track.request.testcase.QueryTestPlanRequest;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
|
@ -288,8 +290,12 @@ public class ApiDefinitionService {
|
|||
createBodyFiles(bodyUploadIds, bodyFiles);
|
||||
|
||||
HashTree hashTree = request.getTestElement().generateHashTree();
|
||||
String runMode = ApiRunMode.DELIMIT.name();
|
||||
if (StringUtils.isNotBlank(request.getType()) && StringUtils.equals(request.getType(), ApiRunMode.API_PLAN.name())) {
|
||||
runMode = ApiRunMode.API_PLAN.name();
|
||||
}
|
||||
// 调用执行方法
|
||||
jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), ApiRunMode.DELIMIT.name());
|
||||
jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), runMode);
|
||||
return request.getId();
|
||||
}
|
||||
|
||||
|
@ -327,6 +333,10 @@ public class ApiDefinitionService {
|
|||
*/
|
||||
public APIReportResult getDbResult(String testId) {
|
||||
ApiDefinitionExecResult result = extApiDefinitionExecResultMapper.selectMaxResultByResourceId(testId);
|
||||
return buildAPIReportResult(result);
|
||||
}
|
||||
|
||||
private APIReportResult buildAPIReportResult(ApiDefinitionExecResult result) {
|
||||
if (result == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -335,6 +345,11 @@ public class ApiDefinitionService {
|
|||
return reportResult;
|
||||
}
|
||||
|
||||
public APIReportResult getDbResult(String testId, String type) {
|
||||
ApiDefinitionExecResult result = extApiDefinitionExecResultMapper.selectMaxResultByResourceIdAndType(testId, type);
|
||||
return buildAPIReportResult(result);
|
||||
}
|
||||
|
||||
|
||||
public ApiDefinitionImport apiTestImport(MultipartFile file, ApiTestImportRequest request) {
|
||||
ApiImportParser apiImportParser = ApiImportParserFactory.getApiImportParser(request.getPlatform());
|
||||
|
@ -388,4 +403,7 @@ public class ApiDefinitionService {
|
|||
apiDefinitionMapper.updateByExampleSelective(definitionWithBLOBs, definitionExample);
|
||||
}
|
||||
|
||||
public void testPlanRelevance(ApiCaseRelevanceRequest request) {
|
||||
apiTestCaseService.relevanceByApi(request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,19 +2,26 @@ package io.metersphere.api.service;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.metersphere.api.dto.ApiCaseBatchRequest;
|
||||
import io.metersphere.api.dto.definition.*;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseResult;
|
||||
import io.metersphere.api.dto.definition.SaveApiTestCaseRequest;
|
||||
import io.metersphere.base.domain.*;
|
||||
import io.metersphere.base.mapper.ApiTestCaseMapper;
|
||||
import io.metersphere.base.mapper.ApiTestFileMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtApiDefinitionExecResultMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtApiTestCaseMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanApiCaseMapper;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.*;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.notice.domain.UserDetail;
|
||||
import io.metersphere.service.FileService;
|
||||
import io.metersphere.service.QuotaService;
|
||||
import io.metersphere.service.UserService;
|
||||
import io.metersphere.track.request.testcase.ApiCaseRelevanceRequest;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -32,6 +39,8 @@ public class ApiTestCaseService {
|
|||
@Resource
|
||||
private ApiTestCaseMapper apiTestCaseMapper;
|
||||
@Resource
|
||||
private SqlSessionFactory sqlSessionFactory;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private ExtApiTestCaseMapper extApiTestCaseMapper;
|
||||
|
@ -55,6 +64,11 @@ public class ApiTestCaseService {
|
|||
if (CollectionUtils.isEmpty(apiTestCases)) {
|
||||
return apiTestCases;
|
||||
}
|
||||
buildUserInfo(apiTestCases);
|
||||
return apiTestCases;
|
||||
}
|
||||
|
||||
public void buildUserInfo(List<? extends ApiTestCaseDTO> apiTestCases) {
|
||||
List<String> userIds = new ArrayList();
|
||||
userIds.addAll(apiTestCases.stream().map(ApiTestCaseDTO::getCreateUserId).collect(Collectors.toList()));
|
||||
userIds.addAll(apiTestCases.stream().map(ApiTestCaseDTO::getUpdateUserId).collect(Collectors.toList()));
|
||||
|
@ -65,7 +79,6 @@ public class ApiTestCaseService {
|
|||
caseResult.setUpdateUser(userMap.get(caseResult.getUpdateUserId()).getName());
|
||||
});
|
||||
}
|
||||
return apiTestCases;
|
||||
}
|
||||
|
||||
public ApiTestCaseWithBLOBs get(String id) {
|
||||
|
@ -243,4 +256,47 @@ public class ApiTestCaseService {
|
|||
example.createCriteria().andIdIn(ids);
|
||||
apiTestCaseMapper.deleteByExample(example);
|
||||
}
|
||||
|
||||
public void relevanceByApi(ApiCaseRelevanceRequest request) {
|
||||
if (CollectionUtils.isEmpty(request.getSelectIds())) {
|
||||
return;
|
||||
}
|
||||
ApiTestCaseExample example = new ApiTestCaseExample();
|
||||
example.createCriteria().andApiDefinitionIdIn(request.getSelectIds());
|
||||
List<ApiTestCase> apiTestCases = apiTestCaseMapper.selectByExample(example);
|
||||
relevance(apiTestCases, request);
|
||||
}
|
||||
|
||||
public void relevanceByCase(ApiCaseRelevanceRequest request) {
|
||||
List<String> ids = request.getSelectIds();
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
ApiTestCaseExample example = new ApiTestCaseExample();
|
||||
example.createCriteria().andIdIn(ids);
|
||||
List<ApiTestCase> apiTestCases = apiTestCaseMapper.selectByExample(example);
|
||||
relevance(apiTestCases, request);
|
||||
}
|
||||
|
||||
private void relevance(List<ApiTestCase> apiTestCases, ApiCaseRelevanceRequest request) {
|
||||
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
|
||||
|
||||
ExtTestPlanApiCaseMapper batchMapper = sqlSession.getMapper(ExtTestPlanApiCaseMapper.class);
|
||||
apiTestCases.forEach(apiTestCase -> {
|
||||
TestPlanApiCase testPlanApiCase = new TestPlanApiCase();
|
||||
testPlanApiCase.setId(UUID.randomUUID().toString());
|
||||
testPlanApiCase.setApiCaseId(apiTestCase.getId());
|
||||
testPlanApiCase.setTestPlanId(request.getPlanId());
|
||||
testPlanApiCase.setEnvironmentId(request.getEnvironmentId());
|
||||
testPlanApiCase.setCreateTime(System.currentTimeMillis());
|
||||
testPlanApiCase.setUpdateTime(System.currentTimeMillis());
|
||||
batchMapper.insertIfNotExists(testPlanApiCase);
|
||||
});
|
||||
sqlSession.flushStatements();
|
||||
}
|
||||
|
||||
public List<String> selectIdsNotExistsInPlan(String projectId, String planId) {
|
||||
return extApiTestCaseMapper.selectIdsNotExistsInPlan(projectId, planId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiDefinitionExecResult implements Serializable {
|
||||
|
@ -20,6 +19,10 @@ public class ApiDefinitionExecResult implements Serializable {
|
|||
|
||||
private Long endTime;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private String type;
|
||||
|
||||
private String content;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -573,6 +573,136 @@ public class ApiDefinitionExecResultExample {
|
|||
addCriterion("end_time not between", value1, value2, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNotNull() {
|
||||
addCriterion("create_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeEqualTo(Long value) {
|
||||
addCriterion("create_time =", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Long value) {
|
||||
addCriterion("create_time <>", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThan(Long value) {
|
||||
addCriterion("create_time >", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("create_time >=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThan(Long value) {
|
||||
addCriterion("create_time <", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
|
||||
addCriterion("create_time <=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIn(List<Long> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Long> values) {
|
||||
addCriterion("create_time not in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeBetween(Long value1, Long value2) {
|
||||
addCriterion("create_time between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
|
||||
addCriterion("create_time not between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNull() {
|
||||
addCriterion("`type` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNotNull() {
|
||||
addCriterion("`type` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeEqualTo(String value) {
|
||||
addCriterion("`type` =", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotEqualTo(String value) {
|
||||
addCriterion("`type` <>", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThan(String value) {
|
||||
addCriterion("`type` >", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`type` >=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThan(String value) {
|
||||
addCriterion("`type` <", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("`type` <=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLike(String value) {
|
||||
addCriterion("`type` like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotLike(String value) {
|
||||
addCriterion("`type` not like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIn(List<String> values) {
|
||||
addCriterion("`type` in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotIn(List<String> values) {
|
||||
addCriterion("`type` not in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeBetween(String value1, String value2) {
|
||||
addCriterion("`type` between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("`type` not between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TestPlan implements Serializable {
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TestPlanApiCase implements Serializable {
|
||||
private String id;
|
||||
|
||||
private String testPlanId;
|
||||
|
||||
private String apiCaseId;
|
||||
|
||||
private String status;
|
||||
|
||||
private String environmentId;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private Long updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -0,0 +1,670 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TestPlanApiCaseExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public TestPlanApiCaseExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(String value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(String value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(String value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(String value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLike(String value) {
|
||||
addCriterion("id like", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotLike(String value) {
|
||||
addCriterion("id not like", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<String> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<String> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(String value1, String value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(String value1, String value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdIsNull() {
|
||||
addCriterion("test_plan_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdIsNotNull() {
|
||||
addCriterion("test_plan_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdEqualTo(String value) {
|
||||
addCriterion("test_plan_id =", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdNotEqualTo(String value) {
|
||||
addCriterion("test_plan_id <>", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdGreaterThan(String value) {
|
||||
addCriterion("test_plan_id >", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("test_plan_id >=", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdLessThan(String value) {
|
||||
addCriterion("test_plan_id <", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("test_plan_id <=", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdLike(String value) {
|
||||
addCriterion("test_plan_id like", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdNotLike(String value) {
|
||||
addCriterion("test_plan_id not like", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdIn(List<String> values) {
|
||||
addCriterion("test_plan_id in", values, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdNotIn(List<String> values) {
|
||||
addCriterion("test_plan_id not in", values, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdBetween(String value1, String value2) {
|
||||
addCriterion("test_plan_id between", value1, value2, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdNotBetween(String value1, String value2) {
|
||||
addCriterion("test_plan_id not between", value1, value2, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdIsNull() {
|
||||
addCriterion("api_case_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdIsNotNull() {
|
||||
addCriterion("api_case_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdEqualTo(String value) {
|
||||
addCriterion("api_case_id =", value, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdNotEqualTo(String value) {
|
||||
addCriterion("api_case_id <>", value, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdGreaterThan(String value) {
|
||||
addCriterion("api_case_id >", value, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("api_case_id >=", value, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdLessThan(String value) {
|
||||
addCriterion("api_case_id <", value, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("api_case_id <=", value, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdLike(String value) {
|
||||
addCriterion("api_case_id like", value, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdNotLike(String value) {
|
||||
addCriterion("api_case_id not like", value, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdIn(List<String> values) {
|
||||
addCriterion("api_case_id in", values, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdNotIn(List<String> values) {
|
||||
addCriterion("api_case_id not in", values, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdBetween(String value1, String value2) {
|
||||
addCriterion("api_case_id between", value1, value2, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiCaseIdNotBetween(String value1, String value2) {
|
||||
addCriterion("api_case_id not between", value1, value2, "apiCaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("`status` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("`status` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(String value) {
|
||||
addCriterion("`status` =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(String value) {
|
||||
addCriterion("`status` <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(String value) {
|
||||
addCriterion("`status` >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`status` >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(String value) {
|
||||
addCriterion("`status` <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(String value) {
|
||||
addCriterion("`status` <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLike(String value) {
|
||||
addCriterion("`status` like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotLike(String value) {
|
||||
addCriterion("`status` not like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<String> values) {
|
||||
addCriterion("`status` in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<String> values) {
|
||||
addCriterion("`status` not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(String value1, String value2) {
|
||||
addCriterion("`status` between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(String value1, String value2) {
|
||||
addCriterion("`status` not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdIsNull() {
|
||||
addCriterion("environment_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdIsNotNull() {
|
||||
addCriterion("environment_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdEqualTo(String value) {
|
||||
addCriterion("environment_id =", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdNotEqualTo(String value) {
|
||||
addCriterion("environment_id <>", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdGreaterThan(String value) {
|
||||
addCriterion("environment_id >", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("environment_id >=", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdLessThan(String value) {
|
||||
addCriterion("environment_id <", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("environment_id <=", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdLike(String value) {
|
||||
addCriterion("environment_id like", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdNotLike(String value) {
|
||||
addCriterion("environment_id not like", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdIn(List<String> values) {
|
||||
addCriterion("environment_id in", values, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdNotIn(List<String> values) {
|
||||
addCriterion("environment_id not in", values, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdBetween(String value1, String value2) {
|
||||
addCriterion("environment_id between", value1, value2, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdNotBetween(String value1, String value2) {
|
||||
addCriterion("environment_id not between", value1, value2, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNotNull() {
|
||||
addCriterion("create_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeEqualTo(Long value) {
|
||||
addCriterion("create_time =", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Long value) {
|
||||
addCriterion("create_time <>", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThan(Long value) {
|
||||
addCriterion("create_time >", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("create_time >=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThan(Long value) {
|
||||
addCriterion("create_time <", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
|
||||
addCriterion("create_time <=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIn(List<Long> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Long> values) {
|
||||
addCriterion("create_time not in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeBetween(Long value1, Long value2) {
|
||||
addCriterion("create_time between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
|
||||
addCriterion("create_time not between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNull() {
|
||||
addCriterion("update_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNotNull() {
|
||||
addCriterion("update_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeEqualTo(Long value) {
|
||||
addCriterion("update_time =", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(Long value) {
|
||||
addCriterion("update_time <>", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThan(Long value) {
|
||||
addCriterion("update_time >", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("update_time >=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThan(Long value) {
|
||||
addCriterion("update_time <", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
|
||||
addCriterion("update_time <=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIn(List<Long> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Long> values) {
|
||||
addCriterion("update_time not in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
|
||||
addCriterion("update_time between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
|
||||
addCriterion("update_time not between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TestPlanApiScenario implements Serializable {
|
||||
private String id;
|
||||
|
||||
private String testPlanId;
|
||||
|
||||
private String apiScenarioId;
|
||||
|
||||
private String status;
|
||||
|
||||
private String environmentId;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private Long updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -0,0 +1,670 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TestPlanApiScenarioExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public TestPlanApiScenarioExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(String value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(String value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(String value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(String value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLike(String value) {
|
||||
addCriterion("id like", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotLike(String value) {
|
||||
addCriterion("id not like", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<String> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<String> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(String value1, String value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(String value1, String value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdIsNull() {
|
||||
addCriterion("test_plan_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdIsNotNull() {
|
||||
addCriterion("test_plan_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdEqualTo(String value) {
|
||||
addCriterion("test_plan_id =", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdNotEqualTo(String value) {
|
||||
addCriterion("test_plan_id <>", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdGreaterThan(String value) {
|
||||
addCriterion("test_plan_id >", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("test_plan_id >=", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdLessThan(String value) {
|
||||
addCriterion("test_plan_id <", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("test_plan_id <=", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdLike(String value) {
|
||||
addCriterion("test_plan_id like", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdNotLike(String value) {
|
||||
addCriterion("test_plan_id not like", value, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdIn(List<String> values) {
|
||||
addCriterion("test_plan_id in", values, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdNotIn(List<String> values) {
|
||||
addCriterion("test_plan_id not in", values, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdBetween(String value1, String value2) {
|
||||
addCriterion("test_plan_id between", value1, value2, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTestPlanIdNotBetween(String value1, String value2) {
|
||||
addCriterion("test_plan_id not between", value1, value2, "testPlanId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdIsNull() {
|
||||
addCriterion("api_scenario_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdIsNotNull() {
|
||||
addCriterion("api_scenario_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdEqualTo(String value) {
|
||||
addCriterion("api_scenario_id =", value, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdNotEqualTo(String value) {
|
||||
addCriterion("api_scenario_id <>", value, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdGreaterThan(String value) {
|
||||
addCriterion("api_scenario_id >", value, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("api_scenario_id >=", value, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdLessThan(String value) {
|
||||
addCriterion("api_scenario_id <", value, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("api_scenario_id <=", value, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdLike(String value) {
|
||||
addCriterion("api_scenario_id like", value, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdNotLike(String value) {
|
||||
addCriterion("api_scenario_id not like", value, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdIn(List<String> values) {
|
||||
addCriterion("api_scenario_id in", values, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdNotIn(List<String> values) {
|
||||
addCriterion("api_scenario_id not in", values, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdBetween(String value1, String value2) {
|
||||
addCriterion("api_scenario_id between", value1, value2, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiScenarioIdNotBetween(String value1, String value2) {
|
||||
addCriterion("api_scenario_id not between", value1, value2, "apiScenarioId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("`status` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("`status` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(String value) {
|
||||
addCriterion("`status` =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(String value) {
|
||||
addCriterion("`status` <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(String value) {
|
||||
addCriterion("`status` >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`status` >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(String value) {
|
||||
addCriterion("`status` <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(String value) {
|
||||
addCriterion("`status` <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLike(String value) {
|
||||
addCriterion("`status` like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotLike(String value) {
|
||||
addCriterion("`status` not like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<String> values) {
|
||||
addCriterion("`status` in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<String> values) {
|
||||
addCriterion("`status` not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(String value1, String value2) {
|
||||
addCriterion("`status` between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(String value1, String value2) {
|
||||
addCriterion("`status` not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdIsNull() {
|
||||
addCriterion("environment_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdIsNotNull() {
|
||||
addCriterion("environment_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdEqualTo(String value) {
|
||||
addCriterion("environment_id =", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdNotEqualTo(String value) {
|
||||
addCriterion("environment_id <>", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdGreaterThan(String value) {
|
||||
addCriterion("environment_id >", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("environment_id >=", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdLessThan(String value) {
|
||||
addCriterion("environment_id <", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("environment_id <=", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdLike(String value) {
|
||||
addCriterion("environment_id like", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdNotLike(String value) {
|
||||
addCriterion("environment_id not like", value, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdIn(List<String> values) {
|
||||
addCriterion("environment_id in", values, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdNotIn(List<String> values) {
|
||||
addCriterion("environment_id not in", values, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdBetween(String value1, String value2) {
|
||||
addCriterion("environment_id between", value1, value2, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdNotBetween(String value1, String value2) {
|
||||
addCriterion("environment_id not between", value1, value2, "environmentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNotNull() {
|
||||
addCriterion("create_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeEqualTo(Long value) {
|
||||
addCriterion("create_time =", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Long value) {
|
||||
addCriterion("create_time <>", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThan(Long value) {
|
||||
addCriterion("create_time >", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("create_time >=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThan(Long value) {
|
||||
addCriterion("create_time <", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
|
||||
addCriterion("create_time <=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIn(List<Long> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Long> values) {
|
||||
addCriterion("create_time not in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeBetween(Long value1, Long value2) {
|
||||
addCriterion("create_time between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
|
||||
addCriterion("create_time not between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNull() {
|
||||
addCriterion("update_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNotNull() {
|
||||
addCriterion("update_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeEqualTo(Long value) {
|
||||
addCriterion("update_time =", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(Long value) {
|
||||
addCriterion("update_time <>", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThan(Long value) {
|
||||
addCriterion("update_time >", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("update_time >=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThan(Long value) {
|
||||
addCriterion("update_time <", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
|
||||
addCriterion("update_time <=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIn(List<Long> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Long> values) {
|
||||
addCriterion("update_time not in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
|
||||
addCriterion("update_time between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
|
||||
addCriterion("update_time not between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,9 +2,8 @@ package io.metersphere.base.mapper;
|
|||
|
||||
import io.metersphere.base.domain.ApiDefinitionExecResult;
|
||||
import io.metersphere.base.domain.ApiDefinitionExecResultExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface ApiDefinitionExecResultMapper {
|
||||
long countByExample(ApiDefinitionExecResultExample example);
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="start_time" jdbcType="BIGINT" property="startTime" />
|
||||
<result column="end_time" jdbcType="BIGINT" property="endTime" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionExecResult">
|
||||
<result column="content" jdbcType="LONGVARCHAR" property="content" />
|
||||
|
@ -72,7 +74,7 @@
|
|||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, `name`, resource_id, `status`, user_id, start_time, end_time
|
||||
id, `name`, resource_id, `status`, user_id, start_time, end_time, create_time, `type`
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
content
|
||||
|
@ -128,10 +130,12 @@
|
|||
<insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinitionExecResult">
|
||||
insert into api_definition_exec_result (id, `name`, resource_id,
|
||||
`status`, user_id, start_time,
|
||||
end_time, content)
|
||||
end_time, create_time, `type`,
|
||||
content)
|
||||
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT},
|
||||
#{endTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR})
|
||||
#{endTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR},
|
||||
#{content,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiDefinitionExecResult">
|
||||
insert into api_definition_exec_result
|
||||
|
@ -157,6 +161,12 @@
|
|||
<if test="endTime != null">
|
||||
end_time,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type`,
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content,
|
||||
</if>
|
||||
|
@ -183,6 +193,12 @@
|
|||
<if test="endTime != null">
|
||||
#{endTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
#{content,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -218,6 +234,12 @@
|
|||
<if test="record.endTime != null">
|
||||
end_time = #{record.endTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.content != null">
|
||||
content = #{record.content,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -235,6 +257,8 @@
|
|||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
start_time = #{record.startTime,jdbcType=BIGINT},
|
||||
end_time = #{record.endTime,jdbcType=BIGINT},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
content = #{record.content,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
|
@ -248,7 +272,9 @@
|
|||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
start_time = #{record.startTime,jdbcType=BIGINT},
|
||||
end_time = #{record.endTime,jdbcType=BIGINT}
|
||||
end_time = #{record.endTime,jdbcType=BIGINT},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
`type` = #{record.type,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
@ -274,6 +300,12 @@
|
|||
<if test="endTime != null">
|
||||
end_time = #{endTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -288,6 +320,8 @@
|
|||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
start_time = #{startTime,jdbcType=BIGINT},
|
||||
end_time = #{endTime,jdbcType=BIGINT},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
content = #{content,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
@ -298,7 +332,9 @@
|
|||
`status` = #{status,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
start_time = #{startTime,jdbcType=BIGINT},
|
||||
end_time = #{endTime,jdbcType=BIGINT}
|
||||
end_time = #{endTime,jdbcType=BIGINT},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
`type` = #{type,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -0,0 +1,30 @@
|
|||
package io.metersphere.base.mapper;
|
||||
|
||||
import io.metersphere.base.domain.TestPlanApiCase;
|
||||
import io.metersphere.base.domain.TestPlanApiCaseExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface TestPlanApiCaseMapper {
|
||||
long countByExample(TestPlanApiCaseExample example);
|
||||
|
||||
int deleteByExample(TestPlanApiCaseExample example);
|
||||
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
int insert(TestPlanApiCase record);
|
||||
|
||||
int insertSelective(TestPlanApiCase record);
|
||||
|
||||
List<TestPlanApiCase> selectByExample(TestPlanApiCaseExample example);
|
||||
|
||||
TestPlanApiCase selectByPrimaryKey(String id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") TestPlanApiCase record, @Param("example") TestPlanApiCaseExample example);
|
||||
|
||||
int updateByExample(@Param("record") TestPlanApiCase record, @Param("example") TestPlanApiCaseExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(TestPlanApiCase record);
|
||||
|
||||
int updateByPrimaryKey(TestPlanApiCase record);
|
||||
}
|
|
@ -0,0 +1,243 @@
|
|||
<?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="io.metersphere.base.mapper.TestPlanApiCaseMapper">
|
||||
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestPlanApiCase">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="test_plan_id" jdbcType="VARCHAR" property="testPlanId" />
|
||||
<result column="api_case_id" jdbcType="VARCHAR" property="apiCaseId" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="environment_id" jdbcType="VARCHAR" property="environmentId" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, test_plan_id, api_case_id, `status`, environment_id, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestPlanApiCaseExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from test_plan_api_case
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from test_plan_api_case
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from test_plan_api_case
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestPlanApiCaseExample">
|
||||
delete from test_plan_api_case
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.TestPlanApiCase">
|
||||
insert into test_plan_api_case (id, test_plan_id, api_case_id,
|
||||
`status`, environment_id, create_time,
|
||||
update_time)
|
||||
values (#{id,jdbcType=VARCHAR}, #{testPlanId,jdbcType=VARCHAR}, #{apiCaseId,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
|
||||
#{updateTime,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestPlanApiCase">
|
||||
insert into test_plan_api_case
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="testPlanId != null">
|
||||
test_plan_id,
|
||||
</if>
|
||||
<if test="apiCaseId != null">
|
||||
api_case_id,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status`,
|
||||
</if>
|
||||
<if test="environmentId != null">
|
||||
environment_id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="testPlanId != null">
|
||||
#{testPlanId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="apiCaseId != null">
|
||||
#{apiCaseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="environmentId != null">
|
||||
#{environmentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.metersphere.base.domain.TestPlanApiCaseExample" resultType="java.lang.Long">
|
||||
select count(*) from test_plan_api_case
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update test_plan_api_case
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.testPlanId != null">
|
||||
test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.apiCaseId != null">
|
||||
api_case_id = #{record.apiCaseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.environmentId != null">
|
||||
environment_id = #{record.environmentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update test_plan_api_case
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
|
||||
api_case_id = #{record.apiCaseId,jdbcType=VARCHAR},
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
environment_id = #{record.environmentId,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.TestPlanApiCase">
|
||||
update test_plan_api_case
|
||||
<set>
|
||||
<if test="testPlanId != null">
|
||||
test_plan_id = #{testPlanId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="apiCaseId != null">
|
||||
api_case_id = #{apiCaseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="environmentId != null">
|
||||
environment_id = #{environmentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestPlanApiCase">
|
||||
update test_plan_api_case
|
||||
set test_plan_id = #{testPlanId,jdbcType=VARCHAR},
|
||||
api_case_id = #{apiCaseId,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
environment_id = #{environmentId,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -0,0 +1,30 @@
|
|||
package io.metersphere.base.mapper;
|
||||
|
||||
import io.metersphere.base.domain.TestPlanApiScenario;
|
||||
import io.metersphere.base.domain.TestPlanApiScenarioExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface TestPlanApiScenarioMapper {
|
||||
long countByExample(TestPlanApiScenarioExample example);
|
||||
|
||||
int deleteByExample(TestPlanApiScenarioExample example);
|
||||
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
int insert(TestPlanApiScenario record);
|
||||
|
||||
int insertSelective(TestPlanApiScenario record);
|
||||
|
||||
List<TestPlanApiScenario> selectByExample(TestPlanApiScenarioExample example);
|
||||
|
||||
TestPlanApiScenario selectByPrimaryKey(String id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") TestPlanApiScenario record, @Param("example") TestPlanApiScenarioExample example);
|
||||
|
||||
int updateByExample(@Param("record") TestPlanApiScenario record, @Param("example") TestPlanApiScenarioExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(TestPlanApiScenario record);
|
||||
|
||||
int updateByPrimaryKey(TestPlanApiScenario record);
|
||||
}
|
|
@ -0,0 +1,243 @@
|
|||
<?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="io.metersphere.base.mapper.TestPlanApiScenarioMapper">
|
||||
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestPlanApiScenario">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="test_plan_id" jdbcType="VARCHAR" property="testPlanId" />
|
||||
<result column="api_scenario_id" jdbcType="VARCHAR" property="apiScenarioId" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="environment_id" jdbcType="VARCHAR" property="environmentId" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, test_plan_id, api_scenario_id, `status`, environment_id, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestPlanApiScenarioExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from test_plan_api_scenario
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from test_plan_api_scenario
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from test_plan_api_scenario
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestPlanApiScenarioExample">
|
||||
delete from test_plan_api_scenario
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.TestPlanApiScenario">
|
||||
insert into test_plan_api_scenario (id, test_plan_id, api_scenario_id,
|
||||
`status`, environment_id, create_time,
|
||||
update_time)
|
||||
values (#{id,jdbcType=VARCHAR}, #{testPlanId,jdbcType=VARCHAR}, #{apiScenarioId,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
|
||||
#{updateTime,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestPlanApiScenario">
|
||||
insert into test_plan_api_scenario
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="testPlanId != null">
|
||||
test_plan_id,
|
||||
</if>
|
||||
<if test="apiScenarioId != null">
|
||||
api_scenario_id,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status`,
|
||||
</if>
|
||||
<if test="environmentId != null">
|
||||
environment_id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="testPlanId != null">
|
||||
#{testPlanId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="apiScenarioId != null">
|
||||
#{apiScenarioId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="environmentId != null">
|
||||
#{environmentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.metersphere.base.domain.TestPlanApiScenarioExample" resultType="java.lang.Long">
|
||||
select count(*) from test_plan_api_scenario
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update test_plan_api_scenario
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.testPlanId != null">
|
||||
test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.apiScenarioId != null">
|
||||
api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.environmentId != null">
|
||||
environment_id = #{record.environmentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update test_plan_api_scenario
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
|
||||
api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR},
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
environment_id = #{record.environmentId,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.TestPlanApiScenario">
|
||||
update test_plan_api_scenario
|
||||
<set>
|
||||
<if test="testPlanId != null">
|
||||
test_plan_id = #{testPlanId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="apiScenarioId != null">
|
||||
api_scenario_id = #{apiScenarioId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="environmentId != null">
|
||||
environment_id = #{environmentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestPlanApiScenario">
|
||||
update test_plan_api_scenario
|
||||
set test_plan_id = #{testPlanId,jdbcType=VARCHAR},
|
||||
api_scenario_id = #{apiScenarioId,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
environment_id = #{environmentId,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -8,4 +8,5 @@ public interface ExtApiDefinitionExecResultMapper {
|
|||
|
||||
ApiDefinitionExecResult selectMaxResultByResourceId(String resourceId);
|
||||
|
||||
ApiDefinitionExecResult selectMaxResultByResourceIdAndType(String resourceId, String type);
|
||||
}
|
|
@ -9,4 +9,11 @@
|
|||
select * from api_definition_exec_result
|
||||
where resource_id = #{resourceId,jdbcType=VARCHAR} ORDER BY start_time DESC LIMIT 1
|
||||
</select>
|
||||
<select id="selectMaxResultByResourceIdAndType"
|
||||
resultType="io.metersphere.base.domain.ApiDefinitionExecResult">
|
||||
select * from api_definition_exec_result
|
||||
where resource_id = #{resourceId,jdbcType=VARCHAR}
|
||||
and `type` = #{type, jdbcType=VARCHAR}
|
||||
ORDER BY start_time DESC LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
|
@ -3,7 +3,6 @@ package io.metersphere.base.mapper.ext;
|
|||
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseResult;
|
||||
import io.metersphere.base.domain.ApiTestCase;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -11,5 +10,8 @@ import java.util.List;
|
|||
public interface ExtApiTestCaseMapper {
|
||||
|
||||
List<ApiTestCaseResult> list(@Param("request") ApiTestCaseRequest request);
|
||||
|
||||
List<ApiTestCaseDTO> listSimple(@Param("request") ApiTestCaseRequest request);
|
||||
|
||||
List<String> selectIdsNotExistsInPlan(@Param("projectId") String projectId, @Param("planId") String planId);
|
||||
}
|
|
@ -218,6 +218,9 @@
|
|||
api_definition a
|
||||
on
|
||||
c.api_definition_id = a.id
|
||||
<if test="request.protocol != null and request.protocol!=''">
|
||||
and a.protocol = #{request.protocol}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="request.status == 'Trash'">
|
||||
and a.status = 'Trash'
|
||||
|
@ -227,7 +230,18 @@
|
|||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
c.project_id = #{request.projectId}
|
||||
<if test="request.projectId != null and request.projectId!=''">
|
||||
c.project_id = #{request.projectId}
|
||||
</if>
|
||||
<if test="request.ids != null and request.ids.size() > 0">
|
||||
<if test="request.projectId != null and request.projectId!=''">
|
||||
and
|
||||
</if>
|
||||
c.id in
|
||||
<foreach collection="request.ids" item="caseId" separator="," open="(" close=")">
|
||||
#{caseId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.name != null and request.name!=''">
|
||||
and c.name like CONCAT('%', #{request.name},'%')
|
||||
</if>
|
||||
|
@ -258,4 +272,13 @@
|
|||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectIdsNotExistsInPlan" resultType="java.lang.String">
|
||||
select c.id
|
||||
from api_test_case c
|
||||
where c.project_id = #{projectId} and c.id not in (
|
||||
select pc.api_case_id
|
||||
from test_plan_api_case pc
|
||||
where pc.test_plan_id = #{planId}
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package io.metersphere.base.mapper.ext;
|
||||
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
|
||||
import io.metersphere.api.dto.definition.TestPlanApiCaseDTO;
|
||||
import io.metersphere.base.domain.TestPlanApiCase;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ExtTestPlanApiCaseMapper {
|
||||
void insertIfNotExists(@Param("request") TestPlanApiCase request);
|
||||
|
||||
List<TestPlanApiCaseDTO> list(@Param("request") ApiTestCaseRequest request);
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
<?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="io.metersphere.base.mapper.ext.ExtTestPlanApiCaseMapper">
|
||||
|
||||
|
||||
<insert id="insertIfNotExists" parameterType="io.metersphere.base.domain.TestPlanApiCase">
|
||||
-- 查询没有数据再插入
|
||||
INSERT INTO test_plan_api_case(id, test_plan_id, api_case_id, environment_id, create_time, update_time)
|
||||
SELECT #{request.id}, #{request.testPlanId}, #{request.apiCaseId}, #{request.environmentId}, #{request.createTime}, #{request.updateTime}
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS(
|
||||
SELECT id FROM
|
||||
test_plan_api_case
|
||||
WHERE test_plan_id = #{request.testPlanId} and api_case_id = #{request.apiCaseId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="list" resultType="io.metersphere.api.dto.definition.TestPlanApiCaseDTO">
|
||||
select
|
||||
t.id, t.environment_id, t.create_time, t.update_time,
|
||||
c.id as case_id, c.project_id, c.name, c.api_definition_id, c.priority, c.description, c.create_user_id, c.update_user_id,
|
||||
a.module_id, a.path, a.protocol, ader.status execResult
|
||||
from
|
||||
test_plan_api_case t
|
||||
inner join
|
||||
api_test_case c
|
||||
on t.api_case_id = c.id
|
||||
inner join
|
||||
api_definition a
|
||||
on
|
||||
c.api_definition_id = a.id
|
||||
left join (
|
||||
select
|
||||
e.status, e.id, e.resource_id
|
||||
from
|
||||
api_definition_exec_result e
|
||||
left join (
|
||||
select
|
||||
max(start_time) start_time , resource_id
|
||||
from
|
||||
api_definition_exec_result
|
||||
group by
|
||||
resource_id
|
||||
) as b
|
||||
on e.resource_id = b.resource_id
|
||||
where
|
||||
e.start_time = b.start_time and e.type = 'API_PLAN'
|
||||
) as ader
|
||||
on t.id = ader.resource_id
|
||||
<if test="request.protocol != null and request.protocol!=''">
|
||||
and a.protocol = #{request.protocol}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="request.status == 'Trash'">
|
||||
and a.status = 'Trash'
|
||||
</when>
|
||||
<otherwise>
|
||||
and a.status != 'Trash'
|
||||
</otherwise>
|
||||
</choose>
|
||||
where 1
|
||||
<if test="request.ids != null and request.ids.size() > 0">
|
||||
<if test="request.projectId != null and request.projectId!=''">
|
||||
and
|
||||
</if>
|
||||
t.id in
|
||||
<foreach collection="request.ids" item="caseId" separator="," open="(" close=")">
|
||||
#{caseId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.name != null and request.name!=''">
|
||||
and c.name like CONCAT('%', #{request.name},'%')
|
||||
</if>
|
||||
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
|
||||
and a.module_id in
|
||||
<foreach collection="request.moduleIds" item="nodeId" separator="," open="(" close=")">
|
||||
#{nodeId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.filters != null and request.filters.size() > 0">
|
||||
<foreach collection="request.filters.entrySet()" index="key" item="values">
|
||||
<if test="values != null and values.size() > 0">
|
||||
<choose>
|
||||
<when test="key == 'priority'">
|
||||
and c.priority in
|
||||
<foreach collection="values" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.orders != null and request.orders.size() > 0">
|
||||
order by
|
||||
<foreach collection="request.orders" separator="," item="order">
|
||||
<choose>
|
||||
<when test="order.name == 'update_time'">
|
||||
t.${order.name} ${order.type}
|
||||
</when>
|
||||
<otherwise>
|
||||
${order.name} ${order.type}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -1,5 +1,5 @@
|
|||
package io.metersphere.commons.constants;
|
||||
|
||||
public enum ApiRunMode {
|
||||
RUN, DEBUG,DELIMIT,SCENARIO
|
||||
RUN, DEBUG,DELIMIT,SCENARIO, API_PLAN
|
||||
}
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
package io.metersphere.track.controller;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
|
||||
import io.metersphere.api.dto.definition.TestPlanApiCaseDTO;
|
||||
import io.metersphere.base.domain.TestPlanTestCaseWithBLOBs;
|
||||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.commons.utils.PageUtils;
|
||||
import io.metersphere.commons.utils.Pager;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest;
|
||||
import io.metersphere.track.request.testcase.TestPlanCaseBatchRequest;
|
||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||
import io.metersphere.track.service.TestPlanApiCaseService;
|
||||
import io.metersphere.track.service.TestPlanTestCaseService;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@RequestMapping("/test/plan/api/case")
|
||||
@RestController
|
||||
public class TestPlanApiCaseController {
|
||||
|
||||
@Resource
|
||||
TestPlanApiCaseService testPlanApiCaseService;
|
||||
|
||||
// @PostMapping("/list/{goPage}/{pageSize}")
|
||||
// public Pager<List<TestPlanCaseDTO>> getTestPlanCases(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanCaseRequest request) {
|
||||
// Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
// return PageUtils.setPageInfo(page, testPlanTestCaseService.list(request));
|
||||
// }
|
||||
|
||||
@PostMapping("/list/{goPage}/{pageSize}")
|
||||
public Pager<List<TestPlanApiCaseDTO>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiTestCaseRequest request) {
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
return PageUtils.setPageInfo(page, testPlanApiCaseService.list(request));
|
||||
}
|
||||
|
||||
@PostMapping("/relevance/list/{goPage}/{pageSize}")
|
||||
public Pager<List<ApiTestCaseDTO>> relevanceList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiTestCaseRequest request) {
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||
return PageUtils.setPageInfo(page, testPlanApiCaseService.relevanceList(request));
|
||||
}
|
||||
|
||||
@GetMapping("/delete/{planId}/{id}")
|
||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
public int deleteTestCase(@PathVariable String planId, @PathVariable String id) {
|
||||
return testPlanApiCaseService.delete(planId, id);
|
||||
}
|
||||
|
||||
@PostMapping("/batch/delete")
|
||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
public void deleteApiCaseBath(@RequestBody TestPlanApiCaseBatchRequest request) {
|
||||
testPlanApiCaseService.deleteApiCaseBath(request);
|
||||
}
|
||||
|
||||
|
||||
// @GetMapping("/list/node/all/{planId}/{nodePaths}")
|
||||
// public List<TestPlanCaseDTO> getTestPlanCasesByNodePaths(@PathVariable String planId, @PathVariable String nodePaths) {
|
||||
// String nodePath = nodePaths.replace("f", "");
|
||||
// String[] array = nodePath.split(",");
|
||||
// List<String> list = Arrays.asList(array);
|
||||
// QueryTestPlanCaseRequest request = new QueryTestPlanCaseRequest();
|
||||
// request.setPlanId(planId);
|
||||
// request.setNodePaths(list);
|
||||
// request.setMethod("auto");
|
||||
// return testPlanTestCaseService.listByNodes(request);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/get/{caseId}")
|
||||
// public TestPlanCaseDTO getTestPlanCases(@PathVariable String caseId) {
|
||||
// return testPlanTestCaseService.get(caseId);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("recent/{count}")
|
||||
// public List<TestPlanCaseDTO> getRecentTestCases(@PathVariable int count, @RequestBody QueryTestPlanCaseRequest request) {
|
||||
// return testPlanTestCaseService.getRecentTestCases(request, count);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("pending/{count}")
|
||||
// public List<TestPlanCaseDTO> getPrepareTestCases(@PathVariable int count, @RequestBody QueryTestPlanCaseRequest request) {
|
||||
// return testPlanTestCaseService.getPendingTestCases(request, count);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/list/all")
|
||||
// public List<TestPlanCaseDTO> getTestPlanCases(@RequestBody QueryTestPlanCaseRequest request) {
|
||||
// return testPlanTestCaseService.list(request);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/list/ids")
|
||||
// public List<TestPlanCaseDTO> getTestPlanCaseIds(@RequestBody QueryTestPlanCaseRequest request) {
|
||||
// return testPlanTestCaseService.list(request);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/edit")
|
||||
// @RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
// public void editTestCase(@RequestBody TestPlanTestCaseWithBLOBs testPlanTestCase) {
|
||||
// testPlanTestCaseService.editTestCase(testPlanTestCase);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/batch/edit")
|
||||
// @RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
// public void editTestCaseBath(@RequestBody TestPlanCaseBatchRequest request) {
|
||||
// testPlanTestCaseService.editTestCaseBath(request);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/batch/delete")
|
||||
// @RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
// public void deleteTestCaseBath(@RequestBody TestPlanCaseBatchRequest request) {
|
||||
// testPlanTestCaseService.deleteTestCaseBath(request);
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package io.metersphere.track.request.testcase;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class ApiCaseRelevanceRequest {
|
||||
/**
|
||||
* 测试计划ID
|
||||
*/
|
||||
private String planId;
|
||||
|
||||
private String environmentId;
|
||||
|
||||
/**
|
||||
* 当选择关联全部用例时把加载条件送到后台,从后台查询
|
||||
*/
|
||||
// private QueryTestCaseRequest request;
|
||||
|
||||
/**
|
||||
* 具体要关联的用例
|
||||
*/
|
||||
private List<String> selectIds = new ArrayList<>();
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package io.metersphere.track.request.testcase;
|
||||
|
||||
import io.metersphere.base.domain.TestPlanTestCase;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class TestPlanApiCaseBatchRequest extends TestPlanTestCase {
|
||||
private List<String> ids;
|
||||
}
|
|
@ -0,0 +1,193 @@
|
|||
package io.metersphere.track.service;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseDTO;
|
||||
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
|
||||
import io.metersphere.api.dto.definition.TestPlanApiCaseDTO;
|
||||
import io.metersphere.api.service.ApiDefinitionExecResultService;
|
||||
import io.metersphere.api.service.ApiTestCaseService;
|
||||
import io.metersphere.base.domain.*;
|
||||
import io.metersphere.base.mapper.TestPlanApiCaseMapper;
|
||||
import io.metersphere.base.mapper.TestPlanTestCaseMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanApiCaseMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
|
||||
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
|
||||
import io.metersphere.commons.user.SessionUser;
|
||||
import io.metersphere.commons.utils.BeanUtils;
|
||||
import io.metersphere.commons.utils.ServiceUtils;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||
import io.metersphere.service.UserService;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.request.testcase.TestPlanApiCaseBatchRequest;
|
||||
import io.metersphere.track.request.testcase.TestPlanCaseBatchRequest;
|
||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class TestPlanApiCaseService {
|
||||
|
||||
@Resource
|
||||
TestPlanApiCaseMapper testPlanApiCaseMapper;
|
||||
@Resource
|
||||
ApiTestCaseService apiTestCaseService;
|
||||
@Resource
|
||||
ExtTestPlanApiCaseMapper extTestPlanApiCaseMapper;
|
||||
@Resource
|
||||
ApiDefinitionExecResultService apiDefinitionExecResultService;
|
||||
@Resource
|
||||
UserService userService;
|
||||
@Resource
|
||||
TestPlanService testPlanService;
|
||||
|
||||
public List<TestPlanApiCaseDTO> list(ApiTestCaseRequest request) {
|
||||
request.setProjectId(null);
|
||||
// TestPlanApiCaseExample example = new TestPlanApiCaseExample();
|
||||
// example.createCriteria().andTestPlanIdEqualTo(request.getPlanId());
|
||||
// List<TestPlanApiCase> testPlanApiCases = testPlanApiCaseMapper.selectByExample(example);
|
||||
// if (CollectionUtils.isEmpty(testPlanApiCases)) {
|
||||
// return new ArrayList<>();
|
||||
// }
|
||||
// List<String> caseIds = testPlanApiCases.stream().collect(Collectors.toMap((TestPlanApiCase::getApiCaseId + TestPlanApiCase::getTestPlanId)->{
|
||||
//
|
||||
// }));
|
||||
// request.setIds(caseIds);
|
||||
// return apiTestCaseService.listSimple(request);
|
||||
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
|
||||
List<TestPlanApiCaseDTO> apiTestCases = extTestPlanApiCaseMapper.list(request);
|
||||
if (CollectionUtils.isEmpty(apiTestCases)) {
|
||||
return apiTestCases;
|
||||
}
|
||||
apiTestCaseService.buildUserInfo(apiTestCases);
|
||||
return apiTestCases;
|
||||
}
|
||||
|
||||
public List<ApiTestCaseDTO> relevanceList(ApiTestCaseRequest request) {
|
||||
List<String> ids = apiTestCaseService.selectIdsNotExistsInPlan(request.getProjectId(), request.getPlanId());
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
request.setIds(ids);
|
||||
return apiTestCaseService.listSimple(request);
|
||||
}
|
||||
|
||||
public int delete(String planId, String id) {
|
||||
apiDefinitionExecResultService.deleteByResourceId(id);
|
||||
TestPlanApiCaseExample example = new TestPlanApiCaseExample();
|
||||
example.createCriteria()
|
||||
.andTestPlanIdEqualTo(planId)
|
||||
.andIdEqualTo(id);
|
||||
|
||||
return testPlanApiCaseMapper.deleteByExample(example);
|
||||
}
|
||||
|
||||
public void deleteApiCaseBath(TestPlanApiCaseBatchRequest request) {
|
||||
apiDefinitionExecResultService.deleteByResourceIds(request.getIds());
|
||||
TestPlanApiCaseExample example = new TestPlanApiCaseExample();
|
||||
example.createCriteria()
|
||||
.andIdIn(request.getIds())
|
||||
.andTestPlanIdEqualTo(request.getPlanId());
|
||||
testPlanApiCaseMapper.deleteByExample(example);
|
||||
}
|
||||
//
|
||||
// public List<TestPlanCaseDTO> listByNode(QueryTestPlanCaseRequest request) {
|
||||
// List<TestPlanCaseDTO> list = extTestPlanTestCaseMapper.listByNode(request);
|
||||
// return list;
|
||||
// }
|
||||
//
|
||||
// public List<TestPlanCaseDTO> listByNodes(QueryTestPlanCaseRequest request) {
|
||||
// List<TestPlanCaseDTO> list = extTestPlanTestCaseMapper.listByNodes(request);
|
||||
// return list;
|
||||
// }
|
||||
//
|
||||
// public void editTestCase(TestPlanTestCaseWithBLOBs testPlanTestCase) {
|
||||
// if (StringUtils.equals(TestPlanTestCaseStatus.Prepare.name(), testPlanTestCase.getStatus())) {
|
||||
// testPlanTestCase.setStatus(TestPlanTestCaseStatus.Underway.name());
|
||||
// }
|
||||
// testPlanTestCase.setExecutor(SessionUtils.getUser().getId());
|
||||
// testPlanTestCase.setUpdateTime(System.currentTimeMillis());
|
||||
// testPlanTestCaseMapper.updateByPrimaryKeySelective(testPlanTestCase);
|
||||
// }
|
||||
//
|
||||
// public int deleteTestCase(String id) {
|
||||
// return testPlanTestCaseMapper.deleteByPrimaryKey(id);
|
||||
// }
|
||||
//
|
||||
// public void editTestCaseBath(TestPlanCaseBatchRequest request) {
|
||||
// TestPlanTestCaseExample testPlanTestCaseExample = new TestPlanTestCaseExample();
|
||||
// testPlanTestCaseExample.createCriteria().andIdIn(request.getIds());
|
||||
//
|
||||
// TestPlanTestCaseWithBLOBs testPlanTestCase = new TestPlanTestCaseWithBLOBs();
|
||||
// BeanUtils.copyBean(testPlanTestCase, request);
|
||||
// testPlanTestCase.setUpdateTime(System.currentTimeMillis());
|
||||
// testPlanTestCaseMapper.updateByExampleSelective(
|
||||
// testPlanTestCase,
|
||||
// testPlanTestCaseExample);
|
||||
// }
|
||||
//
|
||||
// public List<TestPlanCaseDTO> getRecentTestCases(QueryTestPlanCaseRequest request, int count) {
|
||||
// buildQueryRequest(request, count);
|
||||
// if (request.getPlanIds().isEmpty()) {
|
||||
// return new ArrayList<>();
|
||||
// }
|
||||
//
|
||||
// List<TestPlanCaseDTO> recentTestedTestCase = extTestPlanTestCaseMapper.getRecentTestedTestCase(request);
|
||||
// List<String> planIds = recentTestedTestCase.stream().map(TestPlanCaseDTO::getPlanId).collect(Collectors.toList());
|
||||
//
|
||||
// if (planIds.isEmpty()) {
|
||||
// return new ArrayList<>();
|
||||
// }
|
||||
//
|
||||
// Map<String, String> testPlanMap = testPlanService.getTestPlanByIds(planIds).stream()
|
||||
// .collect(Collectors.toMap(TestPlan::getId, TestPlan::getName));
|
||||
//
|
||||
// recentTestedTestCase.forEach(testCase -> {
|
||||
// testCase.setPlanName(testPlanMap.get(testCase.getPlanId()));
|
||||
// });
|
||||
// return recentTestedTestCase;
|
||||
// }
|
||||
//
|
||||
// public List<TestPlanCaseDTO> getPendingTestCases(QueryTestPlanCaseRequest request, int count) {
|
||||
// buildQueryRequest(request, count);
|
||||
// if (request.getPlanIds().isEmpty()) {
|
||||
// return new ArrayList<>();
|
||||
// }
|
||||
// return extTestPlanTestCaseMapper.getPendingTestCases(request);
|
||||
// }
|
||||
//
|
||||
// public void buildQueryRequest(QueryTestPlanCaseRequest request, int count) {
|
||||
// SessionUser user = SessionUtils.getUser();
|
||||
// List<String> relateTestPlanIds = extTestPlanTestCaseMapper.findRelateTestPlanId(user.getId(), SessionUtils.getCurrentWorkspaceId(), SessionUtils.getCurrentProjectId());
|
||||
// PageHelper.startPage(1, count, true);
|
||||
// request.setPlanIds(relateTestPlanIds);
|
||||
// request.setExecutor(user.getId());
|
||||
// }
|
||||
//
|
||||
// public TestPlanCaseDTO get(String testplanTestCaseId) {
|
||||
// return extTestPlanTestCaseMapper.get(testplanTestCaseId);
|
||||
// }
|
||||
//
|
||||
// public void deleteTestCaseBath(TestPlanCaseBatchRequest request) {
|
||||
// TestPlanTestCaseExample example = new TestPlanTestCaseExample();
|
||||
// example.createCriteria().andIdIn(request.getIds());
|
||||
// testPlanTestCaseMapper.deleteByExample(example);
|
||||
// }
|
||||
//
|
||||
// public List<String> getTestPlanTestCaseIds(String testId) {
|
||||
// return extTestPlanTestCaseMapper.getTestPlanTestCaseIds(testId);
|
||||
// }
|
||||
//
|
||||
// public int updateTestCaseStates(List<String> ids, String reportStatus) {
|
||||
// return extTestPlanTestCaseMapper.updateTestCaseStates(ids, reportStatus);
|
||||
// }
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
CREATE TABLE IF NOT EXISTS `test_plan_api_case` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'ID',
|
||||
`test_plan_id` varchar(50) NOT NULL COMMENT 'Test plan ID',
|
||||
`api_case_id` varchar(50) NOT NULL COMMENT 'Api test case ID',
|
||||
`status` varchar(50) DEFAULT NULL COMMENT 'Api case status',
|
||||
`environment_id` varchar(50) NULL COMMENT 'Relevance environment_id',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `plan_id_case_id` (`test_plan_id`, `api_case_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `test_plan_api_scenario` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'ID',
|
||||
`test_plan_id` varchar(50) NOT NULL COMMENT 'Test plan ID',
|
||||
`api_scenario_id` varchar(50) NOT NULL COMMENT 'Api scenario case ID',
|
||||
`status` varchar(50) DEFAULT NULL COMMENT 'Scenario case status',
|
||||
`environment_id` varchar(50) NULL COMMENT 'Relevance environment_id',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `plan_id_scenario_id` (`test_plan_id`, `api_scenario_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
ALTER TABLE api_definition_exec_result ADD `type` varchar(20) NULL;
|
|
@ -64,7 +64,9 @@
|
|||
|
||||
<!--要生成的数据库表 -->
|
||||
|
||||
<table tableName="api_scenario_module"/>
|
||||
<table tableName="api_definition_exec_result"/>
|
||||
<!--<table tableName="test_plan_api_scenario"/>-->
|
||||
<!--<table tableName="test_plan"/>-->
|
||||
<!--<table tableName="api_scenario_report"/>-->
|
||||
|
||||
</context>
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
debug: Boolean,
|
||||
reportId: String,
|
||||
runData: Array,
|
||||
type: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -106,7 +107,7 @@
|
|||
this.runData.forEach(item => {
|
||||
threadGroup.hashTree.push(item);
|
||||
})
|
||||
let reqObj = {id: this.reportId, testElement: testPlan};
|
||||
let reqObj = {id: this.reportId, testElement: testPlan, type: this.type};
|
||||
let bodyFiles = this.getBodyUploadFiles(reqObj);
|
||||
let url = "";
|
||||
if (this.debug) {
|
||||
|
|
|
@ -27,23 +27,10 @@
|
|||
</el-col>
|
||||
<el-col :span="4">
|
||||
<div>
|
||||
<el-select :disabled="isReadOnly" v-model="environment" size="small" class="ms-api-header-select"
|
||||
:placeholder="$t('api_test.definition.request.run_env')"
|
||||
@change="environmentChange" clearable>
|
||||
<el-option v-for="(environment, index) in environments" :key="index"
|
||||
:label="environment.name + (environment.config.httpConfig.socket ? (': ' + environment.config.httpConfig.protocol + '://' + environment.config.httpConfig.socket) : '')"
|
||||
:value="environment.id"/>
|
||||
<el-button class="environment-button" size="mini" type="primary" @click="openEnvironmentConfig">
|
||||
{{ $t('api_test.environment.environment_config') }}
|
||||
</el-button>
|
||||
<template v-slot:empty>
|
||||
<div class="empty-environment">
|
||||
<el-button class="environment-button" size="mini" type="primary" @click="openEnvironmentConfig">
|
||||
{{ $t('api_test.environment.environment_config') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-select>
|
||||
<ms-environment-select
|
||||
:project-id="projectId"
|
||||
:is-read-only="isReadOnly || isCaseEdit"
|
||||
@setEnvironment="setEnvironment"/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
|
@ -53,8 +40,8 @@
|
|||
v-model="condition.name" @blur="getApiTest" @keyup.enter.native="getApiTest"/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-dropdown size="small" split-button type="primary" class="ms-api-header-select" @click="addCase" :disabled="isReadOnly || isCaseEdit"
|
||||
<el-col :span="2" v-if="!(isReadOnly || isCaseEdit)">
|
||||
<el-dropdown size="small" split-button type="primary" class="ms-api-header-select" @click="addCase"
|
||||
@command="handleCommand">
|
||||
+{{$t('api_test.definition.request.case')}}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
|
@ -64,10 +51,6 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 环境 -->
|
||||
<api-environment-config ref="environmentConfig" @close="environmentConfigClose"/>
|
||||
|
||||
</el-header>
|
||||
</template>
|
||||
|
||||
|
@ -75,13 +58,12 @@
|
|||
import ApiEnvironmentConfig from "../../../test/components/ApiEnvironmentConfig";
|
||||
import {parseEnvironment} from "../../../test/model/EnvironmentModel";
|
||||
import MsTag from "../../../../common/components/MsTag";
|
||||
import MsEnvironmentSelect from "./MsEnvironmentSelect";
|
||||
export default {
|
||||
name: "ApiCaseHeader",
|
||||
components: {MsTag, ApiEnvironmentConfig},
|
||||
components: {MsEnvironmentSelect, MsTag, ApiEnvironmentConfig},
|
||||
data() {
|
||||
return {
|
||||
environments: [],
|
||||
environment: {},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -96,48 +78,9 @@
|
|||
default() {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.environment = undefined;
|
||||
this.getEnvironments();
|
||||
},
|
||||
watch: {
|
||||
environment() {
|
||||
this.$emit('setEnvironment', this.environment);
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getEnvironments() {
|
||||
if (this.projectId) {
|
||||
this.$get('/api/environment/list/' + this.projectId, response => {
|
||||
this.environments = response.data;
|
||||
this.environments.forEach(environment => {
|
||||
parseEnvironment(environment);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.environment = undefined;
|
||||
}
|
||||
},
|
||||
openEnvironmentConfig() {
|
||||
if (!this.projectId) {
|
||||
this.$error(this.$t('api_test.select_project'));
|
||||
return;
|
||||
}
|
||||
this.$refs.environmentConfig.open(this.projectId);
|
||||
},
|
||||
environmentChange(value) {
|
||||
for (let i in this.environments) {
|
||||
if (this.environments[i].id === value) {
|
||||
this.environment = this.environments[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
environmentConfigClose() {
|
||||
this.getEnvironments();
|
||||
},
|
||||
getApiTest() {
|
||||
this.$emit('getApiTest');
|
||||
},
|
||||
|
@ -149,6 +92,9 @@
|
|||
this.$emit('batchRun');
|
||||
}
|
||||
},
|
||||
setEnvironment(data) {
|
||||
this.$emit('setEnvironment', data);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -175,9 +121,10 @@
|
|||
font-size: 10px;
|
||||
}
|
||||
|
||||
.environment-button {
|
||||
margin-left: 20px;
|
||||
padding: 7px;
|
||||
|
||||
.el-col {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.ms-api-header-select {
|
||||
|
@ -185,10 +132,5 @@
|
|||
min-width: 100px;
|
||||
}
|
||||
|
||||
.el-col {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<el-col :span="10">
|
||||
<i class="icon el-icon-arrow-right" :class="{'is-active': apiCase.active}"
|
||||
@click="active(apiCase)"/>
|
||||
<el-input v-if="!apiCase.id" size="small" v-model="apiCase.name" :name="index" :key="index"
|
||||
<el-input v-if="!apiCase.id || isShowInput" size="small" v-model="apiCase.name" :name="index" :key="index"
|
||||
class="ms-api-header-select" style="width: 180px"
|
||||
@blur="saveTestCase(apiCase)"/>
|
||||
<span v-else>
|
||||
|
@ -43,6 +43,8 @@
|
|||
<ms-api-extend-btns :is-case-edit="isCaseEdit" :row="apiCase"/>
|
||||
</el-col>
|
||||
|
||||
{{apiCase.execResult}}//
|
||||
|
||||
<el-col :span="3">
|
||||
<el-link type="danger" v-if="apiCase.execResult && apiCase.execResult==='error'" @click="showExecResult(apiCase)">{{getResult(apiCase.execResult)}}</el-link>
|
||||
<el-link v-else-if="apiCase.execResult && apiCase.execResult==='success'" @click="showExecResult(apiCase)">{{getResult(apiCase.execResult)}}</el-link>
|
||||
|
@ -111,6 +113,7 @@
|
|||
checkedCases: new Set(),
|
||||
visible: false,
|
||||
condition: {},
|
||||
isShowInput: false
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -175,6 +178,7 @@
|
|||
}
|
||||
},
|
||||
saveTestCase(row) {
|
||||
this.isShowInput = false;
|
||||
if (this.validate(row)) {
|
||||
return;
|
||||
}
|
||||
|
@ -192,6 +196,7 @@
|
|||
},
|
||||
showInput(row) {
|
||||
// row.type = "create";
|
||||
this.isShowInput = true;
|
||||
row.active = true;
|
||||
this.active(row);
|
||||
},
|
||||
|
|
|
@ -206,7 +206,7 @@
|
|||
},
|
||||
|
||||
singleRun(row) {
|
||||
if (!this.environment) {
|
||||
if (!this.environment || !this.environment) {
|
||||
this.$warning(this.$t('api_test.environment.select_environment'));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
<template>
|
||||
<span>
|
||||
<el-select :disabled="isReadOnly" v-model="environmentId" size="small" class="environment-select"
|
||||
:placeholder="$t('api_test.definition.request.run_env')" clearable>
|
||||
<el-option v-for="(environment, key) in environments" :key="key"
|
||||
:label="environment.name + (environment.config.httpConfig.socket ? (': ' + environment.config.httpConfig.protocol + '://' + environment.config.httpConfig.socket) : '')"
|
||||
:value="environment.id"/>
|
||||
<el-button class="environment-button" size="mini" type="primary" @click="openEnvironmentConfig">
|
||||
{{ $t('api_test.environment.environment_config') }}
|
||||
</el-button>
|
||||
<template v-slot:empty>
|
||||
<div class="empty-environment">
|
||||
<el-button class="environment-button" size="mini" type="primary" @click="openEnvironmentConfig">
|
||||
{{ $t('api_test.environment.environment_config') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-select>
|
||||
<!-- 环境 -->
|
||||
<api-environment-config ref="environmentConfig" @close="environmentConfigClose"/>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ApiEnvironmentConfig from "../../../test/components/ApiEnvironmentConfig";
|
||||
import {parseEnvironment} from "../../../test/model/EnvironmentModel";
|
||||
export default {
|
||||
name: "MsEnvironmentSelect",
|
||||
components: {ApiEnvironmentConfig},
|
||||
data() {
|
||||
return {
|
||||
environments: [],
|
||||
environment: undefined,
|
||||
isShow: true,
|
||||
environmentId: ""
|
||||
}
|
||||
},
|
||||
props:['projectId','isReadOnly'],
|
||||
created() {
|
||||
this.getEnvironments();
|
||||
},
|
||||
watch: {
|
||||
projectId() {
|
||||
this.getEnvironments();
|
||||
},
|
||||
environment() {
|
||||
this.$emit('setEnvironment', this.environment);
|
||||
},
|
||||
environmentId() {
|
||||
this.environmentChange(this.environmentId);
|
||||
},
|
||||
// planEnvironmentId() {
|
||||
// this.environmentId = this.planEnvironmentId;
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
getEnvironments() {
|
||||
if (this.projectId) {
|
||||
this.$get('/api/environment/list/' + this.projectId, response => {
|
||||
this.environments = response.data;
|
||||
this.environments.forEach(environment => {
|
||||
parseEnvironment(environment);
|
||||
// if (this.planEnvironmentId && environment.id === this.planEnvironmentId) {
|
||||
// this.planEnvironmentId = environment.id;
|
||||
// }
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.environmentId = undefined;
|
||||
}
|
||||
},
|
||||
openEnvironmentConfig() {
|
||||
if (!this.projectId) {
|
||||
this.$error(this.$t('api_test.select_project'));
|
||||
return;
|
||||
}
|
||||
this.$refs.environmentConfig.open(this.projectId);
|
||||
},
|
||||
environmentChange(value) {
|
||||
for (let i in this.environments) {
|
||||
if (this.environments[i].id === value) {
|
||||
this.environment = this.environments[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
environmentConfigClose() {
|
||||
this.getEnvironments();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
|
||||
.environment-button {
|
||||
margin-left: 20px;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.ms-api-header-select {
|
||||
margin-left: 20px;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -1,9 +1,25 @@
|
|||
<template>
|
||||
<div>
|
||||
<api-list-container
|
||||
:is-show-change-button="!isPlanModel"
|
||||
:is-api-list-enable="isApiListEnable"
|
||||
@isApiListEnableChange="isApiListEnableChange">
|
||||
<el-input placeholder="搜索" @blur="search" class="search-input" size="small" v-model="condition.name"/>
|
||||
|
||||
<ms-environment-select v-if="isRelevanceModel" :project-id="relevanceProjectId" :is-read-only="isReadOnly" @setEnvironment="setEnvironment"/>
|
||||
|
||||
<el-input v-if="!isPlanModel" placeholder="搜索" @blur="search" class="search-input" size="small" v-model="condition.name"/>
|
||||
|
||||
<template v-slot:header>
|
||||
<test-plan-case-list-header
|
||||
:project-id="getProjectId()"
|
||||
:condition="condition"
|
||||
:plan-id="planId"
|
||||
@refresh="initTable"
|
||||
@relevanceCase="$emit('relevanceCase')"
|
||||
@setEnvironment="setEnvironment"
|
||||
v-if="isPlanModel"/>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="result.loading"
|
||||
border
|
||||
:data="tableData" row-key="id" class="test-content adjust-table"
|
||||
|
@ -14,7 +30,7 @@
|
|||
<el-table-column type="selection"/>
|
||||
<el-table-column width="40" :resizable="false" align="center">
|
||||
<template v-slot:default="scope">
|
||||
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
|
||||
<show-more-btn :is-show="scope.row.showMore && !isReadOnly" :buttons="buttons" :size="selectRows.size"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -51,8 +67,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column :label="$t('commons.operating')" min-width="130" align="center">
|
||||
<el-table-column v-if="!isReadOnly && !isRelevanceModel" :label="$t('commons.operating')" min-width="130" align="center">
|
||||
<template v-slot:default="scope">
|
||||
<!--<el-button type="text" @click="reductionApi(scope.row)" v-if="trashEnable">恢复</el-button>-->
|
||||
<el-button type="text" @click="handleTestCase(scope.row)" v-if="!trashEnable">{{$t('commons.edit')}}</el-button>
|
||||
|
@ -65,19 +80,17 @@
|
|||
:total="total"/>
|
||||
</api-list-container>
|
||||
|
||||
<api-case-list @showExecResult="showExecResult" @refresh="initTable" :currentApi="selectCase" ref="caseList"/>
|
||||
<api-case-list v-if="!isRelevanceModel" @showExecResult="showExecResult" @refresh="initTable" :currentApi="selectCase" ref="caseList"/>
|
||||
<!--批量编辑-->
|
||||
<ms-batch-edit ref="batchEdit" @batchEdit="batchEdit" :typeArr="typeArr" :value-arr="valueArr"/>
|
||||
<ms-batch-edit v-if="!isRelevanceModel" ref="batchEdit" @batchEdit="batchEdit" :typeArr="typeArr" :value-arr="valueArr"/>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import MsTableHeader from '../../../../common/components/MsTableHeader';
|
||||
import MsTableOperator from "../../../../common/components/MsTableOperator";
|
||||
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
|
||||
import MsTableButton from "../../../../common/components/MsTableButton";
|
||||
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
|
||||
import MsTablePagination from "../../../../common/pagination/TablePagination";
|
||||
import MsTag from "../../../../common/components/MsTag";
|
||||
|
@ -92,17 +105,19 @@
|
|||
import PriorityTableItem from "../../../../track/common/tableItems/planview/PriorityTableItem";
|
||||
import ApiCaseList from "../case/ApiCaseList";
|
||||
import {_filter, _sort} from "../../../../../../common/js/utils";
|
||||
import TestPlanCaseListHeader from "../../../../track/plan/view/comonents/api/TestPlanCaseListHeader";
|
||||
import MsEnvironmentSelect from "../case/MsEnvironmentSelect";
|
||||
|
||||
export default {
|
||||
name: "ApiCaseSimpleList",
|
||||
components: {
|
||||
MsEnvironmentSelect,
|
||||
TestPlanCaseListHeader,
|
||||
ApiCaseList,
|
||||
PriorityTableItem,
|
||||
ApiListContainer,
|
||||
MsTableButton,
|
||||
MsTableOperatorButton,
|
||||
MsTableOperator,
|
||||
MsTableHeader,
|
||||
MsTablePagination,
|
||||
MsTag,
|
||||
MsApiCaseList,
|
||||
|
@ -140,8 +155,8 @@
|
|||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
projectId: "",
|
||||
screenHeight: document.documentElement.clientHeight - 330,//屏幕高度
|
||||
environmentId: undefined
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -155,10 +170,28 @@
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isApiListEnable: Boolean
|
||||
isApiListEnable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isCaseRelevance: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
relevanceProjectId: String,
|
||||
model: {
|
||||
type: String,
|
||||
default() {
|
||||
'api'
|
||||
}
|
||||
},
|
||||
planId: String
|
||||
},
|
||||
created: function () {
|
||||
this.projectId = getCurrentProjectID();
|
||||
this.initTable();
|
||||
},
|
||||
watch: {
|
||||
|
@ -173,6 +206,23 @@
|
|||
this.initTable();
|
||||
}
|
||||
},
|
||||
relevanceProjectId() {
|
||||
this.initTable();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 测试计划关联测试列表
|
||||
isRelevanceModel() {
|
||||
return this.model === 'relevance'
|
||||
},
|
||||
// 测试计划接口用例列表
|
||||
isPlanModel() {
|
||||
return this.model === 'plan'
|
||||
},
|
||||
// 接口定义用例列表
|
||||
isApiModel() {
|
||||
return this.model === 'api'
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
isApiListEnableChange(data) {
|
||||
|
@ -187,17 +237,45 @@
|
|||
this.condition.status = "Trash";
|
||||
this.condition.moduleIds = [];
|
||||
}
|
||||
if (this.projectId != null) {
|
||||
this.condition.projectId = this.projectId;
|
||||
}
|
||||
|
||||
this.buildCondition(this.condition);
|
||||
|
||||
if (this.currentProtocol != null) {
|
||||
this.condition.protocol = this.currentProtocol;
|
||||
}
|
||||
this.result = this.$post("/api/testcase/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => {
|
||||
this.result = this.$post(this.getListUrl() + this.currentPage + "/" + this.pageSize, this.condition, response => {
|
||||
this.total = response.data.itemCount;
|
||||
this.tableData = response.data.listObject;
|
||||
});
|
||||
},
|
||||
buildCondition(condition) {
|
||||
if (this.isPlanModel) {
|
||||
condition.planId = this.planId;
|
||||
} else if (this.isRelevanceModel) {
|
||||
condition.planId = this.planId;
|
||||
condition.projectId = this.getProjectId();
|
||||
} else {
|
||||
condition.projectId = this.getProjectId();
|
||||
}
|
||||
},
|
||||
getListUrl() {
|
||||
if (this.isPlanModel) {
|
||||
return '/test/plan/api/case/list/';
|
||||
} else if (this.isRelevanceModel) {
|
||||
return '/test/plan/api/case/relevance/list/';
|
||||
} else {
|
||||
return '/api/testcase/list/';
|
||||
}
|
||||
},
|
||||
getDeleteUrl(apiCase) {
|
||||
if (this.isPlanModel) {
|
||||
return '/test/plan/api/case/delete/' + this.planId + '/' + apiCase.id;
|
||||
} else if (this.isRelevanceModel) {
|
||||
return '/api/testcase/delete/' + apiCase.id;
|
||||
} else {
|
||||
return '/api/testcase/delete/' + +apiCase.id;
|
||||
}
|
||||
},
|
||||
// getMaintainerOptions() {
|
||||
// let workspaceId = localStorage.getItem(WORKSPACE_ID);
|
||||
// this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
|
||||
|
@ -295,8 +373,7 @@
|
|||
confirmButtonText: this.$t('commons.confirm'),
|
||||
callback: (action) => {
|
||||
if (action === 'confirm') {
|
||||
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||
this.$post('/api/testcase/deleteBatch/', ids, () => {
|
||||
this.$post(this.getBatchDeleteParam(), this.buildBatchDeleteParam(), () => {
|
||||
this.selectRows.clear();
|
||||
this.initTable();
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
|
@ -320,6 +397,23 @@
|
|||
// });
|
||||
// }
|
||||
},
|
||||
buildBatchDeleteParam() {
|
||||
if (this.isPlanModel) {
|
||||
let request = {};
|
||||
request.ids = Array.from(this.selectRows).map(row => row.id);
|
||||
request.planId = this.planId;
|
||||
return request;
|
||||
} else {
|
||||
return Array.from(this.selectRows).map(row => row.id);
|
||||
}
|
||||
},
|
||||
getBatchDeleteParam() {
|
||||
if (this.isPlanModel) {
|
||||
return '/test/plan/api/case/batch/delete';
|
||||
} else {
|
||||
return '/api/testcase/deleteBatch/';
|
||||
}
|
||||
},
|
||||
handleEditBatch() {
|
||||
this.$refs.batchEdit.open();
|
||||
},
|
||||
|
@ -336,7 +430,7 @@
|
|||
},
|
||||
handleDelete(apiCase) {
|
||||
// if (this.trashEnable) {
|
||||
this.$get('/api/testcase/delete/' + apiCase.id, () => {
|
||||
this.$get(this.getDeleteUrl(apiCase), () => {
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
this.initTable();
|
||||
});
|
||||
|
@ -354,6 +448,16 @@
|
|||
// }
|
||||
// }
|
||||
// });
|
||||
},
|
||||
getProjectId() {
|
||||
if (!this.isRelevanceModel) {
|
||||
return getCurrentProjectID();
|
||||
} else {
|
||||
return this.relevanceProjectId;
|
||||
}
|
||||
},
|
||||
setEnvironment(data) {
|
||||
this.environmentId = data.id;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
<api-list-container
|
||||
:is-api-list-enable="isApiListEnable"
|
||||
@isApiListEnableChange="isApiListEnableChange">
|
||||
|
||||
<ms-environment-select :project-id="relevanceProjectId" v-if="isRelevance" :is-read-only="isReadOnly" @setEnvironment="setEnvironment"/>
|
||||
|
||||
<el-input placeholder="搜索" @blur="search" class="search-input" size="small" v-model="condition.name"/>
|
||||
|
||||
<el-table v-loading="result.loading"
|
||||
|
@ -13,7 +16,7 @@
|
|||
<el-table-column type="selection"/>
|
||||
<el-table-column width="40" :resizable="false" align="center">
|
||||
<template v-slot:default="scope">
|
||||
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
|
||||
<show-more-btn :is-show="scope.row.showMore && !isReadOnly" :buttons="buttons" :size="selectRows.size"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -73,7 +76,7 @@
|
|||
:label="$t('api_test.definition.api_case_passing_rate')"
|
||||
show-overflow-tooltip/>
|
||||
|
||||
<el-table-column :label="$t('commons.operating')" min-width="130" align="center">
|
||||
<el-table-column v-if="!isReadOnly && !isRelevance" :label="$t('commons.operating')" min-width="130" align="center">
|
||||
<template v-slot:default="scope">
|
||||
<el-button type="text" @click="reductionApi(scope.row)" v-if="trashEnable">恢复</el-button>
|
||||
<el-button type="text" @click="editApi(scope.row)" v-else>{{$t('commons.edit')}}</el-button>
|
||||
|
@ -110,10 +113,12 @@
|
|||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
import {WORKSPACE_ID} from '../../../../../../common/js/constants';
|
||||
import ApiListContainer from "./ApiListContainer";
|
||||
import MsEnvironmentSelect from "../case/MsEnvironmentSelect";
|
||||
|
||||
export default {
|
||||
name: "ApiList",
|
||||
components: {
|
||||
MsEnvironmentSelect,
|
||||
ApiListContainer,
|
||||
MsTableButton,
|
||||
MsTableOperatorButton,
|
||||
|
@ -154,8 +159,8 @@
|
|||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
projectId: "",
|
||||
screenHeight: document.documentElement.clientHeight - 330,//屏幕高度
|
||||
screenHeight: document.documentElement.clientHeight - 330,//屏幕高度,
|
||||
environmentId: undefined
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -165,14 +170,23 @@
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isCaseRelevance: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
trashEnable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isApiListEnable: Boolean
|
||||
isApiListEnable: Boolean,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
relevanceProjectId: String,
|
||||
isRelevance: Boolean
|
||||
},
|
||||
created: function () {
|
||||
this.projectId = getCurrentProjectID();
|
||||
this.initTable();
|
||||
this.getMaintainerOptions();
|
||||
},
|
||||
|
@ -188,6 +202,9 @@
|
|||
this.initTable();
|
||||
}
|
||||
},
|
||||
relevanceProjectId() {
|
||||
this.initTable();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isApiListEnableChange(data) {
|
||||
|
@ -202,9 +219,9 @@
|
|||
this.condition.filters = ["Trash"];
|
||||
this.condition.moduleIds = [];
|
||||
}
|
||||
if (this.projectId != null) {
|
||||
this.condition.projectId = this.projectId;
|
||||
}
|
||||
|
||||
this.condition.projectId = this.getProjectId();
|
||||
|
||||
if (this.currentProtocol != null) {
|
||||
this.condition.protocol = this.currentProtocol;
|
||||
}
|
||||
|
@ -361,6 +378,16 @@
|
|||
},
|
||||
showExecResult(row) {
|
||||
this.$emit('showExecResult', row);
|
||||
},
|
||||
getProjectId() {
|
||||
if (!this.isCaseRelevance) {
|
||||
return getCurrentProjectID();
|
||||
} else {
|
||||
return this.relevanceProjectId;
|
||||
}
|
||||
},
|
||||
setEnvironment(data) {
|
||||
this.environmentId = data.id;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
<template>
|
||||
<el-card class="card-content" v-if="isShow">
|
||||
<el-button-group>
|
||||
<el-button-group v-if="isShowChangeButton">
|
||||
<el-button plain size="small" icon="el-icon-tickets" :class="{active: isApiListEnable}" @click="apiChange('api')"></el-button>
|
||||
<el-button plain class="case-button" size="small" icon="el-icon-paperclip" :class="{active: !isApiListEnable}" @click="caseChange('case')"></el-button>
|
||||
</el-button-group>
|
||||
<template v-slot:header>
|
||||
<slot name="header"></slot>
|
||||
</template>
|
||||
<slot></slot>
|
||||
</el-card>
|
||||
</template>
|
||||
|
@ -17,7 +20,11 @@
|
|||
}
|
||||
},
|
||||
props: {
|
||||
isApiListEnable: Boolean
|
||||
isApiListEnable: Boolean,
|
||||
isShowChangeButton: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
apiChange() {
|
||||
|
@ -40,5 +47,4 @@
|
|||
border-left: solid 1px #6d317c;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</template>
|
||||
</el-input>
|
||||
|
||||
<module-trash-button :condition="condition" :exe="enableTrash"/>
|
||||
<module-trash-button v-if="!isReadOnly" :condition="condition" :exe="enableTrash"/>
|
||||
|
||||
<ms-add-basis-api
|
||||
:current-protocol="condition.protocol"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<slot name="button"></slot>
|
||||
</span>
|
||||
<span>
|
||||
<slot name="searchBarBefore"></slot>
|
||||
<ms-table-search-bar :condition.sync="condition" @change="search" class="search-bar" :tip="tip"/>
|
||||
<ms-table-adv-search-bar :condition.sync="condition" @search="search" v-if="isCombine"/>
|
||||
</span>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="select-menu">
|
||||
<span class="menu-title">{{'[' + title + ']'}}</span>
|
||||
<el-select filterable slot="prepend" v-model="value" @change="changeData" :style="{width: width}"
|
||||
size="small">
|
||||
|
|
|
@ -7,27 +7,17 @@
|
|||
ref="baseRelevance">
|
||||
|
||||
<template v-slot:aside>
|
||||
<!--<node-tree class="node-tree"-->
|
||||
<!--@nodeSelectEvent="nodeChange"-->
|
||||
<!--@refresh="refresh"-->
|
||||
<!--:tree-nodes="treeNodes"-->
|
||||
<!--ref="nodeTree"/>-->
|
||||
<ms-api-module
|
||||
@nodeSelectEvent="nodeChange"
|
||||
@protocolChange="handleProtocolChange"
|
||||
@refreshTable="refresh"
|
||||
@exportAPI="exportAPI"
|
||||
@debug="debug"
|
||||
@saveAsEdit="editApi"
|
||||
@setModuleOptions="setModuleOptions"
|
||||
@enableTrash="enableTrash"
|
||||
:is-read-only="true"
|
||||
:type="'edit'"
|
||||
ref="nodeTree"/>
|
||||
</template>
|
||||
|
||||
<ms-table-header :condition.sync="condition" @search="search" title="" :show-create="false"/>
|
||||
|
||||
<!-- 列表集合 -->
|
||||
<api-list
|
||||
v-if="isApiListEnable"
|
||||
:current-protocol="currentProtocol"
|
||||
|
@ -35,12 +25,27 @@
|
|||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="trashEnable"
|
||||
:is-api-list-enable="isApiListEnable"
|
||||
@editApi="editApi"
|
||||
@handleCase="handleCase"
|
||||
@showExecResult="showExecResult"
|
||||
:is-case-relevance="true"
|
||||
:relevance-project-id="projectId"
|
||||
:is-relevance="true"
|
||||
@isApiListEnableChange="isApiListEnableChange"
|
||||
ref="apiList"/>
|
||||
|
||||
<!--测试用例列表-->
|
||||
<api-case-simple-list
|
||||
v-if="!isApiListEnable"
|
||||
:current-protocol="currentProtocol"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="trashEnable"
|
||||
:is-api-list-enable="isApiListEnable"
|
||||
:is-case-relevance="true"
|
||||
:relevance-project-id="projectId"
|
||||
:plan-id="planId"
|
||||
:model="'relevance'"
|
||||
@isApiListEnableChange="isApiListEnableChange"
|
||||
ref="apiCaseList"/>
|
||||
|
||||
|
||||
</test-case-relevance-base>
|
||||
|
||||
|
@ -48,47 +53,32 @@
|
|||
|
||||
<script>
|
||||
|
||||
import NodeTree from '../../../../common/NodeTree';
|
||||
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
|
||||
import TypeTableItem from "../../../../common/tableItems/planview/TypeTableItem";
|
||||
import MsTableSearchBar from "../../../../../common/components/MsTableSearchBar";
|
||||
import MsTableAdvSearchBar from "../../../../../common/components/search/MsTableAdvSearchBar";
|
||||
import MsTableHeader from "../../../../../common/components/MsTableHeader";
|
||||
import elTableInfiniteScroll from 'el-table-infinite-scroll';
|
||||
import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase";
|
||||
import ApiList from "../../../../../api/automation/scenario/api/ApiList";
|
||||
import MsApiModule from "../../../../../api/definition/components/module/ApiModule";
|
||||
import {getCurrentProjectID} from "../../../../../../../common/js/utils";
|
||||
import ApiList from "../../../../../api/definition/components/list/ApiList";
|
||||
import ApiCaseSimpleList from "../../../../../api/definition/components/list/ApiCaseSimpleList";
|
||||
|
||||
export default {
|
||||
name: "TestCaseApiRelevance",
|
||||
components: {
|
||||
MsApiModule,
|
||||
ApiCaseSimpleList,
|
||||
ApiList,
|
||||
MsApiModule,
|
||||
TestCaseRelevanceBase,
|
||||
NodeTree,
|
||||
PriorityTableItem,
|
||||
TypeTableItem,
|
||||
MsTableSearchBar,
|
||||
MsTableAdvSearchBar,
|
||||
MsTableHeader,
|
||||
},
|
||||
directives: {
|
||||
'el-table-infinite-scroll': elTableInfiniteScroll
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showCasePage: true,
|
||||
apiDefaultTab: 'default',
|
||||
currentProtocol: null,
|
||||
currentModule: null,
|
||||
selectNodeIds: [],
|
||||
currentApi: {},
|
||||
moduleOptions: {},
|
||||
trashEnable: false,
|
||||
isApiListEnable: true,
|
||||
condition: {},
|
||||
currentRow: {}
|
||||
currentRow: {},
|
||||
projectId: ""
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -98,97 +88,26 @@
|
|||
},
|
||||
watch: {
|
||||
planId() {
|
||||
// this.condition.planId = this.planId;
|
||||
this.condition.planId = this.planId;
|
||||
},
|
||||
projectId() {
|
||||
this.condition.projectId = this.projectId;
|
||||
// this.getProjectNode();
|
||||
// this.search();
|
||||
}
|
||||
},
|
||||
updated() {
|
||||
this.toggleSelection(this.testCases);
|
||||
},
|
||||
methods: {
|
||||
|
||||
open() {
|
||||
this.$refs.baseRelevance.open();
|
||||
},
|
||||
search() {
|
||||
|
||||
},
|
||||
|
||||
setProject(projectId) {
|
||||
this.projectId = projectId;
|
||||
},
|
||||
|
||||
isApiListEnableChange(data) {
|
||||
this.isApiListEnable = data;
|
||||
},
|
||||
handleCommand(e) {
|
||||
switch (e) {
|
||||
case "ADD":
|
||||
this.handleTabAdd(e);
|
||||
break;
|
||||
case "TEST":
|
||||
this.handleTabsEdit(this.$t("commons.api"), e);
|
||||
break;
|
||||
case "CLOSE_ALL":
|
||||
this.handleTabClose();
|
||||
break;
|
||||
default:
|
||||
this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug");
|
||||
break;
|
||||
}
|
||||
},
|
||||
debug(id) {
|
||||
this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id);
|
||||
},
|
||||
editApi(row) {
|
||||
let name = this.$t('api_test.definition.request.edit_api');
|
||||
if (row.name) {
|
||||
name = this.$t('api_test.definition.request.edit_api') + "-" + row.name;
|
||||
}
|
||||
// this.handleTabsEdit(name, "ADD", row);
|
||||
},
|
||||
handleCase(api) {
|
||||
this.currentApi = api;
|
||||
this.showCasePage = false;
|
||||
},
|
||||
apiCaseClose() {
|
||||
this.showCasePage = true;
|
||||
},
|
||||
exportAPI() {
|
||||
if (!this.$refs.apiList[0].tableData) {
|
||||
return;
|
||||
}
|
||||
let obj = {projectName: getCurrentProjectID(), protocol: this.currentProtocol, data: this.$refs.apiList[0].tableData}
|
||||
// downloadFile("导出API.json", JSON.stringify(obj));
|
||||
},
|
||||
refresh(data) {
|
||||
this.$refs.apiList[0].initTable(data);
|
||||
},
|
||||
setTabTitle(data) {
|
||||
for (let index in this.apiTabs) {
|
||||
let tab = this.apiTabs[index];
|
||||
if (tab.name === this.apiDefaultTab) {
|
||||
tab.title = this.$t('api_test.definition.request.edit_api') + "-" + data.name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.runTestData = data;
|
||||
},
|
||||
runTest(data) {
|
||||
this.setTabTitle(data);
|
||||
this.handleCommand("TEST");
|
||||
},
|
||||
saveApi(data) {
|
||||
this.setTabTitle(data);
|
||||
this.$refs.apiList[0].initApiTable(data);
|
||||
},
|
||||
|
||||
showExecResult(row){
|
||||
this.debug(row);
|
||||
refresh(data) {
|
||||
if (this.isApiListEnable) {
|
||||
this.$refs.apiList.initTable(data);
|
||||
} else {
|
||||
this.$refs.apiCaseList.initTable(data);
|
||||
}
|
||||
},
|
||||
|
||||
nodeChange(node, nodeIds, pNodes) {
|
||||
|
@ -200,26 +119,42 @@
|
|||
setModuleOptions(data) {
|
||||
this.moduleOptions = data;
|
||||
},
|
||||
enableTrash(data) {
|
||||
this.trashEnable = data;
|
||||
},
|
||||
|
||||
saveCaseRelevance() {
|
||||
|
||||
let param = {};
|
||||
param.planId = this.planId;
|
||||
param.testCaseIds = [...this.selectIds];
|
||||
param.request = this.condition;
|
||||
// 选择全选则全部加入到评审,无论是否加载完全部
|
||||
if (this.testCases.length === param.testCaseIds.length) {
|
||||
param.testCaseIds = ['all'];
|
||||
let url = '';
|
||||
let environmentId = undefined;
|
||||
let selectIds = [];
|
||||
if (this.isApiListEnable) {
|
||||
url = '/api/definition/relevance';
|
||||
environmentId = this.$refs.apiList.environmentId;
|
||||
selectIds = Array.from(this.$refs.apiList.selectRows).map(row => row.id);
|
||||
} else {
|
||||
url = '/api/testcase/relevance';
|
||||
environmentId = this.$refs.apiCaseList.environmentId;
|
||||
selectIds = Array.from(this.$refs.apiCaseList.selectRows).map(row => row.id);
|
||||
}
|
||||
this.result = this.$post('/test/plan/relevance', param, () => {
|
||||
this.selectIds.clear();
|
||||
|
||||
if (!environmentId) {
|
||||
this.$warning(this.$t('api_test.environment.select_environment'));
|
||||
return;
|
||||
}
|
||||
|
||||
param.planId = this.planId;
|
||||
param.selectIds = selectIds;
|
||||
param.environmentId = environmentId;
|
||||
// param.request = this.condition;
|
||||
// 选择全选则全部加入到评审,无论是否加载完全部
|
||||
// if (this.testCases.length === param.testCaseIds.length) {
|
||||
// param.testCaseIds = ['all'];
|
||||
// }
|
||||
|
||||
this.result = this.$post(url, param, () => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
|
||||
this.$refs.baseRelevance.close();
|
||||
|
||||
this.$emit('refresh');
|
||||
this.refresh();
|
||||
this.$refs.baseRelevance.close();
|
||||
});
|
||||
},
|
||||
}
|
||||
|
@ -227,4 +162,14 @@
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
/deep/ .select-menu {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/deep/ .environment-select {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -2,30 +2,34 @@
|
|||
|
||||
<ms-test-plan-common-component>
|
||||
<template v-slot:aside>
|
||||
<node-tree class="node-tree"
|
||||
v-loading="result.loading"
|
||||
@nodeSelectEvent="nodeChange"
|
||||
@refresh="refresh"
|
||||
:tree-nodes="treeNodes"
|
||||
:draggable="false"
|
||||
ref="nodeTree"/>
|
||||
<ms-api-module
|
||||
@nodeSelectEvent="nodeChange"
|
||||
@protocolChange="handleProtocolChange"
|
||||
@refreshTable="refresh"
|
||||
@setModuleOptions="setModuleOptions"
|
||||
:is-read-only="true"
|
||||
:type="'edit'"
|
||||
ref="nodeTree"/>
|
||||
</template>
|
||||
|
||||
<template v-slot:main>
|
||||
<!--测试用例列表-->
|
||||
<test-plan-api-case-list
|
||||
class="table-list"
|
||||
@openTestCaseRelevanceDialog="openTestCaseRelevanceDialog"
|
||||
@refresh="refresh"
|
||||
:plan-id="planId"
|
||||
:current-protocol="currentProtocol"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:select-parent-nodes="selectParentNodes"
|
||||
ref="testPlanTestCaseList"/>
|
||||
:trash-enable="trashEnable"
|
||||
:is-case-relevance="true"
|
||||
:model="'plan'"
|
||||
:plan-id="planId"
|
||||
@relevanceCase="openTestCaseRelevanceDialog"
|
||||
ref="apiCaseList"/>
|
||||
</template>
|
||||
|
||||
<test-case-api-relevance
|
||||
@refresh="refresh"
|
||||
:plan-id="planId"
|
||||
ref="testCaseRelevance"/>
|
||||
ref="apiCaseRelevance"/>
|
||||
|
||||
</ms-test-plan-common-component>
|
||||
|
||||
|
@ -33,84 +37,140 @@
|
|||
|
||||
<script>
|
||||
import NodeTree from "../../../../common/NodeTree";
|
||||
import TestPlanTestCaseList from "../functional/FunctionalTestCaseList";
|
||||
import TestCaseRelevance from "../functional/TestCaseFunctionalRelevance";
|
||||
import MsTestPlanCommonComponent from "../base/TestPlanCommonComponent";
|
||||
import TestPlanApiCaseList from "./TestPlanApiCaseList";
|
||||
import TestCaseApiRelevance from "./TestCaseApiRelevance";
|
||||
import ApiCaseSimpleList from "../../../../../api/definition/components/list/ApiCaseSimpleList";
|
||||
import MsApiModule from "../../../../../api/definition/components/module/ApiModule";
|
||||
|
||||
export default {
|
||||
name: "TestPlanApi",
|
||||
components: {
|
||||
MsApiModule,
|
||||
ApiCaseSimpleList,
|
||||
TestCaseApiRelevance,
|
||||
TestPlanApiCaseList,
|
||||
MsTestPlanCommonComponent,
|
||||
TestCaseRelevance,
|
||||
TestPlanTestCaseList,
|
||||
NodeTree,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
result: {},
|
||||
selectNodeIds: [],
|
||||
selectParentNodes: [],
|
||||
treeNodes: [],
|
||||
currentRow: "",
|
||||
trashEnable: false,
|
||||
currentProtocol: null,
|
||||
currentModule: null,
|
||||
selectNodeIds: [],
|
||||
moduleOptions: {},
|
||||
|
||||
}
|
||||
},
|
||||
props: [
|
||||
'planId'
|
||||
],
|
||||
mounted() {
|
||||
this.initData();
|
||||
this.openTestCaseEdit(this.$route.path);
|
||||
// this.initData();
|
||||
// this.openTestCaseEdit(this.$route.path);
|
||||
},
|
||||
watch: {
|
||||
'$route'(to, from) {
|
||||
this.openTestCaseEdit(to.path);
|
||||
// this.openTestCaseEdit(to.path);
|
||||
},
|
||||
planId() {
|
||||
this.initData();
|
||||
// this.initData();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
refresh() {
|
||||
this.selectNodeIds = [];
|
||||
this.selectParentNodes = [];
|
||||
this.$refs.testCaseRelevance.search();
|
||||
this.getNodeTreeByPlanId();
|
||||
setProject(projectId) {
|
||||
this.projectId = projectId;
|
||||
},
|
||||
initData() {
|
||||
this.getNodeTreeByPlanId();
|
||||
// isApiListEnableChange(data) {
|
||||
// this.isApiListEnable = data;
|
||||
// },
|
||||
|
||||
refresh(data) {
|
||||
this.$refs.nodeTree.list();
|
||||
this.$refs.apiCaseList.initTable();
|
||||
},
|
||||
openTestCaseRelevanceDialog() {
|
||||
this.$refs.testCaseRelevance.open();
|
||||
},
|
||||
nodeChange(nodeIds, pNodes) {
|
||||
|
||||
nodeChange(node, nodeIds, pNodes) {
|
||||
this.selectNodeIds = nodeIds;
|
||||
this.selectParentNodes = pNodes;
|
||||
// 切换node后,重置分页数
|
||||
this.$refs.testPlanTestCaseList.currentPage = 1;
|
||||
this.$refs.testPlanTestCaseList.pageSize = 10;
|
||||
},
|
||||
getNodeTreeByPlanId() {
|
||||
if (this.planId) {
|
||||
this.result = this.$get("/case/node/list/plan/" + this.planId, response => {
|
||||
this.treeNodes = response.data;
|
||||
});
|
||||
}
|
||||
handleProtocolChange(protocol) {
|
||||
this.currentProtocol = protocol;
|
||||
},
|
||||
openTestCaseEdit(path) {
|
||||
if (path.indexOf("/plan/view/edit") >= 0) {
|
||||
let caseId = this.$route.params.caseId;
|
||||
this.$get('/test/plan/case/get/' + caseId, response => {
|
||||
let testCase = response.data;
|
||||
if (testCase) {
|
||||
this.$refs.testPlanTestCaseList.handleEdit(testCase);
|
||||
this.$router.push('/track/plan/view/' + testCase.planId);
|
||||
}
|
||||
});
|
||||
}
|
||||
setModuleOptions(data) {
|
||||
this.moduleOptions = data;
|
||||
},
|
||||
|
||||
saveCaseRelevance() {
|
||||
let url = '';
|
||||
let selectIds = [];
|
||||
// if (this.isApiListEnable) {
|
||||
// url = '/api/definition/relevance';
|
||||
// selectIds = Array.from(this.$refs.apiList.selectRows).map(row => row.id);
|
||||
// } else {
|
||||
// url = '/api/testcase/relevance';
|
||||
// selectIds = Array.from(this.$refs.apiCaseList.selectRows).map(row => row.id);
|
||||
// }
|
||||
|
||||
let param = {};
|
||||
param.planId = this.planId;
|
||||
param.selectIds = selectIds;
|
||||
// param.request = this.condition;
|
||||
// 选择全选则全部加入到评审,无论是否加载完全部
|
||||
// if (this.testCases.length === param.testCaseIds.length) {
|
||||
// param.testCaseIds = ['all'];
|
||||
// }
|
||||
|
||||
this.result = this.$post(url, param, () => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.refresh();
|
||||
this.$refs.baseRelevance.close();
|
||||
});
|
||||
},
|
||||
// refresh() {
|
||||
// this.selectNodeIds = [];
|
||||
// this.selectParentNodes = [];
|
||||
// this.$refs.testCaseRelevance.search();
|
||||
// this.getNodeTreeByPlanId();
|
||||
// },
|
||||
// initData() {
|
||||
// this.getNodeTreeByPlanId();
|
||||
// },
|
||||
openTestCaseRelevanceDialog() {
|
||||
this.$refs.apiCaseRelevance.open();
|
||||
},
|
||||
// nodeChange(nodeIds, pNodes) {
|
||||
// this.selectNodeIds = nodeIds;
|
||||
// this.selectParentNodes = pNodes;
|
||||
// // 切换node后,重置分页数
|
||||
// this.$refs.testPlanTestCaseList.currentPage = 1;
|
||||
// this.$refs.testPlanTestCaseList.pageSize = 10;
|
||||
// },
|
||||
// getNodeTreeByPlanId() {
|
||||
// if (this.planId) {
|
||||
// this.result = this.$get("/case/node/list/plan/" + this.planId, response => {
|
||||
// this.treeNodes = response.data;
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// openTestCaseEdit(path) {
|
||||
// if (path.indexOf("/plan/view/edit") >= 0) {
|
||||
// let caseId = this.$route.params.caseId;
|
||||
// this.$get('/test/plan/case/get/' + caseId, response => {
|
||||
// let testCase = response.data;
|
||||
// if (testCase) {
|
||||
// this.$refs.testPlanTestCaseList.handleEdit(testCase);
|
||||
// this.$router.push('/track/plan/view/' + testCase.planId);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,32 @@
|
|||
<template>
|
||||
<el-dialog :close-on-click-modal="false" :title="'测试结果'" width="30%"
|
||||
:visible.sync="visible" class="api-import" @close="close">
|
||||
<ms-request-result-tail :response="response" ref="debugResult"/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsRequestResultTail from "../../../../../api/definition/components/response/RequestResultTail";
|
||||
export default {
|
||||
name: "TestPlanApiCaseResult",
|
||||
components: {MsRequestResultTail},
|
||||
props: ['response'],
|
||||
data() {
|
||||
return {
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.visible = false;
|
||||
},
|
||||
open() {
|
||||
this.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,58 @@
|
|||
<template>
|
||||
<ms-table-header :is-tester-permission="true" :condition="condition" @search="$emit('refresh')"
|
||||
:show-create="false" :tip="$t('commons.search_by_name_or_id')">
|
||||
<!--<template v-slot:title>-->
|
||||
<!--<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="breadcrumbRefresh"/>-->
|
||||
<!--</template>-->
|
||||
<template v-slot:button>
|
||||
<!--<ms-table-button :is-tester-permission="true" v-if="!showMyTestCase" icon="el-icon-s-custom"-->
|
||||
<!--:content="$t('test_track.plan_view.my_case')" @click="initTable"/>-->
|
||||
<!--<ms-table-button :is-tester-permission="true" v-if="showMyTestCase" icon="el-icon-files"-->
|
||||
<!--:content="$t('test_track.plan_view.all_case')" @click="searchMyTestCase"/>-->
|
||||
<ms-table-button :is-tester-permission="true" icon="el-icon-connection"
|
||||
:content="$t('test_track.plan_view.relevance_test_case')"
|
||||
@click="$emit('relevanceCase')"/>
|
||||
<!--<ms-table-button :is-tester-permission="true" v-if="!testPlan.reportId" icon="el-icon-document"-->
|
||||
<!--:content="$t('test_track.plan_view.create_report')" @click="openTestReport"/>-->
|
||||
<!--<ms-table-button :is-tester-permission="true" v-if="testPlan.reportId" icon="el-icon-document"-->
|
||||
<!--:content="$t('test_track.plan_view.view_report')" @click="openReport"/>-->
|
||||
<!--<ms-table-button :is-tester-permission="true" icon="el-icon-document-remove"-->
|
||||
<!--:content="$t('test_track.plan_view.cancel_all_relevance')" @click="handleDeleteBatch"/>-->
|
||||
</template>
|
||||
|
||||
<!--<template v-slot:searchBarBefore>-->
|
||||
<!--<ms-environment-select :project-id="projectId" :is-read-only="isReadOnly" @setEnvironment="setEnvironment"/>-->
|
||||
<!--</template>-->
|
||||
</ms-table-header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsTableHeader from "../../../../../common/components/MsTableHeader";
|
||||
import MsTableButton from "../../../../../common/components/MsTableButton";
|
||||
import MsEnvironmentSelect from "../../../../../api/definition/components/case/MsEnvironmentSelect";
|
||||
export default {
|
||||
name: "TestPlanCaseListHeader",
|
||||
components: {MsEnvironmentSelect, MsTableButton, MsTableHeader},
|
||||
props: ['condition', 'projectId', 'isReadOnly', 'planId'],
|
||||
methods: {
|
||||
setEnvironment(data) {
|
||||
if (this.planId) {
|
||||
let param = {};
|
||||
param.id = this.planId;
|
||||
param.environmentId = data.id;
|
||||
this.$post('/test/plan/edit', param, () => {
|
||||
this.$emit('setEnvironment', data);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
/deep/ .environment-select {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue