fix(接口定义): 自动生成代码规范修改

This commit is contained in:
fit2-zhao 2020-12-01 17:47:39 +08:00
parent 4facb91b34
commit f62ae2bd59
44 changed files with 3013 additions and 1365 deletions

View File

@ -1,13 +1,12 @@
package io.metersphere.api.dto.definition;
import io.metersphere.base.domain.ApiDefinition;
import io.metersphere.base.domain.Schedule;
import io.metersphere.base.domain.ApiDefinitionWithBLOBs;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class ApiDefinitionResult extends ApiDefinition {
public class ApiDefinitionResult extends ApiDefinitionWithBLOBs {
private String projectName;
@ -18,6 +17,4 @@ public class ApiDefinitionResult extends ApiDefinition {
private String caseStatus;
private String casePassingRate;
private Schedule schedule;
}

View File

@ -1,12 +1,12 @@
package io.metersphere.api.dto.definition;
import io.metersphere.base.domain.ApiTestCase;
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class ApiTestCaseResult extends ApiTestCase {
public class ApiTestCaseResult extends ApiTestCaseWithBLOBs {
private String projectName;
private String createUser;
private String updateUser;

View File

@ -1,15 +1,10 @@
package io.metersphere.api.service;
import io.metersphere.base.mapper.ApiDefinitionHistoryMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@Service
@Transactional(rollbackFor = Exception.class)
public class ApiAutomationService {
@Resource
private ApiDefinitionHistoryMapper apiDefinitionHistoryMapper;
}

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import io.metersphere.api.jmeter.TestResult;
import io.metersphere.base.domain.ApiDefinitionExecResult;
import io.metersphere.base.mapper.ApiDefinitionExecResultMapper;
import io.metersphere.base.mapper.ext.ExtApiDefinitionExecResultMapper;
import io.metersphere.commons.utils.SessionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -17,12 +18,14 @@ import java.util.UUID;
public class ApiDefinitionExecResultService {
@Resource
private ApiDefinitionExecResultMapper apiDefinitionExecResultMapper;
@Resource
private ExtApiDefinitionExecResultMapper extApiDefinitionExecResultMapper;
public void saveApiResult(TestResult result) {
result.getScenarios().get(0).getRequestResults().forEach(item -> {
// 清理原始资源每个执行 保留一条结果
apiDefinitionExecResultMapper.deleteByResourceId(item.getName());
extApiDefinitionExecResultMapper.deleteByResourceId(item.getName());
ApiDefinitionExecResult saveResult = new ApiDefinitionExecResult();
saveResult.setId(UUID.randomUUID().toString());
saveResult.setUserId(Objects.requireNonNull(SessionUtils.getUser()).getId());

View File

@ -1,20 +0,0 @@
package io.metersphere.api.service;
import io.metersphere.base.domain.ApiDefinitionHistory;
import io.metersphere.base.mapper.ApiDefinitionHistoryMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class ApiDefinitionHistoryService {
@Resource
private ApiDefinitionHistoryMapper apiDefinitionHistoryMapper;
public List<ApiDefinitionHistory> selectByApiDefinitionId(String id){
return apiDefinitionHistoryMapper.selectByApiDefinitionId(id);
}
}

View File

@ -12,9 +12,10 @@ import io.metersphere.api.jmeter.TestResult;
import io.metersphere.api.parse.ApiImportParser;
import io.metersphere.api.parse.ApiImportParserFactory;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.ApiDefinitionExecResultMapper;
import io.metersphere.base.mapper.ApiDefinitionMapper;
import io.metersphere.base.mapper.ApiTestFileMapper;
import io.metersphere.base.mapper.ext.ExtApiDefinitionExecResultMapper;
import io.metersphere.base.mapper.ext.ExtApiDefinitionMapper;
import io.metersphere.commons.constants.APITestStatus;
import io.metersphere.commons.constants.ApiRunMode;
import io.metersphere.commons.exception.MSException;
@ -40,6 +41,8 @@ import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
public class ApiDefinitionService {
@Resource
private ExtApiDefinitionMapper extApiDefinitionMapper;
@Resource
private ApiDefinitionMapper apiDefinitionMapper;
@Resource
@ -49,7 +52,7 @@ public class ApiDefinitionService {
@Resource
private ApiTestCaseService apiTestCaseService;
@Resource
private ApiDefinitionExecResultMapper apiDefinitionExecResultMapper;
private ExtApiDefinitionExecResultMapper extApiDefinitionExecResultMapper;
@Resource
private JMeterService jMeterService;
@ -59,10 +62,10 @@ public class ApiDefinitionService {
public List<ApiDefinitionResult> list(ApiDefinitionRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
List<ApiDefinitionResult> resList = apiDefinitionMapper.list(request);
List<ApiDefinitionResult> resList = extApiDefinitionMapper.list(request);
if (!resList.isEmpty()) {
List<String> ids = resList.stream().map(ApiDefinitionResult::getId).collect(Collectors.toList());
List<ApiComputeResult> results = apiDefinitionMapper.selectByIds(ids);
List<ApiComputeResult> results = extApiDefinitionMapper.selectByIds(ids);
Map<String, ApiComputeResult> resultMap = results.stream().collect(Collectors.toMap(ApiComputeResult::getApiDefinitionId, Function.identity()));
for (ApiDefinitionResult res : resList) {
ApiComputeResult compRes = resultMap.get(res.getId());
@ -121,7 +124,7 @@ public class ApiDefinitionService {
public void delete(String apiId) {
apiTestCaseService.deleteTestCase(apiId);
deleteFileByTestId(apiId);
apiDefinitionExecResultMapper.deleteByResourceId(apiId);
extApiDefinitionExecResultMapper.deleteByResourceId(apiId);
apiDefinitionMapper.deleteByPrimaryKey(apiId);
deleteBodyFiles(apiId);
}
@ -134,7 +137,7 @@ public class ApiDefinitionService {
}
public void removeToGc(List<String> apiIds) {
apiDefinitionMapper.removeToGc(apiIds);
extApiDefinitionMapper.removeToGc(apiIds);
}
public void deleteBodyFiles(String apiId) {
@ -148,12 +151,16 @@ public class ApiDefinitionService {
private void checkNameExist(SaveApiDefinitionRequest request) {
ApiDefinitionExample example = new ApiDefinitionExample();
if (request.getProtocol().equals(RequestType.HTTP)) {
example.createCriteria().andProtocolEqualTo(request.getProtocol()).andPathEqualTo(request.getPath()).andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId());
example.createCriteria().andMethodEqualTo(request.getMethod())
.andProtocolEqualTo(request.getProtocol()).andPathEqualTo(request.getPath())
.andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId());
if (apiDefinitionMapper.countByExample(example) > 0) {
MSException.throwException(Translator.get("api_definition_url_not_repeating"));
}
} else {
example.createCriteria().andProtocolEqualTo(request.getProtocol()).andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId());
example.createCriteria().andProtocolEqualTo(request.getProtocol())
.andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId())
.andIdNotEqualTo(request.getId());
if (apiDefinitionMapper.countByExample(example) > 0) {
MSException.throwException(Translator.get("load_test_already_exists"));
}
@ -163,7 +170,7 @@ public class ApiDefinitionService {
private ApiDefinition updateTest(SaveApiDefinitionRequest request) {
checkNameExist(request);
final ApiDefinition test = new ApiDefinition();
final ApiDefinitionWithBLOBs test = new ApiDefinitionWithBLOBs();
test.setId(request.getId());
test.setName(request.getName());
test.setPath(request.getPath());
@ -186,7 +193,7 @@ public class ApiDefinitionService {
private ApiDefinition createTest(SaveApiDefinitionRequest request) {
checkNameExist(request);
final ApiDefinition test = new ApiDefinition();
final ApiDefinitionWithBLOBs test = new ApiDefinitionWithBLOBs();
test.setId(request.getId());
test.setName(request.getName());
test.setProtocol(request.getProtocol());
@ -219,7 +226,7 @@ public class ApiDefinitionService {
saveReq.setProjectId(request.getProjectId());
saveReq.setPath(request.getPath());
checkNameExist(saveReq);
final ApiDefinition test = new ApiDefinition();
final ApiDefinitionWithBLOBs test = new ApiDefinitionWithBLOBs();
test.setId(request.getId());
test.setName(request.getName());
test.setProtocol(request.getProtocol());
@ -306,7 +313,7 @@ public class ApiDefinitionService {
* @return
*/
public APIReportResult getDbResult(String testId) {
ApiDefinitionExecResult result = apiDefinitionExecResultMapper.selectByResourceId(testId);
ApiDefinitionExecResult result = extApiDefinitionExecResultMapper.selectByResourceId(testId);
if (result == null) {
return null;
}

View File

@ -10,6 +10,7 @@ import io.metersphere.base.domain.ApiModule;
import io.metersphere.base.domain.ApiModuleExample;
import io.metersphere.base.mapper.ApiDefinitionMapper;
import io.metersphere.base.mapper.ApiModuleMapper;
import io.metersphere.base.mapper.ext.ExtApiDefinitionMapper;
import io.metersphere.commons.constants.TestCaseConstants;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.BeanUtils;
@ -33,6 +34,9 @@ public class ApiModuleService {
ApiModuleMapper apiModuleMapper;
@Resource
private ApiDefinitionMapper apiDefinitionMapper;
@Resource
private ExtApiDefinitionMapper extApiDefinitionMapper;
@Resource
SqlSessionFactory sqlSessionFactory;
@ -132,7 +136,7 @@ public class ApiModuleService {
private List<ApiDefinitionResult> queryByModuleIds(List<String> nodeIds) {
ApiDefinitionRequest apiDefinitionRequest = new ApiDefinitionRequest();
apiDefinitionRequest.setModuleIds(nodeIds);
return apiDefinitionMapper.list(apiDefinitionRequest);
return extApiDefinitionMapper.list(apiDefinitionRequest);
}
public int editNode(DragModuleRequest request) {

View File

@ -5,9 +5,10 @@ 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.ApiDefinitionExecResultMapper;
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.commons.exception.MSException;
import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.commons.utils.LogUtil;
@ -36,17 +37,19 @@ public class ApiTestCaseService {
@Resource
private ApiTestCaseMapper apiTestCaseMapper;
@Resource
private ExtApiTestCaseMapper extApiTestCaseMapper;
@Resource
private ApiTestFileMapper apiTestFileMapper;
@Resource
private FileService fileService;
@Resource
private ApiDefinitionExecResultMapper apiDefinitionExecResultMapper;
private ExtApiDefinitionExecResultMapper extApiDefinitionExecResultMapper;
private static final String BODY_FILE_DIR = "/opt/metersphere/data/body";
public List<ApiTestCaseResult> list(ApiTestCaseRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
return apiTestCaseMapper.list(request);
return extApiTestCaseMapper.list(request);
}
public ApiTestCase get(String id) {
@ -99,7 +102,7 @@ public class ApiTestCaseService {
public void delete(String testId) {
deleteFileByTestId(testId);
apiDefinitionExecResultMapper.deleteByResourceId(testId);
extApiDefinitionExecResultMapper.deleteByResourceId(testId);
apiTestCaseMapper.deleteByPrimaryKey(testId);
deleteBodyFiles(testId);
}
@ -151,7 +154,7 @@ public class ApiTestCaseService {
private ApiTestCase updateTest(SaveApiTestCaseRequest request) {
checkNameExist(request);
final ApiTestCase test = new ApiTestCase();
final ApiTestCaseWithBLOBs test = new ApiTestCaseWithBLOBs();
test.setId(request.getId());
test.setName(request.getName());
test.setApiDefinitionId(request.getApiDefinitionId());
@ -169,7 +172,7 @@ public class ApiTestCaseService {
private ApiTestCase createTest(SaveApiTestCaseRequest request) {
request.setId(UUID.randomUUID().toString());
checkNameExist(request);
final ApiTestCase test = new ApiTestCase();
final ApiTestCaseWithBLOBs test = new ApiTestCaseWithBLOBs();
test.setId(request.getId());
test.setName(request.getName());
test.setApiDefinitionId(request.getApiDefinitionId());

View File

@ -14,29 +14,27 @@ public class ApiDefinition implements Serializable {
private String method;
private String path;
private String protocol;
private String environmentId;
private String status;
private String modulePath;
private String description;
private String userId;
private String environmentId;
private String schedule;
private String status;
private String moduleId;
private String modulePath;
private String userId;
private Long createTime;
private Long updateTime;
private String request;
private String protocol;
private String response;
private String path;
private static final long serialVersionUID = 1L;
}

View File

@ -159,11 +159,6 @@ public class ApiDefinitionExample {
return (Criteria) this;
}
public Criteria andModuleIdIn(List<String> values) {
addCriterion("module_id in", values, "module_id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
@ -250,83 +245,212 @@ public class ApiDefinitionExample {
}
public Criteria andNameIsNull() {
addCriterion("name is null");
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andPathEqualTo(String value) {
addCriterion("path =", value, "path");
return (Criteria) this;
}
public Criteria andProtocolEqualTo(String value) {
addCriterion("protocol =", value, "protocol");
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andMethodIsNull() {
addCriterion("`method` is null");
return (Criteria) this;
}
public Criteria andMethodIsNotNull() {
addCriterion("`method` is not null");
return (Criteria) this;
}
public Criteria andMethodEqualTo(String value) {
addCriterion("`method` =", value, "method");
return (Criteria) this;
}
public Criteria andMethodNotEqualTo(String value) {
addCriterion("`method` <>", value, "method");
return (Criteria) this;
}
public Criteria andMethodGreaterThan(String value) {
addCriterion("`method` >", value, "method");
return (Criteria) this;
}
public Criteria andMethodGreaterThanOrEqualTo(String value) {
addCriterion("`method` >=", value, "method");
return (Criteria) this;
}
public Criteria andMethodLessThan(String value) {
addCriterion("`method` <", value, "method");
return (Criteria) this;
}
public Criteria andMethodLessThanOrEqualTo(String value) {
addCriterion("`method` <=", value, "method");
return (Criteria) this;
}
public Criteria andMethodLike(String value) {
addCriterion("`method` like", value, "method");
return (Criteria) this;
}
public Criteria andMethodNotLike(String value) {
addCriterion("`method` not like", value, "method");
return (Criteria) this;
}
public Criteria andMethodIn(List<String> values) {
addCriterion("`method` in", values, "method");
return (Criteria) this;
}
public Criteria andMethodNotIn(List<String> values) {
addCriterion("`method` not in", values, "method");
return (Criteria) this;
}
public Criteria andMethodBetween(String value1, String value2) {
addCriterion("`method` between", value1, value2, "method");
return (Criteria) this;
}
public Criteria andMethodNotBetween(String value1, String value2) {
addCriterion("`method` not between", value1, value2, "method");
return (Criteria) this;
}
public Criteria andModulePathIsNull() {
addCriterion("module_path is null");
return (Criteria) this;
}
public Criteria andModulePathIsNotNull() {
addCriterion("module_path is not null");
return (Criteria) this;
}
public Criteria andModulePathEqualTo(String value) {
addCriterion("module_path =", value, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathNotEqualTo(String value) {
addCriterion("module_path <>", value, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathGreaterThan(String value) {
addCriterion("module_path >", value, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathGreaterThanOrEqualTo(String value) {
addCriterion("module_path >=", value, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathLessThan(String value) {
addCriterion("module_path <", value, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathLessThanOrEqualTo(String value) {
addCriterion("module_path <=", value, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathLike(String value) {
addCriterion("module_path like", value, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathNotLike(String value) {
addCriterion("module_path not like", value, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathIn(List<String> values) {
addCriterion("module_path in", values, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathNotIn(List<String> values) {
addCriterion("module_path not in", values, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathBetween(String value1, String value2) {
addCriterion("module_path between", value1, value2, "modulePath");
return (Criteria) this;
}
public Criteria andModulePathNotBetween(String value1, String value2) {
addCriterion("module_path not between", value1, value2, "modulePath");
return (Criteria) this;
}
@ -400,73 +524,283 @@ public class ApiDefinitionExample {
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 andScheduleIsNull() {
addCriterion("schedule is null");
return (Criteria) this;
}
public Criteria andScheduleIsNotNull() {
addCriterion("schedule is not null");
return (Criteria) this;
}
public Criteria andScheduleEqualTo(String value) {
addCriterion("schedule =", value, "schedule");
return (Criteria) this;
}
public Criteria andScheduleNotEqualTo(String value) {
addCriterion("schedule <>", value, "schedule");
return (Criteria) this;
}
public Criteria andScheduleGreaterThan(String value) {
addCriterion("schedule >", value, "schedule");
return (Criteria) this;
}
public Criteria andScheduleGreaterThanOrEqualTo(String value) {
addCriterion("schedule >=", value, "schedule");
return (Criteria) this;
}
public Criteria andScheduleLessThan(String value) {
addCriterion("schedule <", value, "schedule");
return (Criteria) this;
}
public Criteria andScheduleLessThanOrEqualTo(String value) {
addCriterion("schedule <=", value, "schedule");
return (Criteria) this;
}
public Criteria andScheduleLike(String value) {
addCriterion("schedule like", value, "schedule");
return (Criteria) this;
}
public Criteria andScheduleNotLike(String value) {
addCriterion("schedule not like", value, "schedule");
return (Criteria) this;
}
public Criteria andScheduleIn(List<String> values) {
addCriterion("schedule in", values, "schedule");
return (Criteria) this;
}
public Criteria andScheduleNotIn(List<String> values) {
addCriterion("schedule not in", values, "schedule");
return (Criteria) this;
}
public Criteria andScheduleBetween(String value1, String value2) {
addCriterion("schedule between", value1, value2, "schedule");
return (Criteria) this;
}
public Criteria andScheduleNotBetween(String value1, String value2) {
addCriterion("schedule not between", value1, value2, "schedule");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status");
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status");
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status");
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status");
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status");
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status");
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status");
addCriterion("`status` like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status");
addCriterion("`status` not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status");
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status");
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status");
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status");
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andModuleIdIsNull() {
addCriterion("module_id is null");
return (Criteria) this;
}
public Criteria andModuleIdIsNotNull() {
addCriterion("module_id is not null");
return (Criteria) this;
}
public Criteria andModuleIdEqualTo(String value) {
addCriterion("module_id =", value, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdNotEqualTo(String value) {
addCriterion("module_id <>", value, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdGreaterThan(String value) {
addCriterion("module_id >", value, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdGreaterThanOrEqualTo(String value) {
addCriterion("module_id >=", value, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdLessThan(String value) {
addCriterion("module_id <", value, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdLessThanOrEqualTo(String value) {
addCriterion("module_id <=", value, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdLike(String value) {
addCriterion("module_id like", value, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdNotLike(String value) {
addCriterion("module_id not like", value, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdIn(List<String> values) {
addCriterion("module_id in", values, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdNotIn(List<String> values) {
addCriterion("module_id not in", values, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdBetween(String value1, String value2) {
addCriterion("module_id between", value1, value2, "moduleId");
return (Criteria) this;
}
public Criteria andModuleIdNotBetween(String value1, String value2) {
addCriterion("module_id not between", value1, value2, "moduleId");
return (Criteria) this;
}
@ -659,6 +993,146 @@ public class ApiDefinitionExample {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andProtocolIsNull() {
addCriterion("protocol is null");
return (Criteria) this;
}
public Criteria andProtocolIsNotNull() {
addCriterion("protocol is not null");
return (Criteria) this;
}
public Criteria andProtocolEqualTo(String value) {
addCriterion("protocol =", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotEqualTo(String value) {
addCriterion("protocol <>", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThan(String value) {
addCriterion("protocol >", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThanOrEqualTo(String value) {
addCriterion("protocol >=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThan(String value) {
addCriterion("protocol <", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThanOrEqualTo(String value) {
addCriterion("protocol <=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLike(String value) {
addCriterion("protocol like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotLike(String value) {
addCriterion("protocol not like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolIn(List<String> values) {
addCriterion("protocol in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotIn(List<String> values) {
addCriterion("protocol not in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolBetween(String value1, String value2) {
addCriterion("protocol between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotBetween(String value1, String value2) {
addCriterion("protocol not between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andPathIsNull() {
addCriterion("`path` is null");
return (Criteria) this;
}
public Criteria andPathIsNotNull() {
addCriterion("`path` is not null");
return (Criteria) this;
}
public Criteria andPathEqualTo(String value) {
addCriterion("`path` =", value, "path");
return (Criteria) this;
}
public Criteria andPathNotEqualTo(String value) {
addCriterion("`path` <>", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThan(String value) {
addCriterion("`path` >", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThanOrEqualTo(String value) {
addCriterion("`path` >=", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThan(String value) {
addCriterion("`path` <", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThanOrEqualTo(String value) {
addCriterion("`path` <=", value, "path");
return (Criteria) this;
}
public Criteria andPathLike(String value) {
addCriterion("`path` like", value, "path");
return (Criteria) this;
}
public Criteria andPathNotLike(String value) {
addCriterion("`path` not like", value, "path");
return (Criteria) this;
}
public Criteria andPathIn(List<String> values) {
addCriterion("`path` in", values, "path");
return (Criteria) this;
}
public Criteria andPathNotIn(List<String> values) {
addCriterion("`path` not in", values, "path");
return (Criteria) this;
}
public Criteria andPathBetween(String value1, String value2) {
addCriterion("`path` between", value1, value2, "path");
return (Criteria) this;
}
public Criteria andPathNotBetween(String value1, String value2) {
addCriterion("`path` not between", value1, value2, "path");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -7,12 +7,20 @@ import java.io.Serializable;
@Data
public class ApiDefinitionExecResult implements Serializable {
private String id;
private String resourceId;
private String name;
private String content;
private String resourceId;
private String status;
private String userId;
private Long startTime;
private Long endTime;
}
private String content;
private static final long serialVersionUID = 1L;
}

View File

@ -1,22 +0,0 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class ApiDefinitionHistory implements Serializable {
private String id;
private String apiDefinitionId;
private String content;
private String userId;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}

View File

@ -1,8 +1,7 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
@Data
public class ApiModule implements Serializable {
@ -12,12 +11,12 @@ public class ApiModule implements Serializable {
private String name;
private String protocol;
private String parentId;
private Integer level;
private String protocol;
private Long createTime;
private Long updateTime;

View File

@ -189,12 +189,6 @@ public class ApiModuleExample {
return (Criteria) this;
}
public Criteria andProtocolEqualTo(String value) {
addCriterion("protocol =", value, "protocol");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
@ -251,72 +245,142 @@ public class ApiModuleExample {
}
public Criteria andNameIsNull() {
addCriterion("name is null");
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andProtocolIsNull() {
addCriterion("protocol is null");
return (Criteria) this;
}
public Criteria andProtocolIsNotNull() {
addCriterion("protocol is not null");
return (Criteria) this;
}
public Criteria andProtocolEqualTo(String value) {
addCriterion("protocol =", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotEqualTo(String value) {
addCriterion("protocol <>", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThan(String value) {
addCriterion("protocol >", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThanOrEqualTo(String value) {
addCriterion("protocol >=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThan(String value) {
addCriterion("protocol <", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThanOrEqualTo(String value) {
addCriterion("protocol <=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLike(String value) {
addCriterion("protocol like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotLike(String value) {
addCriterion("protocol not like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolIn(List<String> values) {
addCriterion("protocol in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotIn(List<String> values) {
addCriterion("protocol not in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolBetween(String value1, String value2) {
addCriterion("protocol between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotBetween(String value1, String value2) {
addCriterion("protocol not between", value1, value2, "protocol");
return (Criteria) this;
}
@ -391,62 +455,62 @@ public class ApiModuleExample {
}
public Criteria andLevelIsNull() {
addCriterion("level is null");
addCriterion("`level` is null");
return (Criteria) this;
}
public Criteria andLevelIsNotNull() {
addCriterion("level is not null");
addCriterion("`level` is not null");
return (Criteria) this;
}
public Criteria andLevelEqualTo(Integer value) {
addCriterion("level =", value, "level");
addCriterion("`level` =", value, "level");
return (Criteria) this;
}
public Criteria andLevelNotEqualTo(Integer value) {
addCriterion("level <>", value, "level");
addCriterion("`level` <>", value, "level");
return (Criteria) this;
}
public Criteria andLevelGreaterThan(Integer value) {
addCriterion("level >", value, "level");
addCriterion("`level` >", value, "level");
return (Criteria) this;
}
public Criteria andLevelGreaterThanOrEqualTo(Integer value) {
addCriterion("level >=", value, "level");
addCriterion("`level` >=", value, "level");
return (Criteria) this;
}
public Criteria andLevelLessThan(Integer value) {
addCriterion("level <", value, "level");
addCriterion("`level` <", value, "level");
return (Criteria) this;
}
public Criteria andLevelLessThanOrEqualTo(Integer value) {
addCriterion("level <=", value, "level");
addCriterion("`level` <=", value, "level");
return (Criteria) this;
}
public Criteria andLevelIn(List<Integer> values) {
addCriterion("level in", values, "level");
addCriterion("`level` in", values, "level");
return (Criteria) this;
}
public Criteria andLevelNotIn(List<Integer> values) {
addCriterion("level not in", values, "level");
addCriterion("`level` not in", values, "level");
return (Criteria) this;
}
public Criteria andLevelBetween(Integer value1, Integer value2) {
addCriterion("level between", value1, value2, "level");
addCriterion("`level` between", value1, value2, "level");
return (Criteria) this;
}
public Criteria andLevelNotBetween(Integer value1, Integer value2) {
addCriterion("level not between", value1, value2, "level");
addCriterion("`level` not between", value1, value2, "level");
return (Criteria) this;
}

View File

@ -18,10 +18,6 @@ public class ApiTestCase implements Serializable {
private String description;
private String request;
private String response;
private String createUserId;
private String updateUserId;

View File

@ -159,11 +159,6 @@ public class ApiTestCaseExample {
return (Criteria) this;
}
public Criteria andModuleIdIn(List<String> values) {
addCriterion("module_id in", values, "module_id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
@ -194,12 +189,6 @@ public class ApiTestCaseExample {
return (Criteria) this;
}
public Criteria andApiDefinitionIdEqualTo(String value) {
addCriterion("api_definition_id =", value, "api_definition_id");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
@ -256,72 +245,212 @@ public class ApiTestCaseExample {
}
public Criteria andNameIsNull() {
addCriterion("name is null");
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andPriorityIsNull() {
addCriterion("priority is null");
return (Criteria) this;
}
public Criteria andPriorityIsNotNull() {
addCriterion("priority is not null");
return (Criteria) this;
}
public Criteria andPriorityEqualTo(String value) {
addCriterion("priority =", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityNotEqualTo(String value) {
addCriterion("priority <>", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityGreaterThan(String value) {
addCriterion("priority >", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityGreaterThanOrEqualTo(String value) {
addCriterion("priority >=", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityLessThan(String value) {
addCriterion("priority <", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityLessThanOrEqualTo(String value) {
addCriterion("priority <=", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityLike(String value) {
addCriterion("priority like", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityNotLike(String value) {
addCriterion("priority not like", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityIn(List<String> values) {
addCriterion("priority in", values, "priority");
return (Criteria) this;
}
public Criteria andPriorityNotIn(List<String> values) {
addCriterion("priority not in", values, "priority");
return (Criteria) this;
}
public Criteria andPriorityBetween(String value1, String value2) {
addCriterion("priority between", value1, value2, "priority");
return (Criteria) this;
}
public Criteria andPriorityNotBetween(String value1, String value2) {
addCriterion("priority not between", value1, value2, "priority");
return (Criteria) this;
}
public Criteria andApiDefinitionIdIsNull() {
addCriterion("api_definition_id is null");
return (Criteria) this;
}
public Criteria andApiDefinitionIdIsNotNull() {
addCriterion("api_definition_id is not null");
return (Criteria) this;
}
public Criteria andApiDefinitionIdEqualTo(String value) {
addCriterion("api_definition_id =", value, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdNotEqualTo(String value) {
addCriterion("api_definition_id <>", value, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdGreaterThan(String value) {
addCriterion("api_definition_id >", value, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdGreaterThanOrEqualTo(String value) {
addCriterion("api_definition_id >=", value, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdLessThan(String value) {
addCriterion("api_definition_id <", value, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdLessThanOrEqualTo(String value) {
addCriterion("api_definition_id <=", value, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdLike(String value) {
addCriterion("api_definition_id like", value, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdNotLike(String value) {
addCriterion("api_definition_id not like", value, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdIn(List<String> values) {
addCriterion("api_definition_id in", values, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdNotIn(List<String> values) {
addCriterion("api_definition_id not in", values, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdBetween(String value1, String value2) {
addCriterion("api_definition_id between", value1, value2, "apiDefinitionId");
return (Criteria) this;
}
public Criteria andApiDefinitionIdNotBetween(String value1, String value2) {
addCriterion("api_definition_id not between", value1, value2, "apiDefinitionId");
return (Criteria) this;
}
@ -395,143 +524,143 @@ public class ApiTestCaseExample {
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
public Criteria andCreateUserIdIsNull() {
addCriterion("create_user_id is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
public Criteria andCreateUserIdIsNotNull() {
addCriterion("create_user_id is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status");
public Criteria andCreateUserIdEqualTo(String value) {
addCriterion("create_user_id =", value, "createUserId");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status");
public Criteria andCreateUserIdNotEqualTo(String value) {
addCriterion("create_user_id <>", value, "createUserId");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status");
public Criteria andCreateUserIdGreaterThan(String value) {
addCriterion("create_user_id >", value, "createUserId");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status");
public Criteria andCreateUserIdGreaterThanOrEqualTo(String value) {
addCriterion("create_user_id >=", value, "createUserId");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status");
public Criteria andCreateUserIdLessThan(String value) {
addCriterion("create_user_id <", value, "createUserId");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status");
public Criteria andCreateUserIdLessThanOrEqualTo(String value) {
addCriterion("create_user_id <=", value, "createUserId");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status");
public Criteria andCreateUserIdLike(String value) {
addCriterion("create_user_id like", value, "createUserId");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status");
public Criteria andCreateUserIdNotLike(String value) {
addCriterion("create_user_id not like", value, "createUserId");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status");
public Criteria andCreateUserIdIn(List<String> values) {
addCriterion("create_user_id in", values, "createUserId");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status");
public Criteria andCreateUserIdNotIn(List<String> values) {
addCriterion("create_user_id not in", values, "createUserId");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status");
public Criteria andCreateUserIdBetween(String value1, String value2) {
addCriterion("create_user_id between", value1, value2, "createUserId");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status");
public Criteria andCreateUserIdNotBetween(String value1, String value2) {
addCriterion("create_user_id not between", value1, value2, "createUserId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
public Criteria andUpdateUserIdIsNull() {
addCriterion("update_user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
public Criteria andUpdateUserIdIsNotNull() {
addCriterion("update_user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(String value) {
addCriterion("user_id =", value, "userId");
public Criteria andUpdateUserIdEqualTo(String value) {
addCriterion("update_user_id =", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(String value) {
addCriterion("user_id <>", value, "userId");
public Criteria andUpdateUserIdNotEqualTo(String value) {
addCriterion("update_user_id <>", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(String value) {
addCriterion("user_id >", value, "userId");
public Criteria andUpdateUserIdGreaterThan(String value) {
addCriterion("update_user_id >", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
addCriterion("user_id >=", value, "userId");
public Criteria andUpdateUserIdGreaterThanOrEqualTo(String value) {
addCriterion("update_user_id >=", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(String value) {
addCriterion("user_id <", value, "userId");
public Criteria andUpdateUserIdLessThan(String value) {
addCriterion("update_user_id <", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(String value) {
addCriterion("user_id <=", value, "userId");
public Criteria andUpdateUserIdLessThanOrEqualTo(String value) {
addCriterion("update_user_id <=", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdLike(String value) {
addCriterion("user_id like", value, "userId");
public Criteria andUpdateUserIdLike(String value) {
addCriterion("update_user_id like", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdNotLike(String value) {
addCriterion("user_id not like", value, "userId");
public Criteria andUpdateUserIdNotLike(String value) {
addCriterion("update_user_id not like", value, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<String> values) {
addCriterion("user_id in", values, "userId");
public Criteria andUpdateUserIdIn(List<String> values) {
addCriterion("update_user_id in", values, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<String> values) {
addCriterion("user_id not in", values, "userId");
public Criteria andUpdateUserIdNotIn(List<String> values) {
addCriterion("update_user_id not in", values, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdBetween(String value1, String value2) {
addCriterion("user_id between", value1, value2, "userId");
public Criteria andUpdateUserIdBetween(String value1, String value2) {
addCriterion("update_user_id between", value1, value2, "updateUserId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(String value1, String value2) {
addCriterion("user_id not between", value1, value2, "userId");
public Criteria andUpdateUserIdNotBetween(String value1, String value2) {
addCriterion("update_user_id not between", value1, value2, "updateUserId");
return (Criteria) this;
}

View File

@ -1,8 +1,7 @@
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
@Data
public class MessageTask implements Serializable {

View File

@ -1,15 +1,37 @@
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;
public interface ApiDefinitionExecResultMapper {
long countByExample(ApiDefinitionExecResultExample example);
int deleteByResourceId(String id);
int deleteByExample(ApiDefinitionExecResultExample example);
int deleteByPrimaryKey(String id);
int insert(ApiDefinitionExecResult record);
ApiDefinitionExecResult selectByResourceId(String resourceId);
int insertSelective(ApiDefinitionExecResult record);
List<ApiDefinitionExecResult> selectByExampleWithBLOBs(ApiDefinitionExecResultExample example);
List<ApiDefinitionExecResult> selectByExample(ApiDefinitionExecResultExample example);
ApiDefinitionExecResult selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") ApiDefinitionExecResult record, @Param("example") ApiDefinitionExecResultExample example);
int updateByExampleWithBLOBs(@Param("record") ApiDefinitionExecResult record, @Param("example") ApiDefinitionExecResultExample example);
int updateByExample(@Param("record") ApiDefinitionExecResult record, @Param("example") ApiDefinitionExecResultExample example);
int updateByPrimaryKeySelective(ApiDefinitionExecResult record);
int updateByPrimaryKeyWithBLOBs(ApiDefinitionExecResult record);
int updateByPrimaryKey(ApiDefinitionExecResult record);
}

View File

@ -1,27 +1,304 @@
<?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.ApiDefinitionExecResultMapper">
<delete id="deleteByResourceId" parameterType="java.lang.String">
delete from api_definition_exec_result where resource_id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinitionExecResult">
insert into api_definition_exec_result
(id, resource_id,name,content, status, user_id, start_time, end_time)
values
(#{id,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}, #{status,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
#{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT})
</insert>
<select id="selectByResourceId" parameterType="java.lang.String" resultType="io.metersphere.base.domain.ApiDefinitionExecResult">
select * from api_definition_exec_result
where resource_id = #{resourceId,jdbcType=VARCHAR}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultType="io.metersphere.base.domain.ApiDefinitionExecResult">
select * from api_definition_exec_result
where id = #{id,jdbcType=VARCHAR}
</select>
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiDefinitionExecResult">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="resource_id" jdbcType="VARCHAR" property="resourceId" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="start_time" jdbcType="BIGINT" property="startTime" />
<result column="end_time" jdbcType="BIGINT" property="endTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionExecResult">
<result column="content" jdbcType="LONGVARCHAR" property="content" />
</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, `name`, resource_id, `status`, user_id, start_time, end_time
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinitionExecResultExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from api_definition_exec_result
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExecResultExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from api_definition_exec_result
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from api_definition_exec_result
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from api_definition_exec_result
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExecResultExample">
delete from api_definition_exec_result
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<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)
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})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiDefinitionExecResult">
insert into api_definition_exec_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
`name`,
</if>
<if test="resourceId != null">
resource_id,
</if>
<if test="status != null">
`status`,
</if>
<if test="userId != null">
user_id,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="resourceId != null">
#{resourceId,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
#{startTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
#{endTime,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExecResultExample" resultType="java.lang.Long">
select count(*) from api_definition_exec_result
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update api_definition_exec_result
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.resourceId != null">
resource_id = #{record.resourceId,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.startTime != null">
start_time = #{record.startTime,jdbcType=BIGINT},
</if>
<if test="record.endTime != null">
end_time = #{record.endTime,jdbcType=BIGINT},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update api_definition_exec_result
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
resource_id = #{record.resourceId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
start_time = #{record.startTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update api_definition_exec_result
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
resource_id = #{record.resourceId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
start_time = #{record.startTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiDefinitionExecResult">
update api_definition_exec_result
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="resourceId != null">
resource_id = #{resourceId,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinitionExecResult">
update api_definition_exec_result
set `name` = #{name,jdbcType=VARCHAR},
resource_id = #{resourceId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiDefinitionExecResult">
update api_definition_exec_result
set `name` = #{name,jdbcType=VARCHAR},
resource_id = #{resourceId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -1,15 +0,0 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.ApiDefinitionHistory;
import java.util.List;
public interface ApiDefinitionHistoryMapper {
int deleteByApiDefinitionId(String id);
int insert(ApiDefinitionHistory record);
List<ApiDefinitionHistory> selectByApiDefinitionId(String id);
}

View File

@ -1,21 +0,0 @@
<?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.ApiDefinitionHistoryMapper">
<delete id="deleteByApiDefinitionId" parameterType="java.lang.String">
delete from api_definition_history where api_definition_id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinitionHistory">
insert into api_definition_history
(id, api_definition_id,content, user_id, create_time, update_time)
values
(#{id,jdbcType=VARCHAR}, #{apiDefinitionId,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT})
</insert>
<select id="selectByApiDefinitionId" parameterType="java.lang.String" resultType="io.metersphere.base.domain.ApiDefinitionHistory">
select * from api_definition_history where api_definition_id = #{id,jdbcType=VARCHAR}
</select>
</mapper>

View File

@ -1,42 +1,38 @@
package io.metersphere.base.mapper;
import io.metersphere.api.dto.definition.ApiComputeResult;
import io.metersphere.api.dto.definition.ApiDefinitionRequest;
import io.metersphere.api.dto.definition.ApiDefinitionResult;
import io.metersphere.base.domain.ApiDefinition;
import io.metersphere.base.domain.ApiDefinitionExample;
import io.metersphere.base.domain.ApiDefinitionWithBLOBs;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApiDefinitionMapper {
List<ApiDefinitionResult> list(@Param("request") ApiDefinitionRequest request);
List<ApiComputeResult> selectByIds(@Param("ids") List<String> ids);
long countByExample(ApiDefinitionExample example);
int deleteByExample(ApiDefinitionExample example);
int deleteByPrimaryKey(String id);
int insert(ApiDefinition record);
int insert(ApiDefinitionWithBLOBs record);
int insertSelective(ApiDefinitionWithBLOBs record);
List<ApiDefinition> selectByExampleWithBLOBs(ApiDefinitionExample example);
List<ApiDefinitionWithBLOBs> selectByExampleWithBLOBs(ApiDefinitionExample example);
List<ApiDefinition> selectByExample(ApiDefinitionExample example);
ApiDefinition selectByPrimaryKey(String id);
ApiDefinitionWithBLOBs selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") ApiDefinitionWithBLOBs record, @Param("example") ApiDefinitionExample example);
int updateByPrimaryKeySelective(ApiDefinition record);
int updateByExampleWithBLOBs(@Param("record") ApiDefinitionWithBLOBs record, @Param("example") ApiDefinitionExample example);
int updateByPrimaryKeyWithBLOBs(ApiDefinition record);
int updateByExample(@Param("record") ApiDefinition record, @Param("example") ApiDefinitionExample example);
int updateByPrimaryKeySelective(ApiDefinitionWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(ApiDefinitionWithBLOBs record);
int updateByPrimaryKey(ApiDefinition record);
int removeToGc(@Param("ids") List<String> ids);
}

View File

@ -1,417 +1,462 @@
<?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.ApiDefinitionMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiDefinition">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="project_id" jdbcType="VARCHAR" property="projectId"/>
<result column="module_id" jdbcType="VARCHAR" property="moduleId"/>
<result column="module_path" jdbcType="VARCHAR" property="modulePath"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="protocol" jdbcType="VARCHAR" property="protocol"/>
<result column="path" jdbcType="VARCHAR" property="path"/>
<result column="method" jdbcType="VARCHAR" property="method"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinition">
<result column="request" jdbcType="LONGVARCHAR" property="request"/>
<result column="response" jdbcType="LONGVARCHAR" property="response"/>
</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>
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiDefinition">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="module_path" jdbcType="VARCHAR" property="modulePath" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="environment_id" jdbcType="VARCHAR" property="environmentId" />
<result column="schedule" jdbcType="VARCHAR" property="schedule" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="module_id" jdbcType="VARCHAR" property="moduleId" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
<result column="path" jdbcType="VARCHAR" property="path" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
<result column="request" jdbcType="LONGVARCHAR" property="request" />
<result column="response" jdbcType="LONGVARCHAR" property="response" />
</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>
</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, project_id, name,module_id,module_path,protocol ,path,method ,description, status, user_id, create_time, update_time
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Blob_Column_List">
request
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinitionExample"
resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from api_definition
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByIds" resultType="io.metersphere.api.dto.definition.ApiComputeResult">
select t1.api_definition_id apiDefinitionId,count(t1.id) caseTotal,
case t2.status
when 'success' then '通过'
when 'error' then '未通过'
ELSE '未执行' end as status ,
CONCAT(FORMAT(SUM(IF(t2.`status` = 'success', 1, 0))/ COUNT(t1.id)*100, 2), '%') passRate
from api_test_case t1 left join api_definition_exec_result t2 on t1.id = t2.resource_id
group by t1.api_definition_id having t1.api_definition_id in
<foreach collection="ids" item="v" separator="," open="(" close=")">
#{v}
</foreach>
order by t2.end_time desc;
</select>
<sql id="combine">
<if test='${condition}.name != null and (${name} == null or ${name} == "")'>
and api_definition.name
<include refid="condition">
<property name="object" value="${condition}.name"/>
</include>
</if>
<if test="${condition}.updateTime != null">
and api_definition.update_time
<include refid="condition">
<property name="object" value="${condition}.updateTime"/>
</include>
</if>
<if test="${condition}.projectName != null">
and project.name
<include refid="condition">
<property name="object" value="${condition}.projectName"/>
</include>
</if>
<if test="${condition}.createTime != null">
and api_definition.create_time
<include refid="condition">
<property name="object" value="${condition}.createTime"/>
</include>
</if>
<if test="${condition}.status != null">
and api_definition.status
<include refid="condition">
<property name="object" value="${condition}.status"/>
</include>
</if>
<if test="${condition}.creator != null">
and api_definition.user_id
<include refid="condition">
<property name="object" value="${condition}.creator"/>
</include>
</if>
</sql>
<sql id="condition">
<choose>
<when test='${object}.operator == "like"'>
like CONCAT('%', #{${object}.value},'%')
</when>
<when test='${object}.operator == "not like"'>
not like CONCAT('%', #{${object}.value},'%')
</when>
<when test='${object}.operator == "in"'>
in
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</when>
<when test='${object}.operator == "not in"'>
not in
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</when>
<when test='${object}.operator == "between"'>
between #{${object}.value[0]} and #{${object}.value[1]}
</when>
<when test='${object}.operator == "gt"'>
&gt; #{${object}.value}
</when>
<when test='${object}.operator == "lt"'>
&lt; #{${object}.value}
</when>
<when test='${object}.operator == "ge"'>
&gt;= #{${object}.value}
</when>
<when test='${object}.operator == "le"'>
&lt;= #{${object}.value}
</when>
<when test='${object}.operator == "current user"'>
= '${@io.metersphere.commons.utils.SessionUtils@getUserId()}'
</when>
<otherwise>
= #{${object}.value}
</otherwise>
</choose>
</sql>
<select id="list" resultType="io.metersphere.api.dto.definition.ApiDefinitionResult">
select api_definition.id, api_definition.project_id,
api_definition.name,api_definition.protocol,api_definition.path,api_definition.module_id,api_definition.module_path,api_definition.method,
api_definition.description,api_definition.request,api_definition.response,api_definition.environment_id,
api_definition.status, api_definition.user_id, api_definition.create_time, api_definition.update_time, project.name as
project_name, user.name as user_name
from api_definition
left join project on api_definition.project_id = project.id
left join user on api_definition.user_id = user.id
<where>
<if test="request.combine != null">
<include refid="combine">
<property name="condition" value="request.combine"/>
<property name="name" value="request.name"/>
</include>
</if>
<if test="request.name != null">
and api_definition.name like CONCAT('%', #{request.name},'%')
</if>
<if test="request.protocol != null">
AND api_definition.protocol = #{request.protocol}
</if>
<if test="request.workspaceId != null">
AND project.workspace_id = #{request.workspaceId}
</if>
<if test="request.projectId != null">
AND project.id = #{request.projectId}
</if>
<if test="request.id != null">
AND api_definition.id = #{request.id}
</if>
<if test="request.userId != null">
AND api_definition.user_id = #{request.userId}
</if>
<if test="request.moduleId != null">
AND api_definition.module_id = #{request.moduleId}
</if>
<if test="request.projectId != null">
AND api_definition.project_id = #{request.projectId}
</if>
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
AND api_definition.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">
and api_definition.status in
<foreach collection="request.filters" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</if>
</where>
<if test="request.orders != null and request.orders.size() > 0">
order by
<foreach collection="request.orders" separator="," item="order">
api_definition.${order.name} ${order.type}
<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>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from api_definition
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from api_definition
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, `name`, `method`, module_path, description, environment_id, schedule,
`status`, module_id, user_id, create_time, update_time, protocol, `path`
</sql>
<sql id="Blob_Column_List">
request, response
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinitionExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from api_definition
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from api_definition
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from api_definition
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from api_definition
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExample">
delete from api_definition
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinition">
insert into api_definition (id, project_id, name, protocol,path,module_id,module_path,method,
description, status, user_id,create_time, update_time, request,response,environment_id )
values
(#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR},#{path,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR},#{modulePath,jdbcType=VARCHAR},#{method,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{request,jdbcType=LONGVARCHAR},#{response,jdbcType=LONGVARCHAR},#{environmentId,jdbcType=VARCHAR}
)
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExample"
resultType="java.lang.Long">
select count(*) from api_definition
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiDefinition">
update api_definition
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="moduleId != null">
module_id = #{moduleId,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
path = #{path,jdbcType=VARCHAR},
</if>
<if test="method != null">
method = #{method,jdbcType=VARCHAR},
</if>
<if test="modulePath != null">
module_path = #{modulePath,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="request != null">
request = #{request,jdbcType=LONGVARCHAR},
</if>
<if test="response != null">
response = #{response,jdbcType=LONGVARCHAR},
</if>
<if test="environmentId != null">
environment_id = #{environmentId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinition">
update api_definition
set project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
module_id = #{moduleId,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
path = #{path,jdbcType=VARCHAR},
method = #{method,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
request = #{request,jdbcType=LONGVARCHAR},
response = #{response,jdbcType=LONGVARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExample">
delete from api_definition
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
insert into api_definition (id, project_id, `name`,
`method`, module_path, description,
environment_id, schedule, `status`,
module_id, user_id, create_time,
update_time, protocol, `path`,
request, response)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{method,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{environmentId,jdbcType=VARCHAR}, #{schedule,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{moduleId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{protocol,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR},
#{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
insert into api_definition
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="method != null">
`method`,
</if>
<if test="modulePath != null">
module_path,
</if>
<if test="description != null">
description,
</if>
<if test="environmentId != null">
environment_id,
</if>
<if test="schedule != null">
schedule,
</if>
<if test="status != null">
`status`,
</if>
<if test="moduleId != null">
module_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="protocol != null">
protocol,
</if>
<if test="path != null">
`path`,
</if>
<if test="request != null">
request,
</if>
<if test="response != null">
response,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="method != null">
#{method,jdbcType=VARCHAR},
</if>
<if test="modulePath != null">
#{modulePath,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="environmentId != null">
#{environmentId,jdbcType=VARCHAR},
</if>
<if test="schedule != null">
#{schedule,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="moduleId != null">
#{moduleId,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="protocol != null">
#{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
#{path,jdbcType=VARCHAR},
</if>
<if test="request != null">
#{request,jdbcType=LONGVARCHAR},
</if>
<if test="response != null">
#{response,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExample" resultType="java.lang.Long">
select count(*) from api_definition
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update api_definition
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.method != null">
`method` = #{record.method,jdbcType=VARCHAR},
</if>
<if test="record.modulePath != null">
module_path = #{record.modulePath,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.environmentId != null">
environment_id = #{record.environmentId,jdbcType=VARCHAR},
</if>
<if test="record.schedule != null">
schedule = #{record.schedule,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.moduleId != null">
module_id = #{record.moduleId,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,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>
<if test="record.protocol != null">
protocol = #{record.protocol,jdbcType=VARCHAR},
</if>
<if test="record.path != null">
`path` = #{record.path,jdbcType=VARCHAR},
</if>
<if test="record.request != null">
request = #{record.request,jdbcType=LONGVARCHAR},
</if>
<if test="record.response != null">
response = #{record.response,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiDefinition">
update api_definition
set project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
module_id = #{moduleId,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
path = #{path,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
method = #{method,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
<update id="updateByExampleWithBLOBs" parameterType="map">
update api_definition
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`method` = #{record.method,jdbcType=VARCHAR},
module_path = #{record.modulePath,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
environment_id = #{record.environmentId,jdbcType=VARCHAR},
schedule = #{record.schedule,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
module_id = #{record.moduleId,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR},
request = #{record.request,jdbcType=LONGVARCHAR},
response = #{record.response,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update api_definition
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`method` = #{record.method,jdbcType=VARCHAR},
module_path = #{record.modulePath,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
environment_id = #{record.environmentId,jdbcType=VARCHAR},
schedule = #{record.schedule,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
module_id = #{record.moduleId,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
update api_definition
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="method != null">
`method` = #{method,jdbcType=VARCHAR},
</if>
<if test="modulePath != null">
module_path = #{modulePath,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="environmentId != null">
environment_id = #{environmentId,jdbcType=VARCHAR},
</if>
<if test="schedule != null">
schedule = #{schedule,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="moduleId != null">
module_id = #{moduleId,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="protocol != null">
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
`path` = #{path,jdbcType=VARCHAR},
</if>
<if test="request != null">
request = #{request,jdbcType=LONGVARCHAR},
</if>
<if test="response != null">
response = #{response,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
update api_definition
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR},
schedule = #{schedule,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
module_id = #{moduleId,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR},
request = #{request,jdbcType=LONGVARCHAR},
response = #{response,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiDefinition">
update api_definition
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR},
schedule = #{schedule,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
module_id = #{moduleId,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="removeToGc">
update api_definition
set
status = 'Trash'
where id in
<foreach collection="ids" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</update>
</mapper>

View File

@ -7,7 +7,6 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApiModuleMapper {
long countByExample(ApiModuleExample example);
int deleteByExample(ApiModuleExample example);
@ -16,8 +15,6 @@ public interface ApiModuleMapper {
int insert(ApiModule record);
int insertBatch(@Param("records") List<ApiModule> records);
int insertSelective(ApiModule record);
List<ApiModule> selectByExample(ApiModuleExample example);

View File

@ -1,273 +1,258 @@
<?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.ApiModuleMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiModule">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="project_id" jdbcType="VARCHAR" property="projectId"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="parent_id" jdbcType="VARCHAR" property="parentId"/>
<result column="level" jdbcType="INTEGER" property="level"/>
<result column="protocol" jdbcType="VARCHAR" property="protocol"/>
<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>
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiModule">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="level" jdbcType="INTEGER" property="level" />
<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>
</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, project_id, name, parent_id, level, create_time, update_time
</trim>
</if>
</foreach>
</where>
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseNodeExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
<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>
<include refid="Base_Column_List"/>
from api_module
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from api_module
where id = #{id,jdbcType=VARCHAR}
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, `name`, protocol, parent_id, `level`, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ApiModuleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from api_module
<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 api_module
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from api_module
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestCaseNodeExample">
delete from api_module
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insertBatch" parameterType="io.metersphere.base.domain.ApiModule">
insert into api_module (id, project_id, name,protocol
parent_id, level, create_time,
update_time)
values
<foreach collection="records" item="emp" separator=",">
(#{emp.id,jdbcType=VARCHAR}, #{emp.projectId,jdbcType=VARCHAR},
#{emp.name,jdbcType=VARCHAR},#{emp.protocol,jdbcType=VARCHAR},
#{emp.parentId,jdbcType=VARCHAR}, #{emp.level,jdbcType=INTEGER}, #{emp.createTime,jdbcType=BIGINT},
#{emp.updateTime,jdbcType=BIGINT})
</foreach>
</insert>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiModule">
insert into api_module (id, project_id, name,protocol
parent_id, level, create_time,
update_time)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},#{protocol,jdbcType=VARCHAR},
#{parentId,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiModuleExample">
delete from api_module
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiModule">
insert into api_module (id, project_id, `name`,
protocol, parent_id, `level`,
create_time, update_time)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{protocol,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiModule">
insert into api_module
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
name,
</if>
<if test="protocol != null">
protocol,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="level != null">
level,
</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="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
#{protocol,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=VARCHAR},
</if>
<if test="level != null">
#{level,jdbcType=INTEGER},
</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.TestCaseNodeExample"
resultType="java.lang.Long">
select count(*) from api_module
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update api_module
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.protocol != null">
protocol = #{record.protocol,jdbcType=VARCHAR},
</if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=VARCHAR},
</if>
<if test="record.level != null">
level = #{record.level,jdbcType=INTEGER},
</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 api_module
set id = #{record.id,jdbcType=VARCHAR},
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiModule">
insert into api_module
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="protocol != null">
protocol,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="level != null">
`level`,
</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="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
#{protocol,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=VARCHAR},
</if>
<if test="level != null">
#{level,jdbcType=INTEGER},
</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.ApiModuleExample" resultType="java.lang.Long">
select count(*) from api_module
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update api_module
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.protocol != null">
protocol = #{record.protocol,jdbcType=VARCHAR},
</if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=VARCHAR},
level = #{record.level,jdbcType=INTEGER},
</if>
<if test="record.level != null">
`level` = #{record.level,jdbcType=INTEGER},
</if>
<if test="record.createTime != null">
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.ApiModule">
update api_module
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=VARCHAR},
</if>
<if test="level != null">
level = #{level,jdbcType=INTEGER},
</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.ApiModule">
update api_module
set project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=VARCHAR},
level = #{level,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</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 api_module
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
protocol = #{record.protocol,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=VARCHAR},
`level` = #{record.level,jdbcType=INTEGER},
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.ApiModule">
update api_module
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=VARCHAR},
</if>
<if test="level != null">
`level` = #{level,jdbcType=INTEGER},
</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.ApiModule">
update api_module
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=VARCHAR},
`level` = #{level,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -1,32 +1,38 @@
package io.metersphere.base.mapper;
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.ApiTestCaseResult;
import io.metersphere.base.domain.ApiTestCase;
import io.metersphere.base.domain.ApiTestCaseExample;
import io.metersphere.base.domain.ApiTestCaseWithBLOBs;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApiTestCaseMapper {
List<ApiTestCaseResult> list(@Param("request") ApiTestCaseRequest request);
long countByExample(ApiTestCaseExample example);
int deleteByExample(ApiTestCaseExample example);
int deleteByPrimaryKey(String id);
int insert(ApiTestCase record);
int insert(ApiTestCaseWithBLOBs record);
List<ApiTestCase> selectByExampleWithBLOBs(ApiTestCaseExample example);
int insertSelective(ApiTestCaseWithBLOBs record);
List<ApiTestCaseWithBLOBs> selectByExampleWithBLOBs(ApiTestCaseExample example);
List<ApiTestCase> selectByExample(ApiTestCaseExample example);
ApiTestCase selectByPrimaryKey(String id);
ApiTestCaseWithBLOBs selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(ApiTestCase record);
int updateByExampleSelective(@Param("record") ApiTestCaseWithBLOBs record, @Param("example") ApiTestCaseExample example);
int updateByExampleWithBLOBs(@Param("record") ApiTestCaseWithBLOBs record, @Param("example") ApiTestCaseExample example);
int updateByExample(@Param("record") ApiTestCase record, @Param("example") ApiTestCaseExample example);
int updateByPrimaryKeySelective(ApiTestCaseWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(ApiTestCaseWithBLOBs record);
int updateByPrimaryKey(ApiTestCase record);
}

View File

@ -1,281 +1,375 @@
<?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.ApiTestCaseMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiTestCase">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="project_id" jdbcType="VARCHAR" property="projectId"/>
<result column="api_definition_id" jdbcType="VARCHAR" property="apiDefinitionId"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="priority" jdbcType="VARCHAR" property="priority"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiTestCase">
<result column="request" jdbcType="LONGVARCHAR" property="request"/>
<result column="response" jdbcType="LONGVARCHAR" property="response"/>
</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>
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiTestCase">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="priority" jdbcType="VARCHAR" property="priority" />
<result column="api_definition_id" jdbcType="VARCHAR" property="apiDefinitionId" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiTestCaseWithBLOBs">
<result column="request" jdbcType="LONGVARCHAR" property="request" />
<result column="response" jdbcType="LONGVARCHAR" property="response" />
</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>
</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, project_id, name,api_definition_id,priority,description, create_user_id, update_user_id, create_time, update_time
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Blob_Column_List">
request
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiTestCaseExample"
resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from api_test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<sql id="condition">
<choose>
<when test='${object}.operator == "like"'>
like CONCAT('%', #{${object}.value},'%')
</when>
<when test='${object}.operator == "not like"'>
not like CONCAT('%', #{${object}.value},'%')
</when>
<when test='${object}.operator == "in"'>
in
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</when>
<when test='${object}.operator == "not in"'>
not in
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</when>
<when test='${object}.operator == "between"'>
between #{${object}.value[0]} and #{${object}.value[1]}
</when>
<when test='${object}.operator == "gt"'>
&gt; #{${object}.value}
</when>
<when test='${object}.operator == "lt"'>
&lt; #{${object}.value}
</when>
<when test='${object}.operator == "ge"'>
&gt;= #{${object}.value}
</when>
<when test='${object}.operator == "le"'>
&lt;= #{${object}.value}
</when>
<when test='${object}.operator == "current user"'>
= '${@io.metersphere.commons.utils.SessionUtils@getUserId()}'
</when>
<otherwise>
= #{${object}.value}
</otherwise>
</choose>
</sql>
<select id="list" resultType="io.metersphere.api.dto.definition.ApiTestCaseResult">
select atc.id, atc.project_id,
atc.name,atc.priority,atc.api_definition_id,T1.name as createUser ,T2.name as updateUser,
atc.description,atc.request,atc.response,atc.create_user_id,
atc.create_time,atc.update_user_id, atc.update_time,ader.status execResult
from api_test_case atc left join user T1 on atc.create_user_id = T1.id left join user T2 on
atc.update_user_id = T2.id left join api_definition_exec_result ader on atc.id = ader.resource_id
<where>
<if test="request.name != null and request.name!=''">
and atc.name like CONCAT('%', #{request.name},'%')
</if>
<if test="request.id != null and request.id!=''">
AND atc.id = #{request.id}
</if>
<if test="request.priority != null and request.priority!=''">
AND atc.priority = #{request.priority}
</if>
<if test="request.projectId != null and request.projectId!=''">
AND atc.project_id = #{request.projectId}
</if>
<if test="request.apiDefinitionId != null and request.apiDefinitionId!=''">
AND atc.api_definition_id = #{request.apiDefinitionId}
</if>
</where>
<if test="request.orders != null and request.orders.size() > 0">
order by
<foreach collection="request.orders" separator="," item="order">
atc.${order.name} ${order.type}
<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>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ApiTestCaseExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from api_test_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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from api_test_case
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from api_test_case where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiTestCaseExample">
delete from api_test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiTestCase">
insert into api_test_case (id, project_id, name, priority,api_definition_id,description, create_user_id, update_user_id,
create_time, update_time, request,response
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, `name`, priority, api_definition_id, description, create_user_id,
update_user_id, create_time, update_time
</sql>
<sql id="Blob_Column_List">
request, response
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiTestCaseExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from api_test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ApiTestCaseExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from api_test_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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from api_test_case
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from api_test_case
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiTestCaseExample">
delete from api_test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiTestCaseWithBLOBs">
insert into api_test_case (id, project_id, `name`,
priority, api_definition_id, description,
create_user_id, update_user_id, create_time,
update_time, request, response
)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{priority,jdbcType=VARCHAR}, #{apiDefinitionId,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{createUserId,jdbcType=VARCHAR}, #{updateUserId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR}
)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR}, #{apiDefinitionId,jdbcType=VARCHAR},#{description,jdbcType=VARCHAR},
#{createUserId,jdbcType=VARCHAR}, #{updateUserId,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR})
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiTestCaseExample"
resultType="java.lang.Long">
select count(*) from api_test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiTestCase">
update api_test_case
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="apiDefinitionId != null">
api_definition_id = #{apiDefinitionId,jdbcType=BIGINT},
</if>
<if test="priority != null">
priority = #{priority,jdbcType=LONGVARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="request != null">
request = #{request,jdbcType=LONGVARCHAR},
</if>
<if test="response != null">
response = #{response,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiTestCase">
update api_test_case
set project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
api_definition_id = #{apiDefinitionId,jdbcType=VARCHAR},
priority = #{priority,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
update_user_id = #{updateUserId,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiTestCaseWithBLOBs">
insert into api_test_case
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="priority != null">
priority,
</if>
<if test="apiDefinitionId != null">
api_definition_id,
</if>
<if test="description != null">
description,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="updateUserId != null">
update_user_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="request != null">
request,
</if>
<if test="response != null">
response,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="priority != null">
#{priority,jdbcType=VARCHAR},
</if>
<if test="apiDefinitionId != null">
#{apiDefinitionId,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="createUserId != null">
#{createUserId,jdbcType=VARCHAR},
</if>
<if test="updateUserId != null">
#{updateUserId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="request != null">
#{request,jdbcType=LONGVARCHAR},
</if>
<if test="response != null">
#{response,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiTestCaseExample" resultType="java.lang.Long">
select count(*) from api_test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update api_test_case
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.priority != null">
priority = #{record.priority,jdbcType=VARCHAR},
</if>
<if test="record.apiDefinitionId != null">
api_definition_id = #{record.apiDefinitionId,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.createUserId != null">
create_user_id = #{record.createUserId,jdbcType=VARCHAR},
</if>
<if test="record.updateUserId != null">
update_user_id = #{record.updateUserId,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>
<if test="record.request != null">
request = #{record.request,jdbcType=LONGVARCHAR},
</if>
<if test="record.response != null">
response = #{record.response,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update api_test_case
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
priority = #{record.priority,jdbcType=VARCHAR},
api_definition_id = #{record.apiDefinitionId,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
create_user_id = #{record.createUserId,jdbcType=VARCHAR},
update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
request = #{record.request,jdbcType=LONGVARCHAR},
response = #{record.response,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update api_test_case
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
priority = #{record.priority,jdbcType=VARCHAR},
api_definition_id = #{record.apiDefinitionId,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
create_user_id = #{record.createUserId,jdbcType=VARCHAR},
update_user_id = #{record.updateUserId,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.ApiTestCaseWithBLOBs">
update api_test_case
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="priority != null">
priority = #{priority,jdbcType=VARCHAR},
</if>
<if test="apiDefinitionId != null">
api_definition_id = #{apiDefinitionId,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="createUserId != null">
create_user_id = #{createUserId,jdbcType=VARCHAR},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="request != null">
request = #{request,jdbcType=LONGVARCHAR},
</if>
<if test="response != null">
response = #{response,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiTestCaseWithBLOBs">
update api_test_case
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
priority = #{priority,jdbcType=VARCHAR},
api_definition_id = #{apiDefinitionId,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
create_user_id = #{createUserId,jdbcType=VARCHAR},
update_user_id = #{updateUserId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
request = #{request,jdbcType=LONGVARCHAR},
response = #{response,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiTestCase">
update api_test_case
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
priority = #{priority,jdbcType=VARCHAR},
api_definition_id = #{apiDefinitionId,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
create_user_id = #{createUserId,jdbcType=VARCHAR},
update_user_id = #{updateUserId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,12 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.ApiDefinitionExecResult;
public interface ExtApiDefinitionExecResultMapper {
void deleteByResourceId(String id);
ApiDefinitionExecResult selectByResourceId(String resourceId);
}

View File

@ -0,0 +1,12 @@
<?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.ExtApiDefinitionExecResultMapper">
<delete id="deleteByResourceId" parameterType="java.lang.String">
delete from api_definition_exec_result where resource_id = #{id,jdbcType=VARCHAR}
</delete>
<select id="selectByResourceId" parameterType="java.lang.String" resultType="io.metersphere.base.domain.ApiDefinitionExecResult">
select * from api_definition_exec_result
where resource_id = #{resourceId,jdbcType=VARCHAR}
</select>
</mapper>

View File

@ -0,0 +1,18 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.definition.ApiComputeResult;
import io.metersphere.api.dto.definition.ApiDefinitionRequest;
import io.metersphere.api.dto.definition.ApiDefinitionResult;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtApiDefinitionMapper {
List<ApiDefinitionResult> list(@Param("request") ApiDefinitionRequest request);
List<ApiComputeResult> selectByIds(@Param("ids") List<String> ids);
int removeToGc(@Param("ids") List<String> ids);
}

View File

@ -0,0 +1,258 @@
<?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.ExtApiDefinitionMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiDefinition">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="project_id" jdbcType="VARCHAR" property="projectId"/>
<result column="module_id" jdbcType="VARCHAR" property="moduleId"/>
<result column="module_path" jdbcType="VARCHAR" property="modulePath"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="protocol" jdbcType="VARCHAR" property="protocol"/>
<result column="path" jdbcType="VARCHAR" property="path"/>
<result column="method" jdbcType="VARCHAR" property="method"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
<result column="request" jdbcType="LONGVARCHAR" property="request"/>
<result column="response" jdbcType="LONGVARCHAR" property="response"/>
</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, project_id, name,module_id,module_path,protocol ,path,method ,description, status, user_id, create_time, update_time
</sql>
<sql id="Blob_Column_List">
request
</sql>
<select id="selectByIds" resultType="io.metersphere.api.dto.definition.ApiComputeResult">
select t1.api_definition_id apiDefinitionId,count(t1.id) caseTotal,
case t2.status
when 'success' then '通过'
when 'error' then '未通过'
ELSE '未执行' end as status ,
CONCAT(FORMAT(SUM(IF(t2.`status` = 'success', 1, 0))/ COUNT(t1.id)*100, 2), '%') passRate
from api_test_case t1 left join api_definition_exec_result t2 on t1.id = t2.resource_id
group by t1.api_definition_id having t1.api_definition_id in
<foreach collection="ids" item="v" separator="," open="(" close=")">
#{v}
</foreach>
order by t2.end_time desc;
</select>
<sql id="combine">
<if test='${condition}.name != null and (${name} == null or ${name} == "")'>
and api_definition.name
<include refid="condition">
<property name="object" value="${condition}.name"/>
</include>
</if>
<if test="${condition}.updateTime != null">
and api_definition.update_time
<include refid="condition">
<property name="object" value="${condition}.updateTime"/>
</include>
</if>
<if test="${condition}.projectName != null">
and project.name
<include refid="condition">
<property name="object" value="${condition}.projectName"/>
</include>
</if>
<if test="${condition}.createTime != null">
and api_definition.create_time
<include refid="condition">
<property name="object" value="${condition}.createTime"/>
</include>
</if>
<if test="${condition}.status != null">
and api_definition.status
<include refid="condition">
<property name="object" value="${condition}.status"/>
</include>
</if>
<if test="${condition}.creator != null">
and api_definition.user_id
<include refid="condition">
<property name="object" value="${condition}.creator"/>
</include>
</if>
</sql>
<sql id="condition">
<choose>
<when test='${object}.operator == "like"'>
like CONCAT('%', #{${object}.value},'%')
</when>
<when test='${object}.operator == "not like"'>
not like CONCAT('%', #{${object}.value},'%')
</when>
<when test='${object}.operator == "in"'>
in
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</when>
<when test='${object}.operator == "not in"'>
not in
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</when>
<when test='${object}.operator == "between"'>
between #{${object}.value[0]} and #{${object}.value[1]}
</when>
<when test='${object}.operator == "gt"'>
&gt; #{${object}.value}
</when>
<when test='${object}.operator == "lt"'>
&lt; #{${object}.value}
</when>
<when test='${object}.operator == "ge"'>
&gt;= #{${object}.value}
</when>
<when test='${object}.operator == "le"'>
&lt;= #{${object}.value}
</when>
<when test='${object}.operator == "current user"'>
= '${@io.metersphere.commons.utils.SessionUtils@getUserId()}'
</when>
<otherwise>
= #{${object}.value}
</otherwise>
</choose>
</sql>
<select id="list" resultType="io.metersphere.api.dto.definition.ApiDefinitionResult">
select api_definition.id, api_definition.project_id,
api_definition.name,api_definition.protocol,api_definition.path,api_definition.module_id,api_definition.module_path,api_definition.method,
api_definition.description,api_definition.request,api_definition.response,api_definition.environment_id,
api_definition.status, api_definition.user_id, api_definition.create_time, api_definition.update_time, project.name as
project_name, user.name as user_name
from api_definition
left join project on api_definition.project_id = project.id
left join user on api_definition.user_id = user.id
<where>
<if test="request.combine != null">
<include refid="combine">
<property name="condition" value="request.combine"/>
<property name="name" value="request.name"/>
</include>
</if>
<if test="request.name != null">
and api_definition.name like CONCAT('%', #{request.name},'%')
</if>
<if test="request.protocol != null">
AND api_definition.protocol = #{request.protocol}
</if>
<if test="request.workspaceId != null">
AND project.workspace_id = #{request.workspaceId}
</if>
<if test="request.projectId != null">
AND project.id = #{request.projectId}
</if>
<if test="request.id != null">
AND api_definition.id = #{request.id}
</if>
<if test="request.userId != null">
AND api_definition.user_id = #{request.userId}
</if>
<if test="request.moduleId != null">
AND api_definition.module_id = #{request.moduleId}
</if>
<if test="request.projectId != null">
AND api_definition.project_id = #{request.projectId}
</if>
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
AND api_definition.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">
and api_definition.status in
<foreach collection="request.filters" item="value" separator="," open="(" close=")">
#{value}
</foreach>
</if>
</where>
<if test="request.orders != null and request.orders.size() > 0">
order by
<foreach collection="request.orders" separator="," item="order">
api_definition.${order.name} ${order.type}
</foreach>
</if>
</select>
<update id="removeToGc">
update api_definition
set
status = 'Trash'
where id in
<foreach collection="ids" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</update>
</mapper>

View File

@ -0,0 +1,10 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.ApiModule;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtApiModuleMapper {
int insertBatch(@Param("records") List<ApiModule> records);
}

View File

@ -0,0 +1,16 @@
<?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.ExtApiModuleMapper">
<insert id="insertBatch" parameterType="io.metersphere.base.domain.ApiModule">
insert into api_module (id, project_id, name,protocol
parent_id, level, create_time,
update_time)
values
<foreach collection="records" item="emp" separator=",">
(#{emp.id,jdbcType=VARCHAR}, #{emp.projectId,jdbcType=VARCHAR},
#{emp.name,jdbcType=VARCHAR},#{emp.protocol,jdbcType=VARCHAR},
#{emp.parentId,jdbcType=VARCHAR}, #{emp.level,jdbcType=INTEGER}, #{emp.createTime,jdbcType=BIGINT},
#{emp.updateTime,jdbcType=BIGINT})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,12 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.api.dto.definition.ApiTestCaseRequest;
import io.metersphere.api.dto.definition.ApiTestCaseResult;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtApiTestCaseMapper {
List<ApiTestCaseResult> list(@Param("request") ApiTestCaseRequest request);
}

View File

@ -0,0 +1,181 @@
<?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.ExtApiTestCaseMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiTestCase">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="project_id" jdbcType="VARCHAR" property="projectId"/>
<result column="api_definition_id" jdbcType="VARCHAR" property="apiDefinitionId"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="priority" jdbcType="VARCHAR" property="priority"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiTestCase">
<result column="request" jdbcType="LONGVARCHAR" property="request"/>
<result column="response" jdbcType="LONGVARCHAR" property="response"/>
</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, project_id, name,api_definition_id,priority,description, create_user_id, update_user_id, create_time, update_time
</sql>
<sql id="Blob_Column_List">
request
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiTestCaseExample"
resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from api_test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<sql id="condition">
<choose>
<when test='${object}.operator == "like"'>
like CONCAT('%', #{${object}.value},'%')
</when>
<when test='${object}.operator == "not like"'>
not like CONCAT('%', #{${object}.value},'%')
</when>
<when test='${object}.operator == "in"'>
in
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</when>
<when test='${object}.operator == "not in"'>
not in
<foreach collection="${object}.value" item="v" separator="," open="(" close=")">
#{v}
</foreach>
</when>
<when test='${object}.operator == "between"'>
between #{${object}.value[0]} and #{${object}.value[1]}
</when>
<when test='${object}.operator == "gt"'>
&gt; #{${object}.value}
</when>
<when test='${object}.operator == "lt"'>
&lt; #{${object}.value}
</when>
<when test='${object}.operator == "ge"'>
&gt;= #{${object}.value}
</when>
<when test='${object}.operator == "le"'>
&lt;= #{${object}.value}
</when>
<when test='${object}.operator == "current user"'>
= '${@io.metersphere.commons.utils.SessionUtils@getUserId()}'
</when>
<otherwise>
= #{${object}.value}
</otherwise>
</choose>
</sql>
<select id="list" resultType="io.metersphere.api.dto.definition.ApiTestCaseResult">
select atc.id, atc.project_id,
atc.name,atc.priority,atc.api_definition_id,T1.name as createUser ,T2.name as updateUser,
atc.description,atc.request,atc.response,atc.create_user_id,
atc.create_time,atc.update_user_id, atc.update_time,ader.status execResult
from api_test_case atc left join user T1 on atc.create_user_id = T1.id left join user T2 on
atc.update_user_id = T2.id left join api_definition_exec_result ader on atc.id = ader.resource_id
<where>
<if test="request.name != null and request.name!=''">
and atc.name like CONCAT('%', #{request.name},'%')
</if>
<if test="request.id != null and request.id!=''">
AND atc.id = #{request.id}
</if>
<if test="request.priority != null and request.priority!=''">
AND atc.priority = #{request.priority}
</if>
<if test="request.projectId != null and request.projectId!=''">
AND atc.project_id = #{request.projectId}
</if>
<if test="request.apiDefinitionId != null and request.apiDefinitionId!=''">
AND atc.api_definition_id = #{request.apiDefinitionId}
</if>
</where>
<if test="request.orders != null and request.orders.size() > 0">
order by
<foreach collection="request.orders" separator="," item="order">
atc.${order.name} ${order.type}
</foreach>
</if>
</select>
</mapper>

View File

@ -31,6 +31,8 @@
:current-module="currentModule"
@editApi="editApi"
@handleCase="handleCase"
:visible="visible"
:currentRow="currentRow"
ref="apiList"/>
<!-- 添加测试窗口-->
@ -86,7 +88,7 @@
import {downloadFile, getCurrentUser, getUUID} from "@/common/js/utils";
export default {
name: "TestCase",
name: "ApiDefinition",
components: {
MsNodeTree,
MsApiList,
@ -103,7 +105,15 @@
MsRunTestSqlPage,
MsRunTestDubboPage
},
comments: {},
props: {
visible: {
type: Boolean,
default: false,
},
currentRow: {
type: Object,
}
},
data() {
return {
isHide: true,

View File

@ -82,6 +82,10 @@
<div v-for="(item,index) in apiCaseList" :key="index">
<el-card style="margin-top: 5px" @click.native="selectTestCase(item,$event)">
<el-row>
<el-col :span="1">
<el-checkbox v-if="visible" @change="caseChecked(item)"/>
</el-col>
<el-col :span="5">
<div class="el-step__icon is-text ms-api-col">
<div class="el-step__icon-inner">{{index+1}}</div>
@ -119,7 +123,7 @@
circle/>
</el-col>
<el-col :span="4">
<el-col :span="3">
<div v-if="item.type!='create'">{{getResult(item.execResult)}}</div>
<div v-if="item.type!='create'" style="color: #999999;font-size: 12px">
<span> {{item.updateTime | timestampFormatDate }}</span>
@ -186,9 +190,14 @@
api: {
type: Object
},
visible: {
type: Boolean,
default: false,
},
loaded: Boolean,
currentProject: {},
refreshSign: String,
currentRow: Object,
},
data() {
return {
@ -204,18 +213,29 @@
loading: false,
runData: [],
reportId: "",
checkedCases: new Set(),
}
},
watch: {
//
api() {
if (this.currentRow) {
this.currentRow.cases = [];
}
this.getApiTest();
},
currentProject() {
if (this.currentRow) {
this.currentRow.cases = [];
}
this.getEnvironments();
},
refreshSign() {
if (this.currentRow) {
this.currentRow.cases = [];
}
this.getApiTest();
}
},
@ -439,6 +459,16 @@
this.$emit('selectTestCase', item);
}
},
caseChecked(row) {
row.type = "CASE";
if (this.checkedCases.has(row)) {
this.checkedCases.delete(row);
} else {
this.checkedCases.add(row)
}
let arr = Array.from(this.checkedCases);
this.currentRow.cases = arr;
}
}
}

View File

@ -86,7 +86,7 @@
<div id="svgResize"/>
<div id="svgDown">
<ms-bottom-container v-bind:enableAsideHidden="isHide">
<ms-api-case-list @apiCaseClose="apiCaseClose" @refresh="initApiTable" :api="selectApi" :current-project="currentProject"/>
<ms-api-case-list @apiCaseClose="apiCaseClose" @refresh="initApiTable" :visible="visible" :currentRow="currentRow" :api="selectApi" :current-project="currentProject"/>
</ms-bottom-container>
</div>
</div>
@ -142,7 +142,14 @@
props: {
currentProject: Object,
currentProtocol: String,
currentModule: Object
currentModule: Object,
visible: {
type: Boolean,
default: false,
},
currentRow: {
type: Object,
}
},
created: function () {
this.initApiTable();
@ -190,6 +197,7 @@
});
},
handleSelect(selection, row) {
row.type = "API";
if (this.selectRows.has(row)) {
this.$set(row, "showMore", false);
this.selectRows.delete(row);
@ -199,7 +207,7 @@
}
let arr = Array.from(this.selectRows);
this.currentRow.apis = arr;
// 1
if (this.selectRows.size === 1) {
this.$set(arr[0], "showMore", false);
@ -212,9 +220,11 @@
handleSelectAll(selection) {
if (selection.length > 0) {
if (selection.length === 1) {
selection.type = "API";
this.selectRows.add(selection[0]);
} else {
this.tableData.forEach(item => {
item.type = "API";
this.$set(item, "showMore", true);
this.selectRows.add(item);
});
@ -225,6 +235,8 @@
this.$set(row, "showMore", false);
})
}
let arr = Array.from(this.selectRows);
this.currentRow.apis = arr;
},
search() {
this.initApiTable();

View File

@ -1,64 +1,66 @@
<template>
<div style="border:1px #DCDFE6 solid; height: 100%;border-radius: 4px ;width: 100% ;margin-top: 20px" v-loading="loading">
<div>
<el-button class="ms-left-buttion" size="small" style="color: #A30014;background-color: #F7E6E9">{{$t('api_test.definition.request.assertions_rule')}}</el-button>
<el-button size="small" style="float: right;margin-top: 0px" @click="remove">移除</el-button>
</div>
<div class="assertion-add">
<el-row :gutter="10">
<el-col :span="4">
<el-select :disabled="isReadOnly" class="assertion-item" v-model="type"
:placeholder="$t('api_test.request.assertions.select_type')"
size="small">
<div :style="customizeStyle" v-loading="loading">
<el-card>
<div>
<el-button class="ms-left-buttion" size="small" style="color: #A30014;background-color: #F7E6E9">{{$t('api_test.definition.request.assertions_rule')}}</el-button>
<el-button size="small" style="float: right;margin-top: 0px" @click="remove">移除</el-button>
</div>
<div class="assertion-add">
<el-row :gutter="10">
<el-col :span="4">
<el-select :disabled="isReadOnly" class="assertion-item" v-model="type"
:placeholder="$t('api_test.request.assertions.select_type')"
size="small">
<!--
<el-option :label="$t('api_test.request.assertions.text')" :value="options.TEXT"/>
-->
<el-option :label="$t('api_test.request.assertions.regex')" :value="options.REGEX"/>
<el-option :label="'JSONPath'" :value="options.JSON_PATH"/>
<el-option :label="'XPath'" :value="options.XPATH2"/>
<el-option :label="$t('api_test.request.assertions.response_time')" :value="options.DURATION"/>
<el-option :label="$t('api_test.request.assertions.jsr223')" :value="options.JSR223"/>
</el-select>
</el-col>
<el-col :span="20">
<!--
<el-option :label="$t('api_test.request.assertions.text')" :value="options.TEXT"/>
<ms-api-assertion-text :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.TEXT"
:callback="after"/>
-->
<el-option :label="$t('api_test.request.assertions.regex')" :value="options.REGEX"/>
<el-option :label="'JSONPath'" :value="options.JSON_PATH"/>
<el-option :label="'XPath'" :value="options.XPATH2"/>
<el-option :label="$t('api_test.request.assertions.response_time')" :value="options.DURATION"/>
<el-option :label="$t('api_test.request.assertions.jsr223')" :value="options.JSR223"/>
</el-select>
</el-col>
<el-col :span="20">
<!--
<ms-api-assertion-text :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.TEXT"
:callback="after"/>
-->
<ms-api-assertion-regex :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.REGEX"
:callback="after"/>
<ms-api-assertion-json-path :is-read-only="isReadOnly" :list="assertions.jsonPath"
v-if="type === options.JSON_PATH" :callback="after"/>
<ms-api-assertion-x-path2 :is-read-only="isReadOnly" :list="assertions.xpath2" v-if="type === options.XPATH2"
<ms-api-assertion-regex :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.REGEX"
:callback="after"/>
<ms-api-assertion-duration :is-read-only="isReadOnly" v-model="time" :duration="assertions.duration"
v-if="type === options.DURATION" :callback="after"/>
<ms-api-assertion-jsr223 :is-read-only="isReadOnly" :list="assertions.jsr223" v-if="type === options.JSR223"
:callback="after"/>
<el-button v-if="!type" :disabled="true" type="primary" size="small">
{{ $t('api_test.request.assertions.add') }}
</el-button>
</el-col>
</el-row>
<ms-api-assertion-json-path :is-read-only="isReadOnly" :list="assertions.jsonPath"
v-if="type === options.JSON_PATH" :callback="after"/>
<ms-api-assertion-x-path2 :is-read-only="isReadOnly" :list="assertions.xpath2" v-if="type === options.XPATH2"
:callback="after"/>
<ms-api-assertion-duration :is-read-only="isReadOnly" v-model="time" :duration="assertions.duration"
v-if="type === options.DURATION" :callback="after"/>
<ms-api-assertion-jsr223 :is-read-only="isReadOnly" :list="assertions.jsr223" v-if="type === options.JSR223"
:callback="after"/>
<el-button v-if="!type" :disabled="true" type="primary" size="small">
{{ $t('api_test.request.assertions.add') }}
</el-button>
</el-col>
</el-row>
<!--<div v-if="!scenario">-->
<!--<el-row :gutter="10" class="json-path-suggest-button">-->
<!--<el-link size="small" type="primary" @click="suggestJsonOpen" style="margin-right: 20px">-->
<!--{{ $t('api_test.request.assertions.json_path_suggest') }}-->
<!--</el-link>-->
<!--<el-link size="small" type="danger" @click="clearJson">-->
<!--{{ $t('api_test.request.assertions.json_path_clear') }}-->
<!--</el-link>-->
<!--</el-row>-->
<!--</div>-->
</div>
<!--<div v-if="!scenario">-->
<!--<el-row :gutter="10" class="json-path-suggest-button">-->
<!--<el-link size="small" type="primary" @click="suggestJsonOpen" style="margin-right: 20px">-->
<!--{{ $t('api_test.request.assertions.json_path_suggest') }}-->
<!--</el-link>-->
<!--<el-link size="small" type="danger" @click="clearJson">-->
<!--{{ $t('api_test.request.assertions.json_path_clear') }}-->
<!--</el-link>-->
<!--</el-row>-->
<!--</div>-->
</div>
<!--<ms-api-jsonpath-suggest-list @addJsonpathSuggest="addJsonpathSuggest" :request="request"-->
<!--ref="jsonpathSuggestList"/>-->
<!--<ms-api-jsonpath-suggest-list @addJsonpathSuggest="addJsonpathSuggest" :request="request"-->
<!--ref="jsonpathSuggestList"/>-->
<ms-api-assertions-edit :is-read-only="isReadOnly" :assertions="assertions" :reloadData="reloadData" style="margin-bottom: 20px"/>
<ms-api-assertions-edit :is-read-only="isReadOnly" :assertions="assertions" :reloadData="reloadData" style="margin-bottom: 20px"/>
</el-card>
</div>
</template>
@ -88,6 +90,10 @@
props: {
assertions: {},
request: {},
customizeStyle: {
type:String,
default: "margin-top: 10px"
},
scenario: Scenario,
isReadOnly: {
type: Boolean,

View File

@ -1,32 +1,33 @@
<template>
<div style="border:1px #DCDFE6 solid; height: 100%;border-radius: 4px ;width: 100% ;margin-top: 20px">
<el-button class="ms-left-buttion" size="small" style="color: #015478;background-color: #E6EEF2">{{$t('api_test.definition.request.extract_param')}}</el-button>
<el-button size="small" style="float: right;margin-top: 0px" @click="remove">移除</el-button>
<div :style="customizeStyle">
<el-card>
<el-button class="ms-left-buttion" size="small" style="color: #015478;background-color: #E6EEF2">{{$t('api_test.definition.request.extract_param')}}</el-button>
<el-button size="small" style="float: right;margin-top: 0px" @click="remove">移除</el-button>
<div style="margin: 20px">
<div class="extract-description">
{{$t('api_test.request.extract.description')}}
<div style="margin: 20px">
<div class="extract-description">
{{$t('api_test.request.extract.description')}}
</div>
<div class="extract-add">
<el-row :gutter="10">
<el-col :span="2">
<el-select :disabled="isReadOnly" class="extract-item" v-model="type" :placeholder="$t('api_test.request.extract.select_type')"
size="small">
<el-option :label="$t('api_test.request.extract.regex')" :value="options.REGEX"/>
<el-option label="JSONPath" :value="options.JSON_PATH"/>
<el-option label="XPath" :value="options.XPATH"/>
</el-select>
</el-col>
<el-col :span="22">
<ms-api-extract-common :is-read-only="isReadOnly" :extract-type="type" :list="list" v-if="type" :callback="after"/>
</el-col>
<el-button v-if="!type" :disabled="true" type="primary" size="small">Add</el-button>
</el-row>
</div>
<ms-api-extract-edit :is-read-only="isReadOnly" :reloadData="reloadData" :extract="extract"/>
</div>
<div class="extract-add">
<el-row :gutter="10">
<el-col :span="2">
<el-select :disabled="isReadOnly" class="extract-item" v-model="type" :placeholder="$t('api_test.request.extract.select_type')"
size="small">
<el-option :label="$t('api_test.request.extract.regex')" :value="options.REGEX"/>
<el-option label="JSONPath" :value="options.JSON_PATH"/>
<el-option label="XPath" :value="options.XPATH"/>
</el-select>
</el-col>
<el-col :span="22">
<ms-api-extract-common :is-read-only="isReadOnly" :extract-type="type" :list="list" v-if="type" :callback="after"/>
</el-col>
<el-button v-if="!type" :disabled="true" type="primary" size="small">Add</el-button>
</el-row>
</div>
<ms-api-extract-edit :is-read-only="isReadOnly" :reloadData="reloadData" :extract="extract"/>
</div>
</el-card>
</div>
</template>
@ -46,6 +47,10 @@
props: {
extract: {},
customizeStyle: {
type: String,
default: "margin-top: 10px"
},
isReadOnly: {
type: Boolean,
default: false

View File

@ -830,6 +830,7 @@ export class BeanShellProcessor extends BaseConfig {
export class JSR223Processor extends BaseConfig {
constructor(options) {
super();
this.type = "JSR223Processor";
this.script = undefined;
this.language = "beanshell";
this.set(options);
@ -975,6 +976,7 @@ export class Controller extends BaseConfig {
export class IfController extends Controller {
constructor(options = {}) {
super(Controller.TYPES.IF_CONTROLLER, options);
this.type = "IfController";
this.variable;
this.operator;
this.value;
@ -1017,7 +1019,7 @@ export class ConstantTimer extends Timer {
constructor(options = {}) {
super(Timer.TYPES.CONSTANT_TIMER, options);
this.delay;
this.type = "ConstantTimer";
this.set(options);
}

View File

@ -526,9 +526,23 @@ export default {
post_script: "Postscript",
extract_param: "Extract parameters",
add_module: "Add module",
}
},
automation: {
follow_people: "Follow people",
create_tag: "Create tag",
scenario_step: "Scenario step",
step_total: "Step total",
scenario_total: "Scene public parameters",
api_list_import: "Interface list import",
external_import: "External import",
wait_controller: "Waiting for controller",
if_controller: "Condition controller",
scenario_import: "Scene import",
customize_script: "Custom script",
customize_req: "Custom request",
reference_info: "Please select interface or use case",
},
environment: {
name: "Environment Name",
socket: "Socket",

View File

@ -527,9 +527,23 @@ export default {
post_script: "后置脚本",
extract_param: "提取参数",
add_module: "创建模块",
}
},
automation: {
follow_people: "关注人",
create_tag: "创建Tag",
scenario_step: "场景步骤",
step_total: "步骤总数",
scenario_total: "场景公共参数",
api_list_import: "接口列表导入",
external_import: "外部导入",
wait_controller: "等待控制器",
if_controller: "条件控制器",
scenario_import: "场景导入",
customize_script: "自定义脚本",
customize_req: "自定义请求",
reference_info: "请选择接口或用例"
},
environment: {
name: "环境名称",
socket: "环境域名",

View File

@ -529,6 +529,22 @@ export default {
add_module: "創建模塊",
}
},
automation: {
follow_people: "關註人",
create_tag: "創建Tag",
scenario_step: "場景步驟",
step_total: "步驟總數",
scenario_total: "場景公共參數",
api_list_import: "接口列表導入",
external_import: "外部導入",
wait_controller: "等待控制器",
if_controller: "條件控制器",
scenario_import: "場景導入",
customize_script: "自定義腳本",
customize_req: "自定義請求",
reference_info: "請選擇接口或用例"
},
environment: {
name: "環境名稱",
socket: "環境域名",