Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5cbbb73405
|
@ -1,10 +1,10 @@
|
|||
pipeline {
|
||||
agent {
|
||||
node {
|
||||
label 'master'
|
||||
label 'metersphere'
|
||||
}
|
||||
}
|
||||
options { quietPeriod(1200) }
|
||||
options { quietPeriod(600) }
|
||||
parameters {
|
||||
string(name: 'IMAGE_NAME', defaultValue: 'metersphere', description: '构建后的 Docker 镜像名称')
|
||||
string(name: 'IMAGE_FREFIX', defaultValue: 'registry.cn-qingdao.aliyuncs.com/metersphere', description: '构建后的 Docker 镜像带仓库名的前缀')
|
||||
|
|
|
@ -379,6 +379,12 @@
|
|||
<artifactId>reflections8</artifactId>
|
||||
<version>0.11.7</version>
|
||||
</dependency>
|
||||
<!-- k8s client -->
|
||||
<dependency>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>kubernetes-client</artifactId>
|
||||
<version>4.13.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -2,10 +2,10 @@ package io.metersphere.api.controller;
|
|||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.metersphere.api.dto.APIReportResult;
|
||||
import io.metersphere.api.dto.DeleteAPIReportRequest;
|
||||
import io.metersphere.api.dto.QueryAPIReportRequest;
|
||||
import io.metersphere.api.dto.automation.APIScenarioReportResult;
|
||||
import io.metersphere.api.dto.automation.ExecuteType;
|
||||
import io.metersphere.api.service.ApiScenarioReportService;
|
||||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.commons.utils.PageUtils;
|
||||
|
@ -27,8 +27,8 @@ public class APIScenarioReportController {
|
|||
private ApiScenarioReportService apiReportService;
|
||||
|
||||
@GetMapping("/get/{reportId}/{infoDb}")
|
||||
public APIReportResult get(@PathVariable String reportId,@PathVariable Boolean infoDb) {
|
||||
if(infoDb){
|
||||
public APIScenarioReportResult get(@PathVariable String reportId, @PathVariable Boolean infoDb) {
|
||||
if (infoDb) {
|
||||
return apiReportService.get(reportId);
|
||||
}
|
||||
return apiReportService.getCacheResult(reportId);
|
||||
|
@ -44,12 +44,14 @@ public class APIScenarioReportController {
|
|||
@PostMapping("/add")
|
||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
public String add(@RequestBody APIScenarioReportResult node) {
|
||||
return apiReportService.add(node);
|
||||
node.setExecuteType(ExecuteType.Saved.name());
|
||||
return apiReportService.save(node);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
public String update(@RequestBody APIScenarioReportResult node) {
|
||||
node.setExecuteType(ExecuteType.Saved.name());
|
||||
return apiReportService.update(node);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import io.metersphere.api.dto.automation.*;
|
|||
import io.metersphere.api.dto.definition.RunDefinitionRequest;
|
||||
import io.metersphere.api.service.ApiAutomationService;
|
||||
import io.metersphere.base.domain.ApiScenario;
|
||||
import io.metersphere.base.domain.ApiScenarioWithBLOBs;
|
||||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.commons.utils.PageUtils;
|
||||
import io.metersphere.commons.utils.Pager;
|
||||
|
@ -69,17 +70,19 @@ public class ApiAutomationController {
|
|||
}
|
||||
|
||||
@PostMapping("/getApiScenarios")
|
||||
public List<ApiScenario> getApiScenarios(@RequestBody List<String> ids) {
|
||||
public List<ApiScenarioWithBLOBs> getApiScenarios(@RequestBody List<String> ids) {
|
||||
return apiAutomationService.getApiScenarios(ids);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/run/debug")
|
||||
public void runDebug(@RequestPart("request") RunDefinitionRequest request, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
|
||||
request.setExecuteType(ExecuteType.Debug.name());
|
||||
apiAutomationService.run(request, bodyFiles);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/run")
|
||||
public void run(@RequestBody RunScenarioRequest request) {
|
||||
request.setExecuteType(ExecuteType.Completed.name());
|
||||
apiAutomationService.run(request);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ import io.metersphere.base.domain.ApiScenarioReport;
|
|||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class APIScenarioReportResult extends ApiScenarioReport {
|
||||
|
@ -12,7 +14,11 @@ public class APIScenarioReportResult extends ApiScenarioReport {
|
|||
|
||||
private String projectName;
|
||||
|
||||
private String testId;
|
||||
|
||||
private String userName;
|
||||
|
||||
private List<String> scenarioIds;
|
||||
|
||||
private String content;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package io.metersphere.api.dto.automation;
|
||||
|
||||
public enum ExecuteType {
|
||||
Saved, Completed, Debug
|
||||
}
|
|
@ -13,9 +13,13 @@ public class RunScenarioRequest {
|
|||
|
||||
private String reportId;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String environmentId;
|
||||
|
||||
private String triggerMode;
|
||||
|
||||
private String executeType;
|
||||
|
||||
private List<String> scenarioIds;
|
||||
}
|
||||
|
|
|
@ -15,10 +15,14 @@ public class RunDefinitionRequest {
|
|||
|
||||
private String reportId;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String environmentId;
|
||||
|
||||
private MsTestElement testElement;
|
||||
|
||||
private String executeType;
|
||||
|
||||
private Response response;
|
||||
|
||||
private List<String> bodyUploadIds;
|
||||
|
|
|
@ -11,17 +11,17 @@ import io.metersphere.api.dto.scenario.KeyValue;
|
|||
import io.metersphere.api.dto.scenario.environment.EnvironmentConfig;
|
||||
import io.metersphere.api.service.ApiAutomationService;
|
||||
import io.metersphere.api.service.ApiTestEnvironmentService;
|
||||
import io.metersphere.base.domain.ApiScenario;
|
||||
import io.metersphere.base.domain.ApiScenarioWithBLOBs;
|
||||
import io.metersphere.base.domain.ApiTestEnvironmentWithBLOBs;
|
||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.jmeter.config.Arguments;
|
||||
import org.apache.jmeter.save.SaveService;
|
||||
import org.apache.jmeter.testelement.TestElement;
|
||||
import org.apache.jorphan.collections.HashTree;
|
||||
import org.apache.jmeter.config.Arguments;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
@ -67,7 +67,7 @@ public class MsScenario extends MsTestElement {
|
|||
ApiAutomationService apiAutomationService = CommonBeanFactory.getBean(ApiAutomationService.class);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
ApiScenario scenario = apiAutomationService.getApiScenario(this.getId());
|
||||
ApiScenarioWithBLOBs scenario = apiAutomationService.getApiScenario(this.getId());
|
||||
JSONObject element = JSON.parseObject(scenario.getScenarioDefinition());
|
||||
LinkedList<MsTestElement> elements = mapper.readValue(element.getString("hashTree"), new TypeReference<LinkedList<MsTestElement>>() {
|
||||
});
|
||||
|
|
|
@ -101,7 +101,7 @@ public abstract class MsTestElement {
|
|||
return baos.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.warn("HashTree error, can't log jmx content");
|
||||
LogUtil.warn("HashTree error, can't log jmx scenarioDefinition");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,9 @@ public class MsThreadGroup extends MsTestElement {
|
|||
final HashTree groupTree = tree.add(getThreadGroup());
|
||||
if ((config != null && config.isEnableCookieShare()) || enableCookieShare) {
|
||||
CookieManager cookieManager = new CookieManager();
|
||||
cookieManager.setProperty(TestElement.TEST_CLASS, CookieManager.class.getName());
|
||||
cookieManager.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("CookiePanel"));
|
||||
cookieManager.setEnabled(true);
|
||||
cookieManager.setName("CookieManager");
|
||||
cookieManager.setClearEachIteration(false);
|
||||
cookieManager.setControlledByThread(false);
|
||||
|
|
|
@ -141,7 +141,7 @@ public abstract class ApiImportAbstractParser implements ApiImportParser {
|
|||
// }
|
||||
// }
|
||||
// if (!hasContentType) {
|
||||
// headers.add(new KeyValue(key, value));
|
||||
// headers.save(new KeyValue(key, value));
|
||||
// }
|
||||
// request.setHeaders(headers);
|
||||
// }
|
||||
|
|
|
@ -26,7 +26,6 @@ import io.swagger.models.properties.Property;
|
|||
import io.swagger.models.properties.RefProperty;
|
||||
import io.swagger.parser.SwaggerParser;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.jorphan.collections.HashTree;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
|
@ -80,7 +79,7 @@ public class Swagger2Parser extends ApiImportAbstractParser {
|
|||
headerManager.setName(res.getName() + "Postman MsHeaderManager");
|
||||
headerManager.setHeaders(res.getHeaders());
|
||||
// HashTree tree = new HashTree();
|
||||
// tree.add(headerManager);
|
||||
// tree.save(headerManager);
|
||||
LinkedList<MsTestElement> list = new LinkedList<>();
|
||||
list.add(headerManager);
|
||||
requestElement.setHashTree(list);
|
||||
|
|
|
@ -6,7 +6,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
|||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.gson.Gson;
|
||||
import io.metersphere.api.dto.APIReportResult;
|
||||
import io.metersphere.api.dto.automation.*;
|
||||
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
|
||||
import io.metersphere.api.dto.definition.RunDefinitionRequest;
|
||||
|
@ -105,8 +104,8 @@ public class ApiAutomationService {
|
|||
public ApiScenario create(SaveApiScenarioRequest request, List<MultipartFile> bodyFiles) {
|
||||
request.setId(UUID.randomUUID().toString());
|
||||
checkNameExist(request);
|
||||
|
||||
final ApiScenario scenario = new ApiScenario();
|
||||
|
||||
final ApiScenarioWithBLOBs scenario = new ApiScenarioWithBLOBs();
|
||||
scenario.setId(request.getId());
|
||||
scenario.setName(request.getName());
|
||||
scenario.setProjectId(request.getProjectId());
|
||||
|
@ -143,7 +142,7 @@ public class ApiAutomationService {
|
|||
List<String> bodyUploadIds = request.getBodyUploadIds();
|
||||
apiDefinitionService.createBodyFiles(bodyUploadIds, bodyFiles);
|
||||
|
||||
final ApiScenario scenario = new ApiScenario();
|
||||
final ApiScenarioWithBLOBs scenario = new ApiScenarioWithBLOBs();
|
||||
scenario.setId(request.getId());
|
||||
scenario.setName(request.getName());
|
||||
scenario.setProjectId(request.getProjectId());
|
||||
|
@ -182,7 +181,7 @@ public class ApiAutomationService {
|
|||
|
||||
public void reduction(List<SaveApiScenarioRequest> requests) {
|
||||
List<String> apiIds = new ArrayList<>();
|
||||
requests.forEach(item->{
|
||||
requests.forEach(item -> {
|
||||
checkNameExist(item);
|
||||
apiIds.add(item.getId());
|
||||
});
|
||||
|
@ -197,11 +196,11 @@ public class ApiAutomationService {
|
|||
}
|
||||
}
|
||||
|
||||
public ApiScenario getApiScenario(String id) {
|
||||
public ApiScenarioWithBLOBs getApiScenario(String id) {
|
||||
return apiScenarioMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<ApiScenario> getApiScenarios(List<String> ids) {
|
||||
public List<ApiScenarioWithBLOBs> getApiScenarios(List<String> ids) {
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
return extApiScenarioMapper.selectIds(ids);
|
||||
}
|
||||
|
@ -209,7 +208,7 @@ public class ApiAutomationService {
|
|||
}
|
||||
|
||||
public void deleteTag(String id) {
|
||||
List<ApiScenario> list = extApiScenarioMapper.selectByTagId(id);
|
||||
List<ApiScenarioWithBLOBs> list = extApiScenarioMapper.selectByTagId(id);
|
||||
if (!list.isEmpty()) {
|
||||
Gson gs = new Gson();
|
||||
list.forEach(item -> {
|
||||
|
@ -221,17 +220,17 @@ public class ApiAutomationService {
|
|||
}
|
||||
}
|
||||
|
||||
private void createAPIReportResult(String id, String triggerMode) {
|
||||
APIReportResult report = new APIReportResult();
|
||||
private void createAPIScenarioReportResult(String id, String triggerMode, String execType, String projectId) {
|
||||
APIScenarioReportResult report = new APIScenarioReportResult();
|
||||
report.setId(id);
|
||||
report.setTestId(id);
|
||||
report.setName("");
|
||||
report.setTriggerMode(null);
|
||||
report.setName("测试执行结果");
|
||||
report.setCreateTime(System.currentTimeMillis());
|
||||
report.setUpdateTime(System.currentTimeMillis());
|
||||
report.setStatus(APITestStatus.Running.name());
|
||||
report.setUserId(SessionUtils.getUserId());
|
||||
report.setTriggerMode(triggerMode);
|
||||
report.setExecuteType(execType);
|
||||
report.setProjectId(projectId);
|
||||
apiReportService.addResult(report);
|
||||
|
||||
}
|
||||
|
@ -243,11 +242,11 @@ public class ApiAutomationService {
|
|||
* @return
|
||||
*/
|
||||
public String run(RunScenarioRequest request) {
|
||||
List<ApiScenario> apiScenarios = extApiScenarioMapper.selectIds(request.getScenarioIds());
|
||||
List<ApiScenarioWithBLOBs> apiScenarios = extApiScenarioMapper.selectIds(request.getScenarioIds());
|
||||
MsTestPlan testPlan = new MsTestPlan();
|
||||
testPlan.setHashTree(new LinkedList<>());
|
||||
HashTree jmeterTestPlanHashTree = new ListedHashTree();
|
||||
for (ApiScenario item : apiScenarios) {
|
||||
for (ApiScenarioWithBLOBs item : apiScenarios) {
|
||||
MsThreadGroup group = new MsThreadGroup();
|
||||
group.setLabel(item.getName());
|
||||
group.setName(item.getName());
|
||||
|
@ -281,7 +280,8 @@ public class ApiAutomationService {
|
|||
// 调用执行方法
|
||||
jMeterService.runDefinition(request.getId(), jmeterTestPlanHashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
|
||||
|
||||
createAPIReportResult(request.getId(), request.getTriggerMode() == null ? ReportTriggerMode.MANUAL.name() : request.getTriggerMode());
|
||||
createAPIScenarioReportResult(request.getId(), request.getTriggerMode() == null ? ReportTriggerMode.MANUAL.name() : request.getTriggerMode(),
|
||||
request.getExecuteType(), request.getProjectId());
|
||||
return request.getId();
|
||||
}
|
||||
|
||||
|
@ -306,7 +306,7 @@ public class ApiAutomationService {
|
|||
HashTree hashTree = request.getTestElement().generateHashTree(config);
|
||||
// 调用执行方法
|
||||
jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
|
||||
createAPIReportResult(request.getId(), ReportTriggerMode.MANUAL.name());
|
||||
createAPIScenarioReportResult(request.getId(), ReportTriggerMode.MANUAL.name(), request.getExecuteType(), request.getProjectId());
|
||||
return request.getId();
|
||||
}
|
||||
|
||||
|
@ -372,10 +372,10 @@ public class ApiAutomationService {
|
|||
Date firstTime = startAndEndDateInWeek.get("firstTime");
|
||||
Date lastTime = startAndEndDateInWeek.get("lastTime");
|
||||
|
||||
if(firstTime==null || lastTime == null){
|
||||
return 0;
|
||||
}else {
|
||||
return extApiScenarioMapper.countByProjectIDAndCreatInThisWeek(projectId,firstTime.getTime(),lastTime.getTime());
|
||||
if (firstTime == null || lastTime == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return extApiScenarioMapper.countByProjectIDAndCreatInThisWeek(projectId, firstTime.getTime(), lastTime.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@ package io.metersphere.api.service;
|
|||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.metersphere.api.dto.APIReportResult;
|
||||
import io.metersphere.api.dto.DeleteAPIReportRequest;
|
||||
import io.metersphere.api.dto.QueryAPIReportRequest;
|
||||
import io.metersphere.api.dto.automation.APIScenarioReportResult;
|
||||
import io.metersphere.api.dto.automation.ExecuteType;
|
||||
import io.metersphere.api.jmeter.TestResult;
|
||||
import io.metersphere.base.domain.*;
|
||||
import io.metersphere.base.mapper.ApiScenarioMapper;
|
||||
|
@ -49,11 +49,12 @@ public class ApiScenarioReportService {
|
|||
if (obj == null) {
|
||||
MSException.throwException(Translator.get("api_report_is_null"));
|
||||
}
|
||||
APIReportResult report = (APIReportResult) obj;
|
||||
APIScenarioReportResult report = (APIScenarioReportResult) obj;
|
||||
// report detail
|
||||
ApiTestReportDetail detail = new ApiTestReportDetail();
|
||||
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();
|
||||
detail.setReportId(result.getTestId());
|
||||
detail.setTestId(report.getTestId());
|
||||
detail.setProjectId(report.getProjectId());
|
||||
report.setTestId(result.getTestId());
|
||||
detail.setContent(JSONObject.toJSONString(result).getBytes(StandardCharsets.UTF_8));
|
||||
// report
|
||||
report.setUpdateTime(System.currentTimeMillis());
|
||||
|
@ -65,11 +66,8 @@ public class ApiScenarioReportService {
|
|||
}
|
||||
}
|
||||
report.setContent(new String(detail.getContent(), StandardCharsets.UTF_8));
|
||||
cache.put(report.getTestId(), report);
|
||||
}
|
||||
|
||||
public void addResult(APIReportResult res) {
|
||||
cache.put(res.getTestId(), res);
|
||||
this.save(report);
|
||||
cache.put(report.getId(), report);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,10 +75,10 @@ public class ApiScenarioReportService {
|
|||
*
|
||||
* @param testId
|
||||
*/
|
||||
public APIReportResult getCacheResult(String testId) {
|
||||
public APIScenarioReportResult getCacheResult(String testId) {
|
||||
Object res = cache.get(testId);
|
||||
if (res != null) {
|
||||
APIReportResult reportResult = (APIReportResult) res;
|
||||
APIScenarioReportResult reportResult = (APIScenarioReportResult) res;
|
||||
if (!reportResult.getStatus().equals(APITestStatus.Running.name())) {
|
||||
cache.remove(testId);
|
||||
}
|
||||
|
@ -89,8 +87,13 @@ public class ApiScenarioReportService {
|
|||
return null;
|
||||
}
|
||||
|
||||
public APIReportResult get(String reportId) {
|
||||
APIReportResult reportResult = extApiScenarioReportMapper.get(reportId);
|
||||
|
||||
public void addResult(APIScenarioReportResult res) {
|
||||
cache.put(res.getId(), res);
|
||||
}
|
||||
|
||||
public APIScenarioReportResult get(String reportId) {
|
||||
APIScenarioReportResult reportResult = extApiScenarioReportMapper.get(reportId);
|
||||
ApiScenarioReportDetail detail = apiScenarioReportDetailMapper.selectByPrimaryKey(reportId);
|
||||
if (detail != null) {
|
||||
reportResult.setContent(new String(detail.getContent(), StandardCharsets.UTF_8));
|
||||
|
@ -105,7 +108,7 @@ public class ApiScenarioReportService {
|
|||
|
||||
private void checkNameExist(APIScenarioReportResult request) {
|
||||
ApiScenarioReportExample example = new ApiScenarioReportExample();
|
||||
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId());
|
||||
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()).andExecuteTypeEqualTo(ExecuteType.Saved.name()).andIdNotEqualTo(request.getId());
|
||||
if (apiScenarioReportMapper.countByExample(example) > 0) {
|
||||
MSException.throwException(Translator.get("load_test_already_exists"));
|
||||
}
|
||||
|
@ -123,6 +126,7 @@ public class ApiScenarioReportService {
|
|||
report.setUpdateTime(System.currentTimeMillis());
|
||||
report.setStatus(test.getStatus());
|
||||
report.setUserId(test.getUserId());
|
||||
report.setExecuteType(test.getExecuteType());
|
||||
apiScenarioReportMapper.insert(report);
|
||||
return report;
|
||||
}
|
||||
|
@ -139,12 +143,13 @@ public class ApiScenarioReportService {
|
|||
report.setUpdateTime(System.currentTimeMillis());
|
||||
report.setStatus(test.getStatus());
|
||||
report.setUserId(test.getUserId());
|
||||
report.setExecuteType(test.getExecuteType());
|
||||
apiScenarioReportMapper.updateByPrimaryKey(report);
|
||||
return report;
|
||||
}
|
||||
|
||||
|
||||
public String add(APIScenarioReportResult test) {
|
||||
public String save(APIScenarioReportResult test) {
|
||||
ApiScenarioReport report = createReport(test);
|
||||
ApiScenarioReportDetail detail = new ApiScenarioReportDetail();
|
||||
TestResult result = JSON.parseObject(test.getContent(), TestResult.class);
|
||||
|
@ -218,10 +223,10 @@ public class ApiScenarioReportService {
|
|||
Date firstTime = startAndEndDateInWeek.get("firstTime");
|
||||
Date lastTime = startAndEndDateInWeek.get("lastTime");
|
||||
|
||||
if(firstTime==null || lastTime == null){
|
||||
return 0;
|
||||
}else {
|
||||
return extApiScenarioReportMapper.countByProjectIDAndCreateInThisWeek(projectId,firstTime.getTime(),lastTime.getTime());
|
||||
if (firstTime == null || lastTime == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return extApiScenarioReportMapper.countByProjectIDAndCreateInThisWeek(projectId, firstTime.getTime(), lastTime.getTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiDefinition implements Serializable {
|
||||
|
@ -16,8 +15,6 @@ public class ApiDefinition implements Serializable {
|
|||
|
||||
private String modulePath;
|
||||
|
||||
private String description;
|
||||
|
||||
private String environmentId;
|
||||
|
||||
private String schedule;
|
||||
|
|
|
@ -454,76 +454,6 @@ public class ApiDefinitionExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNull() {
|
||||
addCriterion("description is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNotNull() {
|
||||
addCriterion("description is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionEqualTo(String value) {
|
||||
addCriterion("description =", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotEqualTo(String value) {
|
||||
addCriterion("description <>", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThan(String value) {
|
||||
addCriterion("description >", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("description >=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThan(String value) {
|
||||
addCriterion("description <", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThanOrEqualTo(String value) {
|
||||
addCriterion("description <=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLike(String value) {
|
||||
addCriterion("description like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotLike(String value) {
|
||||
addCriterion("description not like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIn(List<String> values) {
|
||||
addCriterion("description in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotIn(List<String> values) {
|
||||
addCriterion("description not in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionBetween(String value1, String value2) {
|
||||
addCriterion("description between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotBetween(String value1, String value2) {
|
||||
addCriterion("description not between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEnvironmentIdIsNull() {
|
||||
addCriterion("environment_id is null");
|
||||
return (Criteria) this;
|
||||
|
|
|
@ -9,6 +9,8 @@ import lombok.ToString;
|
|||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApiDefinitionWithBLOBs extends ApiDefinition implements Serializable {
|
||||
private String description;
|
||||
|
||||
private String request;
|
||||
|
||||
private String response;
|
||||
|
|
|
@ -31,8 +31,6 @@ public class ApiScenario implements Serializable {
|
|||
|
||||
private String schedule;
|
||||
|
||||
private String description;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private Long updateTime;
|
||||
|
@ -43,7 +41,5 @@ public class ApiScenario implements Serializable {
|
|||
|
||||
private String reportId;
|
||||
|
||||
private String scenarioDefinition;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -1004,76 +1004,6 @@ public class ApiScenarioExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNull() {
|
||||
addCriterion("description is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNotNull() {
|
||||
addCriterion("description is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionEqualTo(String value) {
|
||||
addCriterion("description =", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotEqualTo(String value) {
|
||||
addCriterion("description <>", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThan(String value) {
|
||||
addCriterion("description >", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("description >=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThan(String value) {
|
||||
addCriterion("description <", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThanOrEqualTo(String value) {
|
||||
addCriterion("description <=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLike(String value) {
|
||||
addCriterion("description like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotLike(String value) {
|
||||
addCriterion("description not like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIn(List<String> values) {
|
||||
addCriterion("description in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotIn(List<String> values) {
|
||||
addCriterion("description not in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionBetween(String value1, String value2) {
|
||||
addCriterion("description between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotBetween(String value1, String value2) {
|
||||
addCriterion("description not between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ApiScenarioReport implements Serializable {
|
||||
private String id;
|
||||
|
@ -11,8 +12,6 @@ public class ApiScenarioReport implements Serializable {
|
|||
|
||||
private String name;
|
||||
|
||||
private String description;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private Long updateTime;
|
||||
|
@ -23,5 +22,9 @@ public class ApiScenarioReport implements Serializable {
|
|||
|
||||
private String triggerMode;
|
||||
|
||||
private String executeType;
|
||||
|
||||
private String description;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -314,76 +314,6 @@ public class ApiScenarioReportExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNull() {
|
||||
addCriterion("description is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNotNull() {
|
||||
addCriterion("description is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionEqualTo(String value) {
|
||||
addCriterion("description =", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotEqualTo(String value) {
|
||||
addCriterion("description <>", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThan(String value) {
|
||||
addCriterion("description >", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("description >=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThan(String value) {
|
||||
addCriterion("description <", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThanOrEqualTo(String value) {
|
||||
addCriterion("description <=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLike(String value) {
|
||||
addCriterion("description like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotLike(String value) {
|
||||
addCriterion("description not like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIn(List<String> values) {
|
||||
addCriterion("description in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotIn(List<String> values) {
|
||||
addCriterion("description not in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionBetween(String value1, String value2) {
|
||||
addCriterion("description between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotBetween(String value1, String value2) {
|
||||
addCriterion("description not between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
|
@ -713,6 +643,76 @@ public class ApiScenarioReportExample {
|
|||
addCriterion("trigger_mode not between", value1, value2, "triggerMode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeIsNull() {
|
||||
addCriterion("execute_type is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeIsNotNull() {
|
||||
addCriterion("execute_type is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeEqualTo(String value) {
|
||||
addCriterion("execute_type =", value, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeNotEqualTo(String value) {
|
||||
addCriterion("execute_type <>", value, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeGreaterThan(String value) {
|
||||
addCriterion("execute_type >", value, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("execute_type >=", value, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeLessThan(String value) {
|
||||
addCriterion("execute_type <", value, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("execute_type <=", value, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeLike(String value) {
|
||||
addCriterion("execute_type like", value, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeNotLike(String value) {
|
||||
addCriterion("execute_type not like", value, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeIn(List<String> values) {
|
||||
addCriterion("execute_type in", values, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeNotIn(List<String> values) {
|
||||
addCriterion("execute_type not in", values, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeBetween(String value1, String value2) {
|
||||
addCriterion("execute_type between", value1, value2, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andExecuteTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("execute_type not between", value1, value2, "executeType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApiScenarioWithBLOBs extends ApiScenario implements Serializable {
|
||||
private String scenarioDefinition;
|
||||
|
||||
private String description;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -1,8 +1,7 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiTestCase implements Serializable {
|
||||
|
@ -16,8 +15,6 @@ public class ApiTestCase implements Serializable {
|
|||
|
||||
private String apiDefinitionId;
|
||||
|
||||
private String description;
|
||||
|
||||
private String createUserId;
|
||||
|
||||
private String updateUserId;
|
||||
|
|
|
@ -454,76 +454,6 @@ public class ApiTestCaseExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNull() {
|
||||
addCriterion("description is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNotNull() {
|
||||
addCriterion("description is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionEqualTo(String value) {
|
||||
addCriterion("description =", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotEqualTo(String value) {
|
||||
addCriterion("description <>", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThan(String value) {
|
||||
addCriterion("description >", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("description >=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThan(String value) {
|
||||
addCriterion("description <", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThanOrEqualTo(String value) {
|
||||
addCriterion("description <=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLike(String value) {
|
||||
addCriterion("description like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotLike(String value) {
|
||||
addCriterion("description not like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIn(List<String> values) {
|
||||
addCriterion("description in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotIn(List<String> values) {
|
||||
addCriterion("description not in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionBetween(String value1, String value2) {
|
||||
addCriterion("description between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotBetween(String value1, String value2) {
|
||||
addCriterion("description not between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdIsNull() {
|
||||
addCriterion("create_user_id is null");
|
||||
return (Criteria) this;
|
||||
|
|
|
@ -9,6 +9,8 @@ import lombok.ToString;
|
|||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApiTestCaseWithBLOBs extends ApiTestCase implements Serializable {
|
||||
private String description;
|
||||
|
||||
private String request;
|
||||
|
||||
private String response;
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package io.metersphere.base.mapper;
|
||||
|
||||
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
|
||||
import io.metersphere.api.dto.dataCount.response.ApiDataCountDTO;
|
||||
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 org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface ApiDefinitionMapper {
|
||||
long countByExample(ApiDefinitionExample example);
|
||||
|
@ -38,5 +34,4 @@ public interface ApiDefinitionMapper {
|
|||
int updateByPrimaryKeyWithBLOBs(ApiDefinitionWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKey(ApiDefinition record);
|
||||
|
||||
}
|
|
@ -7,7 +7,6 @@
|
|||
<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" />
|
||||
|
@ -19,6 +18,7 @@
|
|||
<result column="path" jdbcType="VARCHAR" property="path" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
|
||||
<result column="description" jdbcType="LONGVARCHAR" property="description" />
|
||||
<result column="request" jdbcType="LONGVARCHAR" property="request" />
|
||||
<result column="response" jdbcType="LONGVARCHAR" property="response" />
|
||||
</resultMap>
|
||||
|
@ -81,11 +81,11 @@
|
|||
</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`
|
||||
id, project_id, `name`, `method`, module_path, environment_id, schedule, `status`,
|
||||
module_id, user_id, create_time, update_time, protocol, `path`
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
request, response
|
||||
description, request, response
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinitionExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
|
@ -137,16 +137,16 @@
|
|||
</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`,
|
||||
`method`, module_path, environment_id,
|
||||
schedule, `status`, module_id,
|
||||
user_id, create_time, update_time,
|
||||
protocol, `path`, description,
|
||||
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},
|
||||
#{method,jdbcType=VARCHAR}, #{modulePath,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}, #{description,jdbcType=LONGVARCHAR},
|
||||
#{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
|
||||
|
@ -167,9 +167,6 @@
|
|||
<if test="modulePath != null">
|
||||
module_path,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="environmentId != null">
|
||||
environment_id,
|
||||
</if>
|
||||
|
@ -197,6 +194,9 @@
|
|||
<if test="path != null">
|
||||
`path`,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="request != null">
|
||||
request,
|
||||
</if>
|
||||
|
@ -220,9 +220,6 @@
|
|||
<if test="modulePath != null">
|
||||
#{modulePath,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="environmentId != null">
|
||||
#{environmentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -250,6 +247,9 @@
|
|||
<if test="path != null">
|
||||
#{path,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="request != null">
|
||||
#{request,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -282,9 +282,6 @@
|
|||
<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>
|
||||
|
@ -312,6 +309,9 @@
|
|||
<if test="record.path != null">
|
||||
`path` = #{record.path,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="record.request != null">
|
||||
request = #{record.request,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -330,7 +330,6 @@
|
|||
`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},
|
||||
|
@ -340,6 +339,7 @@
|
|||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
protocol = #{record.protocol,jdbcType=VARCHAR},
|
||||
`path` = #{record.path,jdbcType=VARCHAR},
|
||||
description = #{record.description,jdbcType=LONGVARCHAR},
|
||||
request = #{record.request,jdbcType=LONGVARCHAR},
|
||||
response = #{record.response,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
|
@ -353,7 +353,6 @@
|
|||
`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},
|
||||
|
@ -382,9 +381,6 @@
|
|||
<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>
|
||||
|
@ -412,6 +408,9 @@
|
|||
<if test="path != null">
|
||||
`path` = #{path,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="request != null">
|
||||
request = #{request,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -427,7 +426,6 @@
|
|||
`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},
|
||||
|
@ -437,6 +435,7 @@
|
|||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
protocol = #{protocol,jdbcType=VARCHAR},
|
||||
`path` = #{path,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=LONGVARCHAR},
|
||||
request = #{request,jdbcType=LONGVARCHAR},
|
||||
response = #{response,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
|
@ -447,7 +446,6 @@
|
|||
`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},
|
||||
|
|
|
@ -2,9 +2,9 @@ package io.metersphere.base.mapper;
|
|||
|
||||
import io.metersphere.base.domain.ApiScenario;
|
||||
import io.metersphere.base.domain.ApiScenarioExample;
|
||||
import io.metersphere.base.domain.ApiScenarioWithBLOBs;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
public interface ApiScenarioMapper {
|
||||
long countByExample(ApiScenarioExample example);
|
||||
|
@ -13,26 +13,25 @@ public interface ApiScenarioMapper {
|
|||
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
int insert(ApiScenario record);
|
||||
int insert(ApiScenarioWithBLOBs record);
|
||||
|
||||
int insertSelective(ApiScenario record);
|
||||
int insertSelective(ApiScenarioWithBLOBs record);
|
||||
|
||||
List<ApiScenario> selectByExampleWithBLOBs(ApiScenarioExample example);
|
||||
List<ApiScenarioWithBLOBs> selectByExampleWithBLOBs(ApiScenarioExample example);
|
||||
|
||||
List<ApiScenario> selectByExample(ApiScenarioExample example);
|
||||
|
||||
ApiScenario selectByPrimaryKey(String id);
|
||||
ApiScenarioWithBLOBs selectByPrimaryKey(String id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") ApiScenario record, @Param("example") ApiScenarioExample example);
|
||||
int updateByExampleSelective(@Param("record") ApiScenarioWithBLOBs record, @Param("example") ApiScenarioExample example);
|
||||
|
||||
int updateByExampleWithBLOBs(@Param("record") ApiScenario record, @Param("example") ApiScenarioExample example);
|
||||
int updateByExampleWithBLOBs(@Param("record") ApiScenarioWithBLOBs record, @Param("example") ApiScenarioExample example);
|
||||
|
||||
int updateByExample(@Param("record") ApiScenario record, @Param("example") ApiScenarioExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(ApiScenario record);
|
||||
int updateByPrimaryKeySelective(ApiScenarioWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKeyWithBLOBs(ApiScenario record);
|
||||
int updateByPrimaryKeyWithBLOBs(ApiScenarioWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKey(ApiScenario record);
|
||||
|
||||
}
|
|
@ -15,15 +15,15 @@
|
|||
<result column="step_total" jdbcType="INTEGER" property="stepTotal" />
|
||||
<result column="follow_people" jdbcType="VARCHAR" property="followPeople" />
|
||||
<result column="schedule" jdbcType="VARCHAR" property="schedule" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="pass_rate" jdbcType="VARCHAR" property="passRate" />
|
||||
<result column="last_result" jdbcType="VARCHAR" property="lastResult" />
|
||||
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiScenario">
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiScenarioWithBLOBs">
|
||||
<result column="scenario_definition" jdbcType="LONGVARCHAR" property="scenarioDefinition" />
|
||||
<result column="description" jdbcType="LONGVARCHAR" property="description" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
|
@ -85,11 +85,11 @@
|
|||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, project_id, tag_id, user_id, api_scenario_module_id, module_path, `name`, `level`,
|
||||
`status`, principal, step_total, follow_people, schedule, description, create_time,
|
||||
update_time, pass_rate, last_result, report_id
|
||||
`status`, principal, step_total, follow_people, schedule, create_time, update_time,
|
||||
pass_rate, last_result, report_id
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
scenario_definition
|
||||
scenario_definition, description
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiScenarioExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
|
@ -139,23 +139,25 @@
|
|||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.ApiScenario">
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
|
||||
insert into api_scenario (id, project_id, tag_id,
|
||||
user_id, api_scenario_module_id, module_path,
|
||||
`name`, `level`, `status`,
|
||||
principal, step_total, follow_people,
|
||||
schedule, description, create_time,
|
||||
update_time, pass_rate, last_result,
|
||||
report_id, scenario_definition)
|
||||
schedule, create_time, update_time,
|
||||
pass_rate, last_result, report_id,
|
||||
scenario_definition, description
|
||||
)
|
||||
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{tagId,jdbcType=VARCHAR},
|
||||
#{userId,jdbcType=VARCHAR}, #{apiScenarioModuleId,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR},
|
||||
#{name,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
|
||||
#{principal,jdbcType=VARCHAR}, #{stepTotal,jdbcType=INTEGER}, #{followPeople,jdbcType=VARCHAR},
|
||||
#{schedule,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
|
||||
#{updateTime,jdbcType=BIGINT}, #{passRate,jdbcType=VARCHAR}, #{lastResult,jdbcType=VARCHAR},
|
||||
#{reportId,jdbcType=VARCHAR}, #{scenarioDefinition,jdbcType=LONGVARCHAR})
|
||||
#{schedule,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||
#{passRate,jdbcType=VARCHAR}, #{lastResult,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR},
|
||||
#{scenarioDefinition,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiScenario">
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
|
||||
insert into api_scenario
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
|
@ -197,9 +199,6 @@
|
|||
<if test="schedule != null">
|
||||
schedule,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
|
@ -218,6 +217,9 @@
|
|||
<if test="scenarioDefinition != null">
|
||||
scenario_definition,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
|
@ -259,9 +261,6 @@
|
|||
<if test="schedule != null">
|
||||
#{schedule,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -280,6 +279,9 @@
|
|||
<if test="scenarioDefinition != null">
|
||||
#{scenarioDefinition,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiScenarioExample" resultType="java.lang.Long">
|
||||
|
@ -330,9 +332,6 @@
|
|||
<if test="record.schedule != null">
|
||||
schedule = #{record.schedule,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -351,6 +350,9 @@
|
|||
<if test="record.scenarioDefinition != null">
|
||||
scenario_definition = #{record.scenarioDefinition,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
|
@ -371,13 +373,13 @@
|
|||
step_total = #{record.stepTotal,jdbcType=INTEGER},
|
||||
follow_people = #{record.followPeople,jdbcType=VARCHAR},
|
||||
schedule = #{record.schedule,jdbcType=VARCHAR},
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
pass_rate = #{record.passRate,jdbcType=VARCHAR},
|
||||
last_result = #{record.lastResult,jdbcType=VARCHAR},
|
||||
report_id = #{record.reportId,jdbcType=VARCHAR},
|
||||
scenario_definition = #{record.scenarioDefinition,jdbcType=LONGVARCHAR}
|
||||
scenario_definition = #{record.scenarioDefinition,jdbcType=LONGVARCHAR},
|
||||
description = #{record.description,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
@ -397,7 +399,6 @@
|
|||
step_total = #{record.stepTotal,jdbcType=INTEGER},
|
||||
follow_people = #{record.followPeople,jdbcType=VARCHAR},
|
||||
schedule = #{record.schedule,jdbcType=VARCHAR},
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
pass_rate = #{record.passRate,jdbcType=VARCHAR},
|
||||
|
@ -407,7 +408,7 @@
|
|||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiScenario">
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
|
||||
update api_scenario
|
||||
<set>
|
||||
<if test="projectId != null">
|
||||
|
@ -446,9 +447,6 @@
|
|||
<if test="schedule != null">
|
||||
schedule = #{schedule,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -467,10 +465,13 @@
|
|||
<if test="scenarioDefinition != null">
|
||||
scenario_definition = #{scenarioDefinition,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiScenario">
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
|
||||
update api_scenario
|
||||
set project_id = #{projectId,jdbcType=VARCHAR},
|
||||
tag_id = #{tagId,jdbcType=VARCHAR},
|
||||
|
@ -484,13 +485,13 @@
|
|||
step_total = #{stepTotal,jdbcType=INTEGER},
|
||||
follow_people = #{followPeople,jdbcType=VARCHAR},
|
||||
schedule = #{schedule,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
pass_rate = #{passRate,jdbcType=VARCHAR},
|
||||
last_result = #{lastResult,jdbcType=VARCHAR},
|
||||
report_id = #{reportId,jdbcType=VARCHAR},
|
||||
scenario_definition = #{scenarioDefinition,jdbcType=LONGVARCHAR}
|
||||
scenario_definition = #{scenarioDefinition,jdbcType=LONGVARCHAR},
|
||||
description = #{description,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiScenario">
|
||||
|
@ -507,7 +508,6 @@
|
|||
step_total = #{stepTotal,jdbcType=INTEGER},
|
||||
follow_people = #{followPeople,jdbcType=VARCHAR},
|
||||
schedule = #{schedule,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
pass_rate = #{passRate,jdbcType=VARCHAR},
|
||||
|
|
|
@ -2,9 +2,9 @@ package io.metersphere.base.mapper;
|
|||
|
||||
import io.metersphere.base.domain.ApiScenarioReport;
|
||||
import io.metersphere.base.domain.ApiScenarioReportExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ApiScenarioReportMapper {
|
||||
long countByExample(ApiScenarioReportExample example);
|
||||
|
@ -17,16 +17,21 @@ public interface ApiScenarioReportMapper {
|
|||
|
||||
int insertSelective(ApiScenarioReport record);
|
||||
|
||||
List<ApiScenarioReport> selectByExampleWithBLOBs(ApiScenarioReportExample example);
|
||||
|
||||
List<ApiScenarioReport> selectByExample(ApiScenarioReportExample example);
|
||||
|
||||
ApiScenarioReport selectByPrimaryKey(String id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") ApiScenarioReport record, @Param("example") ApiScenarioReportExample example);
|
||||
|
||||
int updateByExampleWithBLOBs(@Param("record") ApiScenarioReport record, @Param("example") ApiScenarioReportExample example);
|
||||
|
||||
int updateByExample(@Param("record") ApiScenarioReport record, @Param("example") ApiScenarioReportExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(ApiScenarioReport record);
|
||||
|
||||
int updateByPrimaryKey(ApiScenarioReport record);
|
||||
int updateByPrimaryKeyWithBLOBs(ApiScenarioReport record);
|
||||
|
||||
int updateByPrimaryKey(ApiScenarioReport record);
|
||||
}
|
|
@ -5,12 +5,15 @@
|
|||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="trigger_mode" jdbcType="VARCHAR" property="triggerMode" />
|
||||
<result column="execute_type" jdbcType="VARCHAR" property="executeType" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiScenarioReport">
|
||||
<result column="description" jdbcType="LONGVARCHAR" property="description" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
|
@ -71,9 +74,28 @@
|
|||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, project_id, `name`, description, create_time, update_time, `status`, user_id,
|
||||
trigger_mode
|
||||
id, project_id, `name`, create_time, update_time, `status`, user_id, trigger_mode,
|
||||
execute_type
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
description
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiScenarioReportExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from api_scenario_report
|
||||
<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.ApiScenarioReportExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
|
@ -88,9 +110,11 @@
|
|||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from api_scenario_report
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
@ -106,13 +130,13 @@
|
|||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.ApiScenarioReport">
|
||||
insert into api_scenario_report (id, project_id, `name`,
|
||||
description, create_time, update_time,
|
||||
`status`, user_id, trigger_mode
|
||||
)
|
||||
create_time, update_time, `status`,
|
||||
user_id, trigger_mode, execute_type,
|
||||
description)
|
||||
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||
#{status,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{triggerMode,jdbcType=VARCHAR}
|
||||
)
|
||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR},
|
||||
#{userId,jdbcType=VARCHAR}, #{triggerMode,jdbcType=VARCHAR}, #{executeType,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiScenarioReport">
|
||||
insert into api_scenario_report
|
||||
|
@ -126,9 +150,6 @@
|
|||
<if test="name != null">
|
||||
`name`,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
|
@ -144,6 +165,12 @@
|
|||
<if test="triggerMode != null">
|
||||
trigger_mode,
|
||||
</if>
|
||||
<if test="executeType != null">
|
||||
execute_type,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
|
@ -155,9 +182,6 @@
|
|||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -173,6 +197,12 @@
|
|||
<if test="triggerMode != null">
|
||||
#{triggerMode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="executeType != null">
|
||||
#{executeType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiScenarioReportExample" resultType="java.lang.Long">
|
||||
|
@ -193,9 +223,6 @@
|
|||
<if test="record.name != null">
|
||||
`name` = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -211,22 +238,44 @@
|
|||
<if test="record.triggerMode != null">
|
||||
trigger_mode = #{record.triggerMode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.executeType != null">
|
||||
execute_type = #{record.executeType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||
update api_scenario_report
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||
`name` = #{record.name,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
trigger_mode = #{record.triggerMode,jdbcType=VARCHAR},
|
||||
execute_type = #{record.executeType,jdbcType=VARCHAR},
|
||||
description = #{record.description,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update api_scenario_report
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||
`name` = #{record.name,jdbcType=VARCHAR},
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
trigger_mode = #{record.triggerMode,jdbcType=VARCHAR}
|
||||
trigger_mode = #{record.triggerMode,jdbcType=VARCHAR},
|
||||
execute_type = #{record.executeType,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
@ -240,9 +289,6 @@
|
|||
<if test="name != null">
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -258,19 +304,38 @@
|
|||
<if test="triggerMode != null">
|
||||
trigger_mode = #{triggerMode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="executeType != null">
|
||||
execute_type = #{executeType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiScenarioReport">
|
||||
update api_scenario_report
|
||||
set project_id = #{projectId,jdbcType=VARCHAR},
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
trigger_mode = #{triggerMode,jdbcType=VARCHAR},
|
||||
execute_type = #{executeType,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiScenarioReport">
|
||||
update api_scenario_report
|
||||
set project_id = #{projectId,jdbcType=VARCHAR},
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
trigger_mode = #{triggerMode,jdbcType=VARCHAR}
|
||||
trigger_mode = #{triggerMode,jdbcType=VARCHAR},
|
||||
execute_type = #{executeType,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -1,13 +1,10 @@
|
|||
package io.metersphere.base.mapper;
|
||||
|
||||
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
|
||||
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 org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface ApiTestCaseMapper {
|
||||
long countByExample(ApiTestCaseExample example);
|
||||
|
@ -37,5 +34,4 @@ public interface ApiTestCaseMapper {
|
|||
int updateByPrimaryKeyWithBLOBs(ApiTestCaseWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKey(ApiTestCase record);
|
||||
|
||||
}
|
|
@ -7,13 +7,13 @@
|
|||
<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="description" jdbcType="LONGVARCHAR" property="description" />
|
||||
<result column="request" jdbcType="LONGVARCHAR" property="request" />
|
||||
<result column="response" jdbcType="LONGVARCHAR" property="response" />
|
||||
</resultMap>
|
||||
|
@ -76,11 +76,11 @@
|
|||
</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
|
||||
id, project_id, `name`, priority, api_definition_id, create_user_id, update_user_id,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
request, response
|
||||
description, request, response
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiTestCaseExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
|
@ -132,14 +132,14 @@
|
|||
</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
|
||||
priority, api_definition_id, create_user_id,
|
||||
update_user_id, create_time, update_time,
|
||||
description, 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}
|
||||
#{priority,jdbcType=VARCHAR}, #{apiDefinitionId,jdbcType=VARCHAR}, #{createUserId,jdbcType=VARCHAR},
|
||||
#{updateUserId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||
#{description,jdbcType=LONGVARCHAR}, #{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiTestCaseWithBLOBs">
|
||||
|
@ -160,9 +160,6 @@
|
|||
<if test="apiDefinitionId != null">
|
||||
api_definition_id,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="createUserId != null">
|
||||
create_user_id,
|
||||
</if>
|
||||
|
@ -175,6 +172,9 @@
|
|||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="request != null">
|
||||
request,
|
||||
</if>
|
||||
|
@ -198,9 +198,6 @@
|
|||
<if test="apiDefinitionId != null">
|
||||
#{apiDefinitionId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createUserId != null">
|
||||
#{createUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -213,6 +210,9 @@
|
|||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="request != null">
|
||||
#{request,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -245,9 +245,6 @@
|
|||
<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>
|
||||
|
@ -260,6 +257,9 @@
|
|||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="record.request != null">
|
||||
request = #{record.request,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -278,11 +278,11 @@
|
|||
`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},
|
||||
description = #{record.description,jdbcType=LONGVARCHAR},
|
||||
request = #{record.request,jdbcType=LONGVARCHAR},
|
||||
response = #{record.response,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
|
@ -296,7 +296,6 @@
|
|||
`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},
|
||||
|
@ -320,9 +319,6 @@
|
|||
<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>
|
||||
|
@ -335,6 +331,9 @@
|
|||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="request != null">
|
||||
request = #{request,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -350,11 +349,11 @@
|
|||
`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},
|
||||
description = #{description,jdbcType=LONGVARCHAR},
|
||||
request = #{request,jdbcType=LONGVARCHAR},
|
||||
response = #{response,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
|
@ -365,7 +364,6 @@
|
|||
`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},
|
||||
|
|
|
@ -4,6 +4,7 @@ import io.metersphere.api.dto.automation.ApiScenarioDTO;
|
|||
import io.metersphere.api.dto.automation.ApiScenarioRequest;
|
||||
import io.metersphere.api.dto.dataCount.ApiDataCountResult;
|
||||
import io.metersphere.base.domain.ApiScenario;
|
||||
import io.metersphere.base.domain.ApiScenarioWithBLOBs;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
|
@ -12,9 +13,9 @@ import java.util.List;
|
|||
public interface ExtApiScenarioMapper {
|
||||
List<ApiScenarioDTO> list(@Param("request") ApiScenarioRequest request);
|
||||
|
||||
List<ApiScenario> selectByTagId(@Param("id") String id);
|
||||
List<ApiScenarioWithBLOBs> selectByTagId(@Param("id") String id);
|
||||
|
||||
List<ApiScenario> selectIds(@Param("ids") List<String> ids);
|
||||
List<ApiScenarioWithBLOBs> selectIds(@Param("ids") List<String> ids);
|
||||
|
||||
List<ApiScenario> selectReference(@Param("request") ApiScenarioRequest request);
|
||||
|
||||
|
|
|
@ -61,11 +61,11 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectByTagId" resultType="io.metersphere.base.domain.ApiScenario">
|
||||
<select id="selectByTagId" resultType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
|
||||
select * from api_scenario where tag_id like CONCAT('%', #{id},'%')
|
||||
</select>
|
||||
|
||||
<select id="selectIds" resultType="io.metersphere.base.domain.ApiScenario">
|
||||
<select id="selectIds" resultType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
|
||||
select * from api_scenario where id in
|
||||
<foreach collection="ids" item="v" separator="," open="(" close=")">
|
||||
#{v}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package io.metersphere.base.mapper.ext;
|
||||
|
||||
import io.metersphere.api.dto.APIReportResult;
|
||||
import io.metersphere.api.dto.QueryAPIReportRequest;
|
||||
import io.metersphere.api.dto.automation.APIScenarioReportResult;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
@ -11,7 +10,7 @@ import java.util.List;
|
|||
public interface ExtApiScenarioReportMapper {
|
||||
List<APIScenarioReportResult> list(@Param("request") QueryAPIReportRequest request);
|
||||
|
||||
APIReportResult get(@Param("reportId") String reportId);
|
||||
APIScenarioReportResult get(@Param("reportId") String reportId);
|
||||
|
||||
long countByProjectID(String projectId);
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
AND r.status != 'Debug'
|
||||
AND r.execute_type = 'Saved'
|
||||
</where>
|
||||
<if test="request.orders != null and request.orders.size() > 0">
|
||||
order by
|
||||
|
@ -155,7 +155,7 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="get" resultType="io.metersphere.api.dto.APIReportResult">
|
||||
<select id="get" resultType="io.metersphere.api.dto.automation.APIScenarioReportResult">
|
||||
SELECT r.*,r.id As testId, r.name AS test_name, project.name AS project_name, user.name AS user_name
|
||||
FROM api_scenario_report r
|
||||
LEFT JOIN project ON project.id = r.project_id
|
||||
|
|
|
@ -16,4 +16,5 @@ public class JmeterProperties {
|
|||
|
||||
private String home;
|
||||
|
||||
private String heap = "-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m";
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ public class ShiroConfig implements EnvironmentAware {
|
|||
ShiroUtils.loadBaseFilterChain(filterChainDefinitionMap);
|
||||
filterChainDefinitionMap.put("/display/info", "anon");
|
||||
filterChainDefinitionMap.put("/display/file/**", "anon");
|
||||
filterChainDefinitionMap.put("/jmeter/download/**", "anon");
|
||||
filterChainDefinitionMap.put("/**", "apikey, authc");
|
||||
return shiroFilterFactoryBean;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package io.metersphere.performance.controller;
|
||||
|
||||
|
||||
import io.metersphere.performance.service.JmeterFileService;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("jmeter")
|
||||
public class JmeterFileController {
|
||||
@Resource
|
||||
private JmeterFileService jmeterFileService;
|
||||
|
||||
@GetMapping("download")
|
||||
public ResponseEntity<byte[]> downloadJmeterFiles(@RequestParam("testId") String testId, @RequestParam("resourceId") String resourceId,
|
||||
@RequestParam("ratio") double ratio, @RequestParam("startTime") long startTime,
|
||||
@RequestParam("reportId") String reportId, @RequestParam("resourceIndex") int resourceIndex,
|
||||
@RequestParam("threadNum") int threadNum) {
|
||||
byte[] bytes = jmeterFileService.downloadZip(testId, resourceId, ratio, startTime, reportId, resourceIndex, threadNum);
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.parseMediaType("application/octet-stream"))
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + testId + ".zip\"")
|
||||
.body(bytes);
|
||||
}
|
||||
|
||||
}
|
|
@ -15,7 +15,6 @@ public class EngineContext {
|
|||
private Integer resourceIndex;
|
||||
private Map<String, Object> properties = new HashMap<>();
|
||||
private Map<String, String> testData = new HashMap<>();
|
||||
private Map<String, String> env = new HashMap<>();
|
||||
private Map<String, byte[]> testJars = new HashMap<>();
|
||||
|
||||
public String getTestId() {
|
||||
|
@ -50,14 +49,6 @@ public class EngineContext {
|
|||
this.properties.putAll(props);
|
||||
}
|
||||
|
||||
public Map<String, String> getEnv() {
|
||||
return env;
|
||||
}
|
||||
|
||||
public void setEnv(Map<String, String> env) {
|
||||
this.env = env;
|
||||
}
|
||||
|
||||
public Object getProperty(String key) {
|
||||
return this.properties.get(key);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import io.metersphere.commons.constants.FileType;
|
|||
import io.metersphere.commons.constants.ResourcePoolTypeEnum;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
import io.metersphere.config.KafkaProperties;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.performance.engine.docker.DockerTestEngine;
|
||||
import io.metersphere.performance.parse.EngineSourceParser;
|
||||
|
@ -34,7 +33,6 @@ import java.util.stream.Collectors;
|
|||
public class EngineFactory {
|
||||
private static FileService fileService;
|
||||
private static TestResourcePoolService testResourcePoolService;
|
||||
private static KafkaProperties kafkaProperties;
|
||||
private static Class<? extends KubernetesTestEngine> kubernetesTestEngineClass;
|
||||
|
||||
static {
|
||||
|
@ -99,13 +97,6 @@ public class EngineFactory {
|
|||
engineContext.setStartTime(startTime);
|
||||
engineContext.setReportId(reportId);
|
||||
engineContext.setResourceIndex(resourceIndex);
|
||||
HashMap<String, String> env = new HashMap<String, String>() {{
|
||||
put("BOOTSTRAP_SERVERS", kafkaProperties.getBootstrapServers());
|
||||
put("LOG_TOPIC", kafkaProperties.getLog().getTopic());
|
||||
put("REPORT_ID", reportId);
|
||||
put("RESOURCE_ID", resourceId);
|
||||
}};
|
||||
engineContext.setEnv(env);
|
||||
|
||||
if (StringUtils.isNotEmpty(loadTest.getLoadConfiguration())) {
|
||||
final JSONArray jsonArray = JSONObject.parseArray(loadTest.getLoadConfiguration());
|
||||
|
@ -197,9 +188,4 @@ public class EngineFactory {
|
|||
public void setTestResourcePoolService(TestResourcePoolService testResourcePoolService) {
|
||||
EngineFactory.testResourcePoolService = testResourcePoolService;
|
||||
}
|
||||
|
||||
@Resource
|
||||
public void setKafkaProperties(KafkaProperties kafkaProperties) {
|
||||
EngineFactory.kafkaProperties = kafkaProperties;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,17 +6,20 @@ import io.metersphere.base.domain.TestResource;
|
|||
import io.metersphere.commons.constants.ResourceStatusEnum;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
import io.metersphere.config.JmeterProperties;
|
||||
import io.metersphere.config.KafkaProperties;
|
||||
import io.metersphere.controller.ResultHolder;
|
||||
import io.metersphere.dto.BaseSystemConfigDTO;
|
||||
import io.metersphere.dto.NodeDTO;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.performance.engine.AbstractEngine;
|
||||
import io.metersphere.performance.engine.EngineContext;
|
||||
import io.metersphere.performance.engine.EngineFactory;
|
||||
import io.metersphere.performance.engine.docker.request.TestRequest;
|
||||
import io.metersphere.performance.engine.request.StartTestRequest;
|
||||
import io.metersphere.service.SystemParameterService;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class DockerTestEngine extends AbstractEngine {
|
||||
|
@ -60,38 +63,40 @@ public class DockerTestEngine extends AbstractEngine {
|
|||
}
|
||||
|
||||
private void runTest(TestResource resource, double ratio, int resourceIndex) {
|
||||
EngineContext context = null;
|
||||
try {
|
||||
context = EngineFactory.createContext(loadTest, resource.getId(), ratio, this.getStartTime(), this.getReportId(), resourceIndex);
|
||||
} catch (MSException e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
MSException.throwException(e);
|
||||
}
|
||||
|
||||
String configuration = resource.getConfiguration();
|
||||
NodeDTO node = JSON.parseObject(configuration, NodeDTO.class);
|
||||
String nodeIp = node.getIp();
|
||||
Integer port = node.getPort();
|
||||
String testId = context.getTestId();
|
||||
String content = context.getContent();
|
||||
|
||||
BaseSystemConfigDTO baseInfo = CommonBeanFactory.getBean(SystemParameterService.class).getBaseInfo();
|
||||
KafkaProperties kafkaProperties = CommonBeanFactory.getBean(KafkaProperties.class);
|
||||
JmeterProperties jmeterProperties = CommonBeanFactory.getBean(JmeterProperties.class);
|
||||
String metersphereUrl = "http://localhost:8081";
|
||||
if (baseInfo != null) {
|
||||
metersphereUrl = baseInfo.getUrl();
|
||||
}
|
||||
|
||||
Map<String, String> env = new HashMap<>();
|
||||
env.put("RATIO", "" + ratio);
|
||||
env.put("RESOURCE_INDEX", "" + resourceIndex);
|
||||
env.put("METERSPHERE_URL", metersphereUrl);
|
||||
env.put("START_TIME", "" + this.getStartTime());
|
||||
env.put("TEST_ID", this.loadTest.getId());
|
||||
env.put("REPORT_ID", this.getReportId());
|
||||
env.put("BOOTSTRAP_SERVERS", kafkaProperties.getBootstrapServers());
|
||||
env.put("LOG_TOPIC", kafkaProperties.getLog().getTopic());
|
||||
env.put("RESOURCE_ID", resource.getId());
|
||||
env.put("THREAD_NUM", "" + threadNum);
|
||||
env.put("HEAP", jmeterProperties.getHeap());
|
||||
|
||||
|
||||
StartTestRequest startTestRequest = new StartTestRequest();
|
||||
startTestRequest.setImage(JMETER_IMAGE);
|
||||
startTestRequest.setEnv(env);
|
||||
|
||||
String uri = String.format(BASE_URL + "/jmeter/container/start", nodeIp, port);
|
||||
|
||||
TestRequest testRequest = new TestRequest();
|
||||
testRequest.setSize(1);
|
||||
testRequest.setTestId(testId);
|
||||
testRequest.setReportId(getReportId());
|
||||
testRequest.setFileString(content);
|
||||
testRequest.setImage(JMETER_IMAGE);
|
||||
testRequest.setTestData(context.getTestData());
|
||||
testRequest.setTestJars(context.getTestJars());
|
||||
testRequest.setEnv(context.getEnv());
|
||||
|
||||
|
||||
ResultHolder result = restTemplate.postForObject(uri, testRequest, ResultHolder.class);
|
||||
ResultHolder result = restTemplate.postForObject(uri, startTestRequest, ResultHolder.class);
|
||||
if (result == null) {
|
||||
MSException.throwException(Translator.get("start_engine_fail"));
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package io.metersphere.performance.engine.docker.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class BaseRequest {
|
||||
private String testId;
|
||||
private String reportId;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package io.metersphere.performance.engine.docker.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class TestRequest extends BaseRequest {
|
||||
private int size;
|
||||
private String fileString;
|
||||
private String image;
|
||||
private Map<String, String> testData = new HashMap<>();
|
||||
private Map<String, String> env = new HashMap<>();
|
||||
private Map<String, byte[]> testJars = new HashMap<>();
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package io.metersphere.performance.engine.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class BaseRequest {
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package io.metersphere.performance.engine.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class StartTestRequest {
|
||||
private String image;
|
||||
private Map<String, String> env = new HashMap<>();
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package io.metersphere.performance.engine.request;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class StopTestRequest {
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
package io.metersphere.performance.service;
|
||||
|
||||
|
||||
import com.alibaba.excel.util.CollectionUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.metersphere.base.domain.LoadTestWithBLOBs;
|
||||
import io.metersphere.base.mapper.LoadTestMapper;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
import io.metersphere.performance.engine.EngineContext;
|
||||
import io.metersphere.performance.engine.EngineFactory;
|
||||
import org.apache.commons.lang3.SerializationUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
@Service
|
||||
public class JmeterFileService {
|
||||
|
||||
@Resource
|
||||
private LoadTestMapper loadTestMapper;
|
||||
|
||||
public byte[] downloadZip(String testId, String resourceId, double ratio, long startTime, String reportId, int resourceIndex, int threadNum) {
|
||||
try {
|
||||
LoadTestWithBLOBs loadTest = loadTestMapper.selectByPrimaryKey(testId);
|
||||
// deep copy
|
||||
LoadTestWithBLOBs subTest = SerializationUtils.clone(loadTest);
|
||||
setThreadNum(subTest, threadNum);
|
||||
EngineContext context = EngineFactory.createContext(subTest, resourceId, ratio, startTime, reportId, resourceIndex);
|
||||
return zipFilesToByteArray(context);
|
||||
} catch (MSException e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
MSException.throwException(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void setThreadNum(LoadTestWithBLOBs t, Integer limit) {
|
||||
String loadConfiguration = t.getLoadConfiguration();
|
||||
JSONArray jsonArray = JSON.parseArray(loadConfiguration);
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
if (jsonArray.get(i) instanceof Map) {
|
||||
JSONObject o = jsonArray.getJSONObject(i);
|
||||
if (StringUtils.equals(o.getString("key"), "TargetLevel")) {
|
||||
o.put("value", limit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (jsonArray.get(i) instanceof List) {
|
||||
JSONArray o = jsonArray.getJSONArray(i);
|
||||
for (int j = 0; j < o.size(); j++) {
|
||||
JSONObject b = o.getJSONObject(j);
|
||||
if (StringUtils.equals(b.getString("key"), "TargetLevel")) {
|
||||
b.put("value", limit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 设置线程数
|
||||
t.setLoadConfiguration(jsonArray.toJSONString());
|
||||
}
|
||||
|
||||
private byte[] zipFilesToByteArray(EngineContext context) throws IOException {
|
||||
String testId = context.getTestId();
|
||||
String fileName = testId + ".jmx";
|
||||
|
||||
Map<String, byte[]> files = new HashMap<>();
|
||||
|
||||
// 每个测试生成一个文件夹
|
||||
files.put(fileName, context.getContent().getBytes(StandardCharsets.UTF_8));
|
||||
// 保存测试数据文件
|
||||
Map<String, String> testData = context.getTestData();
|
||||
if (!CollectionUtils.isEmpty(testData)) {
|
||||
for (String k : testData.keySet()) {
|
||||
String v = testData.get(k);
|
||||
files.put("k", v.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
||||
|
||||
// 保存 byte[] jar
|
||||
Map<String, byte[]> jarFiles = context.getTestJars();
|
||||
if (!CollectionUtils.isEmpty(jarFiles)) {
|
||||
for (String k : jarFiles.keySet()) {
|
||||
byte[] v = jarFiles.get(k);
|
||||
files.put("k", v);
|
||||
}
|
||||
}
|
||||
|
||||
return listBytesToZip(files);
|
||||
}
|
||||
|
||||
|
||||
private byte[] listBytesToZip(Map<String, byte[]> mapReport) throws IOException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ZipOutputStream zos = new ZipOutputStream(baos);
|
||||
for (Map.Entry<String, byte[]> report : mapReport.entrySet()) {
|
||||
ZipEntry entry = new ZipEntry(report.getKey());
|
||||
entry.setSize(report.getValue().length);
|
||||
zos.putNextEntry(entry);
|
||||
zos.write(report.getValue());
|
||||
}
|
||||
zos.closeEntry();
|
||||
zos.close();
|
||||
return baos.toByteArray();
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit b5643ac73fb4a2db3f11b23a81848990d8e78703
|
||||
Subproject commit 9f4a9bbf46fc1333dbcccea21f83e27e3ec10b1f
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE api_scenario_report ADD execute_type varchar(200) NULL;
|
||||
ALTER TABLE api_definition MODIFY COLUMN description LONGTEXT NULL COMMENT 'Test description';
|
||||
ALTER TABLE api_test_case MODIFY COLUMN description LONGTEXT NULL COMMENT 'Test case description';
|
||||
ALTER TABLE api_scenario MODIFY COLUMN description LONGTEXT NULL COMMENT 'Api scenario description';
|
||||
ALTER TABLE api_scenario_report MODIFY COLUMN description LONGTEXT NULL COMMENT 'Api scenario report description';
|
|
@ -103,6 +103,7 @@
|
|||
if (this.isNotRunning) {
|
||||
try {
|
||||
this.content = JSON.parse(this.report.content);
|
||||
this.$emit('refresh');
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<el-col :span="5">
|
||||
<el-tooltip effect="dark" :content="request.responseResult.responseCode" placement="bottom" :open-delay="800">
|
||||
<div style="color: #5daf34" v-if="request.responseResult.responseCode==='200'">{{ request.responseResult.responseCode }}</div>
|
||||
<div style="color: #5daf34" v-if="request.success">{{ request.responseResult.responseCode }}</div>
|
||||
<div style="color: #FE6F71" v-else>{{ request.responseResult.responseCode }}</div>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
let scenarioIds = this.selection;
|
||||
run.id = getUUID();
|
||||
run.scenarioIds = scenarioIds;
|
||||
run.projectId = getCurrentProjectID();
|
||||
this.$post(url, run, response => {
|
||||
let data = response.data;
|
||||
this.runVisible = true;
|
||||
|
@ -233,6 +234,7 @@
|
|||
let scenarioIds = [];
|
||||
scenarioIds.push(row.id);
|
||||
run.id = getUUID();
|
||||
run.projectId = getCurrentProjectID();
|
||||
run.scenarioIds = scenarioIds;
|
||||
this.$post(url, run, response => {
|
||||
let data = response.data;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div></div>
|
||||
</template>
|
||||
<script>
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
import {getUUID, getCurrentProjectID} from "@/common/js/utils";
|
||||
import {createComponent} from "../../definition/components/jmeter/components";
|
||||
|
||||
export default {
|
||||
|
@ -96,7 +96,7 @@
|
|||
threadGroup.enableCookieShare = this.runData.enableCookieShare;
|
||||
threadGroup.hashTree.push(this.runData);
|
||||
testPlan.hashTree.push(threadGroup);
|
||||
let reqObj = {id: this.reportId, reportId: this.reportId, environmentId: this.environment, testElement: testPlan};
|
||||
let reqObj = {id: this.reportId, reportId: this.reportId, environmentId: this.environment, testElement: testPlan, projectId: getCurrentProjectID()};
|
||||
let bodyFiles = this.getBodyUploadFiles(reqObj);
|
||||
let url = "/api/automation/run/debug";
|
||||
this.$fileUpload(url, null, bodyFiles, reqObj, response => {
|
||||
|
|
|
@ -1,124 +1,127 @@
|
|||
<template>
|
||||
<el-card class="card-content">
|
||||
<div class="ms-main-div" @click="showAll">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<!--操作按钮-->
|
||||
<div class="ms-opt-btn">
|
||||
<el-button type="primary" size="small" @click="editScenario">{{$t('commons.save')}}</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="tip">{{$t('test_track.plan_view.base_info')}}</div>
|
||||
<el-form :model="currentScenario" label-position="right" label-width="80px" size="small" :rules="rules" ref="currentScenario" style="margin-right: 20px">
|
||||
<!-- 基础信息 -->
|
||||
<div>
|
||||
<div class="ms-main-div" @click="showAll">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('commons.name')" prop="name">
|
||||
<el-input class="ms-scenario-input" size="small" v-model="currentScenario.name"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.module.module')" prop="apiScenarioModuleId">
|
||||
<el-select class="ms-scenario-input" size="small" v-model="currentScenario.apiScenarioModuleId">
|
||||
<el-option v-for="item in moduleOptions" :key="item.id" :label="item.path" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-col>
|
||||
<!--操作按钮-->
|
||||
<div class="ms-opt-btn">
|
||||
<el-button type="primary" size="small" @click="editScenario">{{$t('commons.save')}}</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('commons.status')" prop="status">
|
||||
<el-select class="ms-scenario-input" size="small" v-model="currentScenario.status">
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('api_test.definition.request.responsible')" prop="principal">
|
||||
<el-select v-model="currentScenario.principal"
|
||||
:placeholder="$t('api_test.definition.request.responsible')" filterable size="small"
|
||||
class="ms-scenario-input">
|
||||
<el-option
|
||||
v-for="item in maintainerOptions"
|
||||
:key="item.id"
|
||||
:label="item.id + ' (' + item.name + ')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div class="tip">{{$t('test_track.plan_view.base_info')}}</div>
|
||||
<el-form :model="currentScenario" label-position="right" label-width="80px" size="small" :rules="rules" ref="currentScenario" style="margin-right: 20px">
|
||||
<!-- 基础信息 -->
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('commons.name')" prop="name">
|
||||
<el-input class="ms-scenario-input" size="small" v-model="currentScenario.name"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.module.module')" prop="apiScenarioModuleId">
|
||||
<el-select class="ms-scenario-input" size="small" v-model="currentScenario.apiScenarioModuleId">
|
||||
<el-option v-for="item in moduleOptions" :key="item.id" :label="item.path" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('commons.status')" prop="status">
|
||||
<el-select class="ms-scenario-input" size="small" v-model="currentScenario.status">
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('api_test.definition.request.responsible')" prop="principal">
|
||||
<el-select v-model="currentScenario.principal"
|
||||
:placeholder="$t('api_test.definition.request.responsible')" filterable size="small"
|
||||
class="ms-scenario-input">
|
||||
<el-option
|
||||
v-for="item in maintainerOptions"
|
||||
:key="item.id"
|
||||
:label="item.id + ' (' + item.name + ')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.case.priority')" prop="level">
|
||||
<el-select class="ms-scenario-input" size="small" v-model="currentScenario.level">
|
||||
<el-option v-for="item in levels" :key="item.id" :label="item.label" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('api_test.automation.follow_people')" prop="followPeople">
|
||||
<el-select v-model="currentScenario.followPeople"
|
||||
:placeholder="$t('api_test.automation.follow_people')" filterable size="small"
|
||||
class="ms-scenario-input">
|
||||
<el-option
|
||||
v-for="item in maintainerOptions"
|
||||
:key="item.id"
|
||||
:label="item.id + ' (' + item.name + ')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.case.priority')" prop="level">
|
||||
<el-select class="ms-scenario-input" size="small" v-model="currentScenario.level">
|
||||
<el-option v-for="item in levels" :key="item.id" :label="item.label" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('api_test.automation.follow_people')" prop="followPeople">
|
||||
<el-select v-model="currentScenario.followPeople"
|
||||
:placeholder="$t('api_test.automation.follow_people')" filterable size="small"
|
||||
class="ms-scenario-input">
|
||||
<el-option
|
||||
v-for="item in maintainerOptions"
|
||||
:key="item.id"
|
||||
:label="item.id + ' (' + item.name + ')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="Tag" prop="tagId">
|
||||
<el-select v-model="currentScenario.tagId" size="small" class="ms-scenario-input" placeholder="Tag" :multiple="true">
|
||||
<el-option
|
||||
v-for="item in tags"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
<el-button size="mini" type="primary" @click="openTagConfig" class="ms-scenario-button">
|
||||
{{ $t('api_test.automation.create_tag') }}
|
||||
</el-button>
|
||||
<template v-slot:empty>
|
||||
<div>
|
||||
<el-button size="mini" type="primary" @click="openTagConfig" class="ms-scenario-button">
|
||||
{{ $t('api_test.automation.create_tag') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-select>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="Tag" prop="tagId">
|
||||
<el-select v-model="currentScenario.tagId" size="small" class="ms-scenario-input" placeholder="Tag" :multiple="true">
|
||||
<el-option
|
||||
v-for="item in tags"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"/>
|
||||
<el-button size="mini" type="primary" @click="openTagConfig" class="ms-scenario-button">
|
||||
{{ $t('api_test.automation.create_tag') }}
|
||||
</el-button>
|
||||
<template v-slot:empty>
|
||||
<div>
|
||||
<el-button size="mini" type="primary" @click="openTagConfig" class="ms-scenario-button">
|
||||
{{ $t('api_test.automation.create_tag') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('commons.description')" prop="description">
|
||||
<el-input class="ms-http-textarea"
|
||||
v-model="currentScenario.description"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 10}"
|
||||
:rows="2" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('commons.description')" prop="description">
|
||||
<el-input class="ms-http-textarea"
|
||||
v-model="currentScenario.description"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 10}"
|
||||
:rows="2" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- 场景步骤-->
|
||||
<div v-loading="loading">
|
||||
<p class="tip">{{$t('api_test.automation.scenario_step')}} </p>
|
||||
<div @click="showAll">
|
||||
<p class="tip">{{$t('api_test.automation.scenario_step')}} </p>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="21">
|
||||
<!-- 调试部分 -->
|
||||
<div class="ms-debug-div">
|
||||
<div class="ms-debug-div" @click="showAll">
|
||||
<el-row style="margin: 5px">
|
||||
<el-col :span="6" class="ms-col-one">
|
||||
{{currentScenario.name ===undefined || ''? $t('api_test.scenario.name') : currentScenario.name}}
|
||||
|
|
|
@ -78,10 +78,10 @@
|
|||
|
||||
<!-- 测试-->
|
||||
<div v-else-if="item.type=== 'TEST'" class="ms-api-div">
|
||||
<ms-run-test-http-page :currentProtocol="currentProtocol" :api-data="runTestData" @saveAsApi="editApi" v-if="currentProtocol==='HTTP'"/>
|
||||
<ms-run-test-tcp-page :currentProtocol="currentProtocol" :api-data="runTestData" @saveAsApi="editApi" v-if="currentProtocol==='TCP'"/>
|
||||
<ms-run-test-sql-page :currentProtocol="currentProtocol" :api-data="runTestData" @saveAsApi="editApi" v-if="currentProtocol==='SQL'"/>
|
||||
<ms-run-test-dubbo-page :currentProtocol="currentProtocol" :api-data="runTestData" @saveAsApi="editApi" v-if="currentProtocol==='DUBBO'"/>
|
||||
<ms-run-test-http-page :currentProtocol="currentProtocol" :api-data="item.api" @saveAsApi="editApi" v-if="currentProtocol==='HTTP'"/>
|
||||
<ms-run-test-tcp-page :currentProtocol="currentProtocol" :api-data="item.api" @saveAsApi="editApi" v-if="currentProtocol==='TCP'"/>
|
||||
<ms-run-test-sql-page :currentProtocol="currentProtocol" :api-data="item.api" @saveAsApi="editApi" v-if="currentProtocol==='SQL'"/>
|
||||
<ms-run-test-dubbo-page :currentProtocol="currentProtocol" :api-data="item.api" @saveAsApi="editApi" v-if="currentProtocol==='DUBBO'"/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
@ -144,7 +144,6 @@
|
|||
selectNodeIds: [],
|
||||
currentApi: {},
|
||||
moduleOptions: {},
|
||||
runTestData: {},
|
||||
trashEnable: false,
|
||||
apiTabs: [{
|
||||
title: this.$t('api_test.definition.api_title'),
|
||||
|
@ -260,18 +259,17 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
this.runTestData = data;
|
||||
},
|
||||
runTest(data) {
|
||||
this.setTabTitle(data);
|
||||
this.handleCommand("TEST");
|
||||
this.handleTabsEdit(this.$t("commons.api"), "TEST", data);
|
||||
},
|
||||
saveApi(data) {
|
||||
this.setTabTitle(data);
|
||||
this.$refs.apiList[0].initTable(data);
|
||||
},
|
||||
|
||||
showExecResult(row){
|
||||
showExecResult(row) {
|
||||
this.debug(row);
|
||||
},
|
||||
|
||||
|
|
|
@ -63,35 +63,7 @@
|
|||
this.initHttp();
|
||||
break;
|
||||
}
|
||||
if (this.currentApi.response != null && this.currentApi.response != 'null' && this.currentApi.response != undefined) {
|
||||
if (Object.prototype.toString.call(this.currentApi.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') {
|
||||
this.response = this.currentApi.response;
|
||||
} else {
|
||||
this.response = JSON.parse(this.currentApi.response);
|
||||
}
|
||||
} else {
|
||||
this.response = {headers: [], body: new Body(), statusCode: [], type: "HTTP"};
|
||||
}
|
||||
if (this.currentApi != null && this.currentApi.id != null) {
|
||||
this.reqUrl = "/api/definition/update";
|
||||
} else {
|
||||
this.reqUrl = "/api/definition/create";
|
||||
}
|
||||
if (!this.request.hashTree) {
|
||||
this.request.hashTree = [];
|
||||
}
|
||||
// 处理导入数据缺失问题
|
||||
if (this.response.body) {
|
||||
let body = new Body();
|
||||
Object.assign(body, this.response.body);
|
||||
if (!body.binary) {
|
||||
body.binary = [];
|
||||
}
|
||||
if (!body.kvs) {
|
||||
body.kvs = [];
|
||||
}
|
||||
this.response.body = body;
|
||||
}
|
||||
this.formatApi();
|
||||
},
|
||||
methods: {
|
||||
runTest(data) {
|
||||
|
@ -145,6 +117,40 @@
|
|||
this.currentApi.request = this.request;
|
||||
}
|
||||
},
|
||||
formatApi() {
|
||||
if (this.currentApi.response != null && this.currentApi.response != 'null' && this.currentApi.response != undefined) {
|
||||
if (Object.prototype.toString.call(this.currentApi.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') {
|
||||
this.response = this.currentApi.response;
|
||||
} else {
|
||||
this.response = JSON.parse(this.currentApi.response);
|
||||
}
|
||||
} else {
|
||||
this.response = {headers: [], body: new Body(), statusCode: [], type: "HTTP"};
|
||||
}
|
||||
if (this.currentApi != null && this.currentApi.id != null) {
|
||||
this.reqUrl = "/api/definition/update";
|
||||
} else {
|
||||
this.reqUrl = "/api/definition/create";
|
||||
}
|
||||
if (!this.request.hashTree) {
|
||||
this.request.hashTree = [];
|
||||
}
|
||||
// 处理导入数据缺失问题
|
||||
if (this.response.body) {
|
||||
let body = new Body();
|
||||
Object.assign(body, this.response.body);
|
||||
if (!body.binary) {
|
||||
body.binary = [];
|
||||
}
|
||||
if (!body.kvs) {
|
||||
body.kvs = [];
|
||||
}
|
||||
this.response.body = body;
|
||||
}
|
||||
if (this.currentApi.moduleId && this.currentApi.moduleId === "root") {
|
||||
this.currentApi.moduleId = "";
|
||||
}
|
||||
},
|
||||
saveApi(data) {
|
||||
this.setParameters(data);
|
||||
let bodyFiles = this.getBodyUploadFiles(data);
|
||||
|
|
|
@ -72,8 +72,14 @@
|
|||
},
|
||||
},
|
||||
data() {
|
||||
let validateURL = (rule, value, callback) => {
|
||||
if (!this.httpForm.path.startsWith("/") || this.httpForm.path.match(/\s/) != null) {
|
||||
callback(this.$t('api_test.definition.request.path_valid_info'));
|
||||
}
|
||||
callback();
|
||||
};
|
||||
return {
|
||||
httpForm: {},
|
||||
httpForm: {environmentId: ""},
|
||||
httpVisible: false,
|
||||
currentModule: {},
|
||||
maintainerOptions: [],
|
||||
|
@ -82,7 +88,7 @@
|
|||
{required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'},
|
||||
{max: 50, message: this.$t('test_track.length_less_than') + '50', trigger: 'blur'}
|
||||
],
|
||||
path: [{required: true, message: this.$t('api_test.definition.request.path_info'), trigger: 'blur'}],
|
||||
path: [{required: true, message: this.$t('api_test.definition.request.path_info'), trigger: 'blur'}, {validator: validateURL, trigger: 'blur'}],
|
||||
userId: [{required: true, message: this.$t('test_track.case.input_maintainer'), trigger: 'change'}],
|
||||
},
|
||||
value: REQ_METHOD[0].id,
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
moduleId: [{required: true, message: this.$t('test_track.case.input_module'), trigger: 'change'}],
|
||||
status: [{required: true, message: this.$t('commons.please_select'), trigger: 'change'}],
|
||||
},
|
||||
httpForm: {},
|
||||
httpForm: {environmentId: ""},
|
||||
isShowEnable: false,
|
||||
maintainerOptions: [],
|
||||
currentModule: {},
|
||||
|
@ -173,6 +173,9 @@
|
|||
|
||||
created() {
|
||||
this.getMaintainerOptions();
|
||||
if (!this.basisData.environmentId) {
|
||||
this.basisData.environmentId = "";
|
||||
}
|
||||
this.httpForm = JSON.parse(JSON.stringify(this.basisData));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<el-form-item :label="$t('api_report.request')" prop="url">
|
||||
<el-input :placeholder="$t('api_test.definition.request.path_all_info')" v-model="debugForm.url"
|
||||
class="ms-http-input" size="small">
|
||||
class="ms-http-input" size="small" :disabled="testCase!=undefined">
|
||||
<el-select v-model="debugForm.method" slot="prepend" style="width: 100px" size="small">
|
||||
<el-option v-for="item in reqOptions" :key="item.id" :label="item.label" :value="item.id"/>
|
||||
</el-select>
|
||||
|
@ -16,7 +16,7 @@
|
|||
|
||||
<el-form-item>
|
||||
<el-dropdown split-button type="primary" class="ms-api-buttion" @click="handleCommand"
|
||||
@command="handleCommand" size="small">
|
||||
@command="handleCommand" size="small" v-if="testCase===undefined">
|
||||
{{$t('commons.test')}}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="save_as">{{$t('api_test.definition.request.save_as')}}</el-dropdown-item>
|
||||
|
|
|
@ -844,6 +844,7 @@ export class JSR223Processor extends BaseConfig {
|
|||
this.script = undefined;
|
||||
this.language = "beanshell";
|
||||
this.enable = true;
|
||||
this.hashTree = [];
|
||||
this.set(options);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ export default {
|
|||
try {
|
||||
this.content = JSON.parse(this.report.content);
|
||||
} catch (e) {
|
||||
// console.log(this.report.content)
|
||||
// console.log(this.report.scenarioDefinition)
|
||||
throw e;
|
||||
}
|
||||
this.getFails();
|
||||
|
|
|
@ -47,9 +47,7 @@
|
|||
},
|
||||
methods: {
|
||||
handleSelect(index) {
|
||||
console.log(index)
|
||||
this.activeIndex = index
|
||||
|
||||
},
|
||||
active() {
|
||||
if (this.activeIndex === '/api') {
|
||||
|
|
|
@ -158,7 +158,7 @@ export default {
|
|||
interval: yAxisListMax / 5
|
||||
},
|
||||
{
|
||||
name: 'Hits/s',
|
||||
name: 'Transactions/s',
|
||||
type: 'value',
|
||||
splitNumber: 5,
|
||||
min: 0,
|
||||
|
|
|
@ -70,13 +70,6 @@
|
|||
</el-form-item>
|
||||
<div v-for="(item,index) in infoList " :key="index">
|
||||
<div class="node-line" v-if="form.type === 'K8S'" v-xpack>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item prop="controllerUrl" label="Controller URL">
|
||||
<el-input v-model="item.controllerUrl" autocomplete="new-password"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item prop="masterUrl" label="Master URL">
|
||||
|
@ -164,13 +157,6 @@
|
|||
</el-form-item>
|
||||
<div v-for="(item,index) in infoList " :key="index">
|
||||
<div class="node-line" v-if="form.type === 'K8S'" v-xpack>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item prop="controllerUrl" label="Controller URL">
|
||||
<el-input v-model="item.controllerUrl" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item prop="masterUrl" label="Master URL">
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<review-comment-item v-for="(comment,index) in comments"
|
||||
:key="index"
|
||||
:comment="comment"
|
||||
:read-only="readOnly"
|
||||
@refresh="getComments()"/>
|
||||
<div v-if="comments.length === 0" style="text-align: center">
|
||||
<i class="el-icon-chat-line-square" style="font-size: 15px;color: #8a8b8d;">
|
||||
|
@ -31,6 +32,10 @@ export default {
|
|||
caseId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
readOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -1,163 +1,174 @@
|
|||
<template>
|
||||
<el-form :model="form" ref="caseFrom" v-loading="result.loading">
|
||||
<el-row :gutter="5">
|
||||
<el-col :span="16">
|
||||
<el-card class="case-detail-form-card">
|
||||
<el-form :model="form" ref="caseFrom" v-loading="result.loading">
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-form-item
|
||||
:placeholder="$t('test_track.case.input_name')"
|
||||
:label="$t('test_track.case.name')"
|
||||
:label-width="formLabelWidth"
|
||||
prop="name">
|
||||
<el-input class="case-name" :disabled="readOnly" v-model="testCase.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-row>
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-form-item
|
||||
:placeholder="$t('test_track.case.input_name')"
|
||||
:label="$t('test_track.case.name')"
|
||||
:label-width="formLabelWidth"
|
||||
prop="name">
|
||||
<el-input class="case-name" :disabled="readOnly" v-model="testCase.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.case.module')" :label-width="formLabelWidth" prop="module">
|
||||
<el-input class="case-name" :disabled="readOnly" v-model="testCase.nodePath"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.case.module')" :label-width="formLabelWidth" prop="module">
|
||||
<el-input class="case-name" :disabled="readOnly" v-model="testCase.nodePath"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-form-item :label="$t('test_track.case.maintainer')" :label-width="formLabelWidth" prop="maintainer">
|
||||
<el-select :disabled="readOnly" v-model="testCase.maintainer"
|
||||
:placeholder="$t('test_track.case.input_maintainer')" filterable>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.case.priority')" :label-width="formLabelWidth" prop="priority">
|
||||
<el-select :disabled="readOnly" v-model="testCase.priority" clearable
|
||||
:placeholder="$t('test_track.case.input_priority')">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-form-item :label="$t('test_track.case.maintainer')" :label-width="formLabelWidth" prop="maintainer">
|
||||
<el-select :disabled="readOnly" v-model="testCase.maintainer"
|
||||
:placeholder="$t('test_track.case.input_maintainer')" filterable>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.case.priority')" :label-width="formLabelWidth" prop="priority">
|
||||
<el-select :disabled="readOnly" v-model="testCase.priority" clearable
|
||||
:placeholder="$t('test_track.case.input_priority')">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-form-item :label="$t('test_track.case.type')" :label-width="formLabelWidth" prop="type">
|
||||
<el-select :disabled="readOnly" v-model="testCase.type"
|
||||
:placeholder="$t('test_track.case.input_type')">
|
||||
<el-option :label="$t('commons.functional')" value="functional"></el-option>
|
||||
<el-option :label="$t('commons.performance')" value="performance"></el-option>
|
||||
<el-option :label="$t('commons.api')" value="api"></el-option>
|
||||
</el-select>
|
||||
<el-row>
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-form-item :label="$t('test_track.case.type')" :label-width="formLabelWidth" prop="type">
|
||||
<el-select :disabled="readOnly" v-model="testCase.type"
|
||||
:placeholder="$t('test_track.case.input_type')">
|
||||
<el-option :label="$t('commons.functional')" value="functional"></el-option>
|
||||
<el-option :label="$t('commons.performance')" value="performance"></el-option>
|
||||
<el-option :label="$t('commons.api')" value="api"></el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.case.method')" :label-width="formLabelWidth" prop="method">
|
||||
<el-select :disabled="readOnly" v-model="testCase.method" :placeholder="$t('test_track.case.input_method')">
|
||||
<el-option :label="$t('test_track.case.auto')" value="auto"></el-option>
|
||||
<el-option :label="$t('test_track.case.manual')" value="manual"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('test_track.case.method')" :label-width="formLabelWidth" prop="method">
|
||||
<el-select :disabled="readOnly" v-model="testCase.method" :placeholder="$t('test_track.case.input_method')">
|
||||
<el-option :label="$t('test_track.case.auto')" value="auto"></el-option>
|
||||
<el-option :label="$t('test_track.case.manual')" value="manual"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="testCase.method && testCase.method == 'auto'">
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-form-item :label="$t('test_track.case.relate_test')" :label-width="formLabelWidth" prop="testId">
|
||||
<el-select filterable :disabled="readOnly" v-model="testCase.testId"
|
||||
:placeholder="$t('test_track.case.input_type')">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="testCase.testId=='other'">
|
||||
<el-form-item :label="$t('test_track.case.test_name')" :label-width="formLabelWidth" prop="testId">
|
||||
<el-input v-model="testCase.otherTestName" :placeholder="$t('test_track.case.input_test_case')"
|
||||
:disabled="readOnly"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 15px;">
|
||||
<el-col :offset="1">{{ $t('test_track.case.prerequisite') }}:</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" style="margin-top: 10px;">
|
||||
<el-col :span="22">
|
||||
<el-form-item prop="prerequisite">
|
||||
<el-input :disabled="readOnly" v-model="testCase.prerequisite"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
:rows="2"
|
||||
:placeholder="$t('test_track.case.input_prerequisite')"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="testCase.method && testCase.method == 'auto'">
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-form-item :label="$t('test_track.case.relate_test')" :label-width="formLabelWidth" prop="testId">
|
||||
<el-select filterable :disabled="readOnly" v-model="testCase.testId"
|
||||
:placeholder="$t('test_track.case.input_type')">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="testCase.testId=='other'">
|
||||
<el-form-item :label="$t('test_track.case.test_name')" :label-width="formLabelWidth" prop="testId">
|
||||
<el-input v-model="testCase.otherTestName" :placeholder="$t('test_track.case.input_test_case')"
|
||||
:disabled="readOnly"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 15px;">
|
||||
<el-col :offset="1">{{ $t('test_track.case.prerequisite') }}:</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" style="margin-top: 10px;">
|
||||
<el-col :span="22">
|
||||
<el-form-item prop="prerequisite">
|
||||
<el-input :disabled="readOnly" v-model="testCase.prerequisite"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
:rows="2"
|
||||
:placeholder="$t('test_track.case.input_prerequisite')"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="testCase.method && testCase.method != 'auto'" style="margin-bottom: 10px">
|
||||
<el-col :offset="1">{{ $t('test_track.case.steps') }}:</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="testCase.method && testCase.method != 'auto'" style="margin-bottom: 10px">
|
||||
<el-col :offset="1">{{ $t('test_track.case.steps') }}:</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="testCase.method && testCase.method != 'auto'" type="flex" justify="center">
|
||||
<el-col :span="22">
|
||||
<el-table
|
||||
v-if="isStepTableAlive"
|
||||
:data="JSON.parse(testCase.steps)"
|
||||
class="tb-edit"
|
||||
border
|
||||
size="mini"
|
||||
:default-sort="{prop: 'num', order: 'ascending'}"
|
||||
highlight-current-row>
|
||||
<el-table-column :label="$t('test_track.case.number')" prop="num" min-width="15%"></el-table-column>
|
||||
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="35%">
|
||||
<template v-slot:default="scope">
|
||||
<el-input
|
||||
class="table-edit-input"
|
||||
<el-row v-if="testCase.method && testCase.method != 'auto'" type="flex" justify="center">
|
||||
<el-col :span="22">
|
||||
<el-table
|
||||
v-if="isStepTableAlive"
|
||||
:data="JSON.parse(testCase.steps)"
|
||||
class="tb-edit"
|
||||
border
|
||||
size="mini"
|
||||
:disabled="readOnly"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 1, maxRows: 6}"
|
||||
:rows="2"
|
||||
v-model="scope.row.desc"
|
||||
:placeholder="$t('commons.input_content')"
|
||||
clearable/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="35%">
|
||||
<template v-slot:default="scope">
|
||||
<el-input
|
||||
class="table-edit-input"
|
||||
size="mini"
|
||||
:disabled="readOnly"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 1, maxRows: 6}"
|
||||
:rows="2"
|
||||
v-model="scope.row.result"
|
||||
:placeholder="$t('commons.input_content')"
|
||||
clearable/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
:default-sort="{prop: 'num', order: 'ascending'}"
|
||||
highlight-current-row>
|
||||
<el-table-column :label="$t('test_track.case.number')" prop="num" min-width="15%"></el-table-column>
|
||||
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="35%">
|
||||
<template v-slot:default="scope">
|
||||
<el-input
|
||||
class="table-edit-input"
|
||||
size="mini"
|
||||
:disabled="readOnly"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 1, maxRows: 6}"
|
||||
:rows="2"
|
||||
v-model="scope.row.desc"
|
||||
:placeholder="$t('commons.input_content')"
|
||||
clearable/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="35%">
|
||||
<template v-slot:default="scope">
|
||||
<el-input
|
||||
class="table-edit-input"
|
||||
size="mini"
|
||||
:disabled="readOnly"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 1, maxRows: 6}"
|
||||
:rows="2"
|
||||
v-model="scope.row.result"
|
||||
:placeholder="$t('commons.input_content')"
|
||||
clearable/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="margin-top: 15px;margin-bottom: 10px">
|
||||
<el-col :offset="1">{{ $t('commons.remark') }}:</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-col :span="22">
|
||||
<el-form-item prop="remark">
|
||||
<el-input v-model="testCase.remark"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
type="textarea"
|
||||
:disabled="readOnly"
|
||||
:rows="2"
|
||||
:placeholder="$t('commons.input_content')"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row style="margin-top: 15px;margin-bottom: 10px">
|
||||
<el-col :offset="1">{{ $t('commons.remark') }}:</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-col :span="22">
|
||||
<el-form-item prop="remark">
|
||||
<el-input v-model="testCase.remark"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
type="textarea"
|
||||
:disabled="readOnly"
|
||||
:rows="2"
|
||||
:placeholder="$t('commons.input_content')"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<case-comment :case-id="testCaseId" :read-only="true"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CaseComment from "@/business/components/track/case/components/CaseComment";
|
||||
export default {
|
||||
name: "TestCaseDetail",
|
||||
components: {CaseComment},
|
||||
data() {
|
||||
return {
|
||||
result: {},
|
||||
|
@ -206,5 +217,12 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
.case-detail-form-card {
|
||||
height: 600px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.case-detail-form-card >>> .el-card__body {
|
||||
padding: 20px 28px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<el-popover
|
||||
placement="right-end"
|
||||
:title="$t('test_track.case.view_case')"
|
||||
width="60%"
|
||||
width="70%"
|
||||
trigger="hover"
|
||||
>
|
||||
<test-case-detail v-if="currentCaseId === scope.row.id" :test-case-id="currentCaseId"/>
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
{{ comment.createTime | timestampFormatDate }}
|
||||
</span>
|
||||
<span class="comment-delete">
|
||||
<i class="el-icon-edit" style="font-size: 9px;margin-right: 6px;" @click="openEdit"/>
|
||||
<i class="el-icon-close" @click="deleteComment"/>
|
||||
<el-link icon="el-icon-edit" style="font-size: 9px;margin-right: 6px;" @click="openEdit" :disabled="readOnly"/>
|
||||
<el-link icon="el-icon-close" @click="deleteComment" :disabled="readOnly"/>
|
||||
</span>
|
||||
<br/>
|
||||
<div class="comment-desc" style="font-size: 10px;color: #303133">
|
||||
|
@ -50,7 +50,11 @@ export default {
|
|||
name: "ReviewCommentItem",
|
||||
components: {MsDialogFooter},
|
||||
props: {
|
||||
comment: Object
|
||||
comment: Object,
|
||||
readOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue