diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index d5f9b0b7ec..ba511fa454 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -3,12 +3,12 @@ package io.metersphere.api.controller; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.api.dto.*; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; -import io.metersphere.api.dto.dataCount.ExecutedCaseInfoResult; -import io.metersphere.api.dto.dataCount.request.ScheduleInfoRequest; -import io.metersphere.api.dto.dataCount.response.ApiDataCountDTO; -import io.metersphere.api.dto.dataCount.response.ExecutedCaseInfoDTO; -import io.metersphere.api.dto.dataCount.response.TaskInfoResult; +import io.metersphere.api.dto.datacount.ApiDataCountResult; +import io.metersphere.api.dto.datacount.ExecutedCaseInfoResult; +import io.metersphere.api.dto.datacount.request.ScheduleInfoRequest; +import io.metersphere.api.dto.datacount.response.ApiDataCountDTO; +import io.metersphere.api.dto.datacount.response.ExecutedCaseInfoDTO; +import io.metersphere.api.dto.datacount.response.TaskInfoResult; import io.metersphere.api.dto.scenario.request.dubbo.RegistryCenter; import io.metersphere.api.service.*; import io.metersphere.base.domain.ApiTest; diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiTagController.java b/backend/src/main/java/io/metersphere/api/controller/ApiTagController.java deleted file mode 100644 index 7d404df2d9..0000000000 --- a/backend/src/main/java/io/metersphere/api/controller/ApiTagController.java +++ /dev/null @@ -1,56 +0,0 @@ -package io.metersphere.api.controller; - -import com.github.pagehelper.Page; -import com.github.pagehelper.PageHelper; -import io.metersphere.api.dto.automation.ApiTagRequest; -import io.metersphere.api.dto.automation.SaveApiTagRequest; -import io.metersphere.api.service.ApiTagService; -import io.metersphere.base.domain.ApiTag; -import io.metersphere.commons.constants.RoleConstants; -import io.metersphere.commons.utils.PageUtils; -import io.metersphere.commons.utils.Pager; -import io.metersphere.commons.utils.SessionUtils; -import org.apache.shiro.authz.annotation.Logical; -import org.apache.shiro.authz.annotation.RequiresRoles; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -@RestController -@RequestMapping(value = "/api/tag") -@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER}, logical = Logical.OR) -public class ApiTagController { - - @Resource - ApiTagService apiTagService; - - @PostMapping("/list") - public List list(@RequestBody ApiTagRequest request) { - return apiTagService.list(request); - } - - @PostMapping("/getTgas/{goPage}/{pageSize}") - public Pager> getTgas(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiTagRequest request) { - Page page = PageHelper.startPage(goPage, pageSize, true); - request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId()); - return PageUtils.setPageInfo(page, apiTagService.getTgas(request)); - } - - @PostMapping(value = "/create") - public void create(@RequestBody SaveApiTagRequest request) { - apiTagService.create(request); - } - - @PostMapping(value = "/update") - public void update(@RequestBody SaveApiTagRequest request) { - apiTagService.update(request); - } - - @GetMapping("/delete/{id}") - public void delete(@PathVariable String id) { - apiTagService.delete(id); - } - -} - diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/SaveApiScenarioRequest.java b/backend/src/main/java/io/metersphere/api/dto/automation/SaveApiScenarioRequest.java index 1256a3c350..92f8843220 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/SaveApiScenarioRequest.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/SaveApiScenarioRequest.java @@ -13,7 +13,7 @@ public class SaveApiScenarioRequest { private String projectId; - private String tagId; + private String tags; private String userId; diff --git a/backend/src/main/java/io/metersphere/api/dto/dataCount/ApiDataCountResult.java b/backend/src/main/java/io/metersphere/api/dto/datacount/ApiDataCountResult.java similarity index 85% rename from backend/src/main/java/io/metersphere/api/dto/dataCount/ApiDataCountResult.java rename to backend/src/main/java/io/metersphere/api/dto/datacount/ApiDataCountResult.java index 7a1307bbc9..97d6bb7803 100644 --- a/backend/src/main/java/io/metersphere/api/dto/dataCount/ApiDataCountResult.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/ApiDataCountResult.java @@ -1,4 +1,4 @@ -package io.metersphere.api.dto.dataCount; +package io.metersphere.api.dto.datacount; import lombok.Getter; import lombok.Setter; diff --git a/backend/src/main/java/io/metersphere/api/dto/dataCount/ExecutedCaseInfoResult.java b/backend/src/main/java/io/metersphere/api/dto/datacount/ExecutedCaseInfoResult.java similarity index 88% rename from backend/src/main/java/io/metersphere/api/dto/dataCount/ExecutedCaseInfoResult.java rename to backend/src/main/java/io/metersphere/api/dto/datacount/ExecutedCaseInfoResult.java index 5850260a8c..5edf645e52 100644 --- a/backend/src/main/java/io/metersphere/api/dto/dataCount/ExecutedCaseInfoResult.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/ExecutedCaseInfoResult.java @@ -1,4 +1,4 @@ -package io.metersphere.api.dto.dataCount; +package io.metersphere.api.dto.datacount; import lombok.Getter; import lombok.Setter; diff --git a/backend/src/main/java/io/metersphere/api/dto/dataCount/request/ScheduleInfoRequest.java b/backend/src/main/java/io/metersphere/api/dto/datacount/request/ScheduleInfoRequest.java similarity index 82% rename from backend/src/main/java/io/metersphere/api/dto/dataCount/request/ScheduleInfoRequest.java rename to backend/src/main/java/io/metersphere/api/dto/datacount/request/ScheduleInfoRequest.java index df66955556..f7b90b5055 100644 --- a/backend/src/main/java/io/metersphere/api/dto/dataCount/request/ScheduleInfoRequest.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/request/ScheduleInfoRequest.java @@ -1,4 +1,4 @@ -package io.metersphere.api.dto.dataCount.request; +package io.metersphere.api.dto.datacount.request; import lombok.Getter; import lombok.Setter; diff --git a/backend/src/main/java/io/metersphere/api/dto/dataCount/response/ApiDataCountDTO.java b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java similarity index 93% rename from backend/src/main/java/io/metersphere/api/dto/dataCount/response/ApiDataCountDTO.java rename to backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java index d5bd3850a6..847ec139f1 100644 --- a/backend/src/main/java/io/metersphere/api/dto/dataCount/response/ApiDataCountDTO.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java @@ -1,14 +1,11 @@ -package io.metersphere.api.dto.dataCount.response; +package io.metersphere.api.dto.datacount.response; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; +import io.metersphere.api.dto.datacount.ApiDataCountResult; import io.metersphere.api.dto.scenario.request.RequestType; -import io.metersphere.base.domain.ApiDefinition; -import io.metersphere.commons.constants.APITestStatus; import lombok.Getter; import lombok.Setter; import java.util.List; -import java.util.Locale; /** * 接口数据统计返回 @@ -118,7 +115,7 @@ public class ApiDataCountDTO { /** * 对Protocal视角对查询结果进行统计 - * @param countResultList + * @param countResultList 查询参数 */ public void countProtocal(List countResultList){ for (ApiDataCountResult countResult : @@ -146,16 +143,17 @@ public class ApiDataCountDTO { /** * 对Status视角对查询结果进行统计 - * @param countResultList + * @param countResultList 查询参数 */ public void countStatus(List countResultList){ for (ApiDataCountResult countResult : countResultList) { if("Underway".equals(countResult.getGroupField())){ + //未开始 this.runningCount+= countResult.getCountNumber(); }else if("Completed".equals(countResult.getGroupField())){ this.finishedCount+= countResult.getCountNumber(); - }else if("Trash".equals(countResult.getGroupField())){ + }else if("Prepare".equals(countResult.getGroupField())){ this.notStartedCount+= countResult.getCountNumber(); } } diff --git a/backend/src/main/java/io/metersphere/api/dto/dataCount/response/ExecutedCaseInfoDTO.java b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ExecutedCaseInfoDTO.java similarity index 87% rename from backend/src/main/java/io/metersphere/api/dto/dataCount/response/ExecutedCaseInfoDTO.java rename to backend/src/main/java/io/metersphere/api/dto/datacount/response/ExecutedCaseInfoDTO.java index 53d5f89639..0e31c47a16 100644 --- a/backend/src/main/java/io/metersphere/api/dto/dataCount/response/ExecutedCaseInfoDTO.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ExecutedCaseInfoDTO.java @@ -1,4 +1,4 @@ -package io.metersphere.api.dto.dataCount.response; +package io.metersphere.api.dto.datacount.response; import lombok.Getter; import lombok.Setter; diff --git a/backend/src/main/java/io/metersphere/api/dto/dataCount/response/TaskInfoResult.java b/backend/src/main/java/io/metersphere/api/dto/datacount/response/TaskInfoResult.java similarity index 85% rename from backend/src/main/java/io/metersphere/api/dto/dataCount/response/TaskInfoResult.java rename to backend/src/main/java/io/metersphere/api/dto/datacount/response/TaskInfoResult.java index d1a8d0fa36..ef2bb4d45a 100644 --- a/backend/src/main/java/io/metersphere/api/dto/dataCount/response/TaskInfoResult.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/response/TaskInfoResult.java @@ -1,8 +1,7 @@ -package io.metersphere.api.dto.dataCount.response; +package io.metersphere.api.dto.datacount.response; import lombok.Getter; import lombok.Setter; -import org.python.antlr.ast.Str; /** * 任务信息 返回DTO diff --git a/backend/src/main/java/io/metersphere/api/service/APIReportService.java b/backend/src/main/java/io/metersphere/api/service/APIReportService.java index 6b3a8001a9..25cbcbfab1 100644 --- a/backend/src/main/java/io/metersphere/api/service/APIReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/APIReportService.java @@ -6,7 +6,7 @@ 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.dataCount.ApiDataCountResult; +import io.metersphere.api.dto.datacount.ApiDataCountResult; import io.metersphere.api.jmeter.TestResult; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.ApiDataViewMapper; diff --git a/backend/src/main/java/io/metersphere/api/service/APITestService.java b/backend/src/main/java/io/metersphere/api/service/APITestService.java index de4c878c17..23ae3400e9 100644 --- a/backend/src/main/java/io/metersphere/api/service/APITestService.java +++ b/backend/src/main/java/io/metersphere/api/service/APITestService.java @@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject; import com.alibaba.nacos.client.utils.StringUtils; import io.github.ningyu.jmeter.plugin.dubbo.sample.ProviderService; import io.metersphere.api.dto.*; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; import io.metersphere.api.dto.parse.ApiImport; import io.metersphere.api.dto.scenario.request.dubbo.RegistryCenter; import io.metersphere.api.jmeter.JMeterService; diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index a7c4a51826..5f38655376 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -5,9 +5,8 @@ import com.alibaba.fastjson.JSONObject; 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.automation.*; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; +import io.metersphere.api.dto.datacount.ApiDataCountResult; import io.metersphere.api.dto.definition.RunDefinitionRequest; import io.metersphere.api.dto.definition.request.*; import io.metersphere.api.dto.scenario.KeyValue; @@ -15,7 +14,6 @@ import io.metersphere.api.dto.scenario.environment.EnvironmentConfig; import io.metersphere.api.jmeter.JMeterService; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.ApiScenarioMapper; -import io.metersphere.base.mapper.ApiTagMapper; import io.metersphere.base.mapper.ext.ExtApiScenarioMapper; import io.metersphere.base.mapper.ext.ExtTestPlanMapper; import io.metersphere.base.mapper.ext.ExtTestPlanScenarioCaseMapper; @@ -56,8 +54,6 @@ public class ApiAutomationService { @Resource private ExtApiScenarioMapper extApiScenarioMapper; @Resource - private ApiTagMapper apiTagMapper; - @Resource private JMeterService jMeterService; @Resource private ApiTestEnvironmentService environmentService; @@ -71,33 +67,9 @@ public class ApiAutomationService { public List list(ApiScenarioRequest request) { request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders())); List list = extApiScenarioMapper.list(request); -// buildScenarioInfo(request.getProjectId(), list); todo tag? return list; } - public void buildScenarioInfo(String projectId, List list) { - ApiTagExample example = new ApiTagExample(); - example.createCriteria().andProjectIdEqualTo(projectId); - List tags = apiTagMapper.selectByExample(example); - Map tagMap = tags.stream().collect(Collectors.toMap(ApiTag::getId, ApiTag::getName)); - Gson gs = new Gson(); - list.forEach(item -> { - if (item.getTagId() != null) { - StringBuilder buf = new StringBuilder(); - gs.fromJson(item.getTagId(), List.class).forEach(t -> { - buf.append(tagMap.get(t)); - buf.append(","); - }); - if (buf != null && buf.length() > 0) { - String tagNames = buf.toString().substring(0, buf.toString().length() - 1); - List tagList = Arrays.asList(tagNames.split(",")); - item.setTagNames(tagList); - } else { - item.setTagNames(new ArrayList<>()); - } - } - }); - } public List selectIdsNotExistsInPlan(String projectId, String planId) { return extApiScenarioMapper.selectIdsNotExistsInPlan(projectId, planId); @@ -117,7 +89,7 @@ public class ApiAutomationService { scenario.setId(request.getId()); scenario.setName(request.getName()); scenario.setProjectId(request.getProjectId()); - scenario.setTagId(request.getTagId()); + scenario.setTags(request.getTags()); scenario.setApiScenarioModuleId(request.getApiScenarioModuleId()); scenario.setModulePath(request.getModulePath()); scenario.setLevel(request.getLevel()); @@ -154,7 +126,7 @@ public class ApiAutomationService { scenario.setId(request.getId()); scenario.setName(request.getName()); scenario.setProjectId(request.getProjectId()); - scenario.setTagId(request.getTagId()); + scenario.setTags(request.getTags()); scenario.setApiScenarioModuleId(request.getApiScenarioModuleId()); scenario.setModulePath(request.getModulePath()); scenario.setLevel(request.getLevel()); @@ -215,19 +187,6 @@ public class ApiAutomationService { return new ArrayList<>(); } - public void deleteTag(String id) { - List list = extApiScenarioMapper.selectByTagId(id); - if (!list.isEmpty()) { - Gson gs = new Gson(); - list.forEach(item -> { - List tagIds = gs.fromJson(item.getTagId(), List.class); - tagIds.remove(id); - item.setTagId(JSON.toJSONString(tagIds)); - apiScenarioMapper.updateByPrimaryKeySelective(item); - }); - } - } - private void createAPIScenarioReportResult(String id, String triggerMode, String execType, String projectId) { APIScenarioReportResult report = new APIScenarioReportResult(); report.setId(id); @@ -317,6 +276,7 @@ public class ApiAutomationService { ParameterConfig config = new ParameterConfig(); config.setConfig(envConfig); HashTree hashTree = request.getTestElement().generateHashTree(config); + request.getTestElement().getJmx(hashTree); // 调用执行方法 jMeterService.runDefinition(request.getId(), hashTree, request.getReportId(), ApiRunMode.SCENARIO.name()); createAPIScenarioReportResult(request.getId(), ReportTriggerMode.MANUAL.name(), request.getExecuteType(), request.getProjectId()); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java index 85d4e92496..bdc2562abc 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java @@ -1,7 +1,7 @@ package io.metersphere.api.service; import com.alibaba.fastjson.JSON; -import io.metersphere.api.dto.dataCount.ExecutedCaseInfoResult; +import io.metersphere.api.dto.datacount.ExecutedCaseInfoResult; import io.metersphere.api.jmeter.TestResult; import io.metersphere.base.domain.ApiDefinitionExecResult; import io.metersphere.base.domain.ApiDefinitionExecResultExample; diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index c379afd6c8..0d8828bc63 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -6,7 +6,7 @@ import io.metersphere.api.dto.APIReportResult; import io.metersphere.api.dto.ApiTestImportRequest; import io.metersphere.api.dto.automation.ApiScenarioRequest; import io.metersphere.api.dto.automation.ReferenceDTO; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; +import io.metersphere.api.dto.datacount.ApiDataCountResult; import io.metersphere.api.dto.definition.*; import io.metersphere.api.dto.definition.parse.ApiDefinitionImport; import io.metersphere.api.dto.scenario.request.RequestType; diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTagService.java b/backend/src/main/java/io/metersphere/api/service/ApiTagService.java deleted file mode 100644 index 94ae8b3691..0000000000 --- a/backend/src/main/java/io/metersphere/api/service/ApiTagService.java +++ /dev/null @@ -1,77 +0,0 @@ -package io.metersphere.api.service; - -import io.metersphere.api.dto.automation.ApiTagRequest; -import io.metersphere.api.dto.automation.SaveApiTagRequest; -import io.metersphere.base.domain.ApiTag; -import io.metersphere.base.domain.ApiTagExample; -import io.metersphere.base.mapper.ApiTagMapper; -import io.metersphere.base.mapper.ext.ExtApiTagMapper; -import io.metersphere.commons.exception.MSException; -import io.metersphere.commons.utils.SessionUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.List; - -@Service -@Transactional(rollbackFor = Exception.class) -public class ApiTagService { - @Resource - private ApiTagMapper apiTagMapper; - @Resource - private ExtApiTagMapper extApiTagMapper; - @Resource - private ApiAutomationService apiAutomationService; - - public List list(ApiTagRequest request) { - ApiTagExample example = new ApiTagExample(); - example.createCriteria().andProjectIdEqualTo(request.getProjectId()); - return apiTagMapper.selectByExample(example); - } - - public List getTgas(ApiTagRequest request) { - return extApiTagMapper.list(request); - } - - public void create(SaveApiTagRequest request) { - checkNameExist(request); - final ApiTag apiTag = new ApiTag(); - apiTag.setId(request.getId()); - apiTag.setName(request.getName()); - apiTag.setProjectId(request.getProjectId()); - apiTag.setCreateTime(System.currentTimeMillis()); - apiTag.setUpdateTime(System.currentTimeMillis()); - if (request.getUserId() == null) { - apiTag.setUserId(SessionUtils.getUserId()); - } else { - apiTag.setUserId(request.getUserId()); - } - apiTagMapper.insert(apiTag); - } - - public void update(SaveApiTagRequest request) { - checkNameExist(request); - final ApiTag apiTag = new ApiTag(); - apiTag.setId(request.getId()); - apiTag.setName(request.getName()); - apiTag.setProjectId(request.getProjectId()); - apiTag.setUpdateTime(System.currentTimeMillis()); - apiTag.setUserId(request.getUserId()); - apiTagMapper.updateByPrimaryKeySelective(apiTag); - } - - public void delete(String id) { - apiTagMapper.deleteByPrimaryKey(id); - apiAutomationService.deleteTag(id); - } - - private void checkNameExist(SaveApiTagRequest request) { - ApiTagExample example = new ApiTagExample(); - example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()) - .andIdNotEqualTo(request.getId()); - if (apiTagMapper.countByExample(example) > 0) { - MSException.throwException("名称不能重复"); - } - } -} diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java index df44f6497c..f886f61a0e 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -1,15 +1,12 @@ package io.metersphere.api.service; import com.alibaba.fastjson.JSONObject; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; +import io.metersphere.api.dto.datacount.ApiDataCountResult; import io.metersphere.api.dto.definition.ApiTestCaseRequest; import io.metersphere.api.dto.definition.ApiTestCaseResult; import io.metersphere.api.dto.definition.SaveApiTestCaseRequest; import io.metersphere.api.dto.ApiCaseBatchRequest; import io.metersphere.api.dto.definition.ApiTestCaseDTO; -import io.metersphere.api.dto.definition.ApiTestCaseRequest; -import io.metersphere.api.dto.definition.ApiTestCaseResult; -import io.metersphere.api.dto.definition.SaveApiTestCaseRequest; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.ApiTestCaseMapper; import io.metersphere.base.mapper.ApiTestFileMapper; diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiScenario.java b/backend/src/main/java/io/metersphere/base/domain/ApiScenario.java index 61680351e2..56d3050e07 100644 --- a/backend/src/main/java/io/metersphere/base/domain/ApiScenario.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenario.java @@ -9,7 +9,7 @@ public class ApiScenario implements Serializable { private String projectId; - private String tagId; + private String tags; private String userId; diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiScenarioExample.java b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioExample.java index 6d369644a3..c668f1a2fe 100644 --- a/backend/src/main/java/io/metersphere/base/domain/ApiScenarioExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioExample.java @@ -244,73 +244,73 @@ public class ApiScenarioExample { return (Criteria) this; } - public Criteria andTagIdIsNull() { - addCriterion("tag_id is null"); + public Criteria andTagsIsNull() { + addCriterion("tags is null"); return (Criteria) this; } - public Criteria andTagIdIsNotNull() { - addCriterion("tag_id is not null"); + public Criteria andTagsIsNotNull() { + addCriterion("tags is not null"); return (Criteria) this; } - public Criteria andTagIdEqualTo(String value) { - addCriterion("tag_id =", value, "tagId"); + public Criteria andTagsEqualTo(String value) { + addCriterion("tags =", value, "tags"); return (Criteria) this; } - public Criteria andTagIdNotEqualTo(String value) { - addCriterion("tag_id <>", value, "tagId"); + public Criteria andTagsNotEqualTo(String value) { + addCriterion("tags <>", value, "tags"); return (Criteria) this; } - public Criteria andTagIdGreaterThan(String value) { - addCriterion("tag_id >", value, "tagId"); + public Criteria andTagsGreaterThan(String value) { + addCriterion("tags >", value, "tags"); return (Criteria) this; } - public Criteria andTagIdGreaterThanOrEqualTo(String value) { - addCriterion("tag_id >=", value, "tagId"); + public Criteria andTagsGreaterThanOrEqualTo(String value) { + addCriterion("tags >=", value, "tags"); return (Criteria) this; } - public Criteria andTagIdLessThan(String value) { - addCriterion("tag_id <", value, "tagId"); + public Criteria andTagsLessThan(String value) { + addCriterion("tags <", value, "tags"); return (Criteria) this; } - public Criteria andTagIdLessThanOrEqualTo(String value) { - addCriterion("tag_id <=", value, "tagId"); + public Criteria andTagsLessThanOrEqualTo(String value) { + addCriterion("tags <=", value, "tags"); return (Criteria) this; } - public Criteria andTagIdLike(String value) { - addCriterion("tag_id like", value, "tagId"); + public Criteria andTagsLike(String value) { + addCriterion("tags like", value, "tags"); return (Criteria) this; } - public Criteria andTagIdNotLike(String value) { - addCriterion("tag_id not like", value, "tagId"); + public Criteria andTagsNotLike(String value) { + addCriterion("tags not like", value, "tags"); return (Criteria) this; } - public Criteria andTagIdIn(List values) { - addCriterion("tag_id in", values, "tagId"); + public Criteria andTagsIn(List values) { + addCriterion("tags in", values, "tags"); return (Criteria) this; } - public Criteria andTagIdNotIn(List values) { - addCriterion("tag_id not in", values, "tagId"); + public Criteria andTagsNotIn(List values) { + addCriterion("tags not in", values, "tags"); return (Criteria) this; } - public Criteria andTagIdBetween(String value1, String value2) { - addCriterion("tag_id between", value1, value2, "tagId"); + public Criteria andTagsBetween(String value1, String value2) { + addCriterion("tags between", value1, value2, "tags"); return (Criteria) this; } - public Criteria andTagIdNotBetween(String value1, String value2) { - addCriterion("tag_id not between", value1, value2, "tagId"); + public Criteria andTagsNotBetween(String value1, String value2) { + addCriterion("tags not between", value1, value2, "tags"); return (Criteria) this; } diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiTag.java b/backend/src/main/java/io/metersphere/base/domain/ApiTag.java deleted file mode 100644 index 2d19531caa..0000000000 --- a/backend/src/main/java/io/metersphere/base/domain/ApiTag.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.metersphere.base.domain; - -import java.io.Serializable; -import lombok.Data; - -@Data -public class ApiTag implements Serializable { - private String id; - - private String projectId; - - private String name; - - private String userId; - - private Long createTime; - - private Long updateTime; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiTagExample.java b/backend/src/main/java/io/metersphere/base/domain/ApiTagExample.java deleted file mode 100644 index 10e1714222..0000000000 --- a/backend/src/main/java/io/metersphere/base/domain/ApiTagExample.java +++ /dev/null @@ -1,600 +0,0 @@ -package io.metersphere.base.domain; - -import java.util.ArrayList; -import java.util.List; - -public class ApiTagExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public ApiTagExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(String value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(String value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(String value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(String value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(String value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(String value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLike(String value) { - addCriterion("id like", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotLike(String value) { - addCriterion("id not like", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(String value1, String value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(String value1, String value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andProjectIdIsNull() { - addCriterion("project_id is null"); - return (Criteria) this; - } - - public Criteria andProjectIdIsNotNull() { - addCriterion("project_id is not null"); - return (Criteria) this; - } - - public Criteria andProjectIdEqualTo(String value) { - addCriterion("project_id =", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotEqualTo(String value) { - addCriterion("project_id <>", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdGreaterThan(String value) { - addCriterion("project_id >", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdGreaterThanOrEqualTo(String value) { - addCriterion("project_id >=", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdLessThan(String value) { - addCriterion("project_id <", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdLessThanOrEqualTo(String value) { - addCriterion("project_id <=", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdLike(String value) { - addCriterion("project_id like", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotLike(String value) { - addCriterion("project_id not like", value, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdIn(List values) { - addCriterion("project_id in", values, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotIn(List values) { - addCriterion("project_id not in", values, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdBetween(String value1, String value2) { - addCriterion("project_id between", value1, value2, "projectId"); - return (Criteria) this; - } - - public Criteria andProjectIdNotBetween(String value1, String value2) { - addCriterion("project_id not between", value1, value2, "projectId"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("`name` is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("`name` is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("`name` =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("`name` <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("`name` >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("`name` >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("`name` <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("`name` <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("`name` like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("`name` not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("`name` in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("`name` not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("`name` between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("`name` not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andUserIdIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUserIdIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUserIdEqualTo(String value) { - addCriterion("user_id =", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdNotEqualTo(String value) { - addCriterion("user_id <>", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdGreaterThan(String value) { - addCriterion("user_id >", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdGreaterThanOrEqualTo(String value) { - addCriterion("user_id >=", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdLessThan(String value) { - addCriterion("user_id <", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdLessThanOrEqualTo(String value) { - addCriterion("user_id <=", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdLike(String value) { - addCriterion("user_id like", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdNotLike(String value) { - addCriterion("user_id not like", value, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdIn(List values) { - addCriterion("user_id in", values, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdNotIn(List values) { - addCriterion("user_id not in", values, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdBetween(String value1, String value2) { - addCriterion("user_id between", value1, value2, "userId"); - return (Criteria) this; - } - - public Criteria andUserIdNotBetween(String value1, String value2) { - addCriterion("user_id not between", value1, value2, "userId"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Long value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Long value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Long value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Long value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Long value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Long value1, Long value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Long value1, Long value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Long value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Long value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Long value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Long value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Long value1, Long value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java b/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java index de2a5800a1..bf7ee5fcc7 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java @@ -20,5 +20,7 @@ public class TestResourcePool implements Serializable { private Long updateTime; + private String image; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java b/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java index 84edf600e9..6cc15d65d4 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java @@ -175,142 +175,142 @@ public class TestResourcePoolExample { } public Criteria andNameIsNull() { - addCriterion("name is null"); + addCriterion("`name` is null"); return (Criteria) this; } public Criteria andNameIsNotNull() { - addCriterion("name is not null"); + addCriterion("`name` is not null"); return (Criteria) this; } public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); + addCriterion("`name` =", value, "name"); return (Criteria) this; } public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); + addCriterion("`name` <>", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); + addCriterion("`name` >", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); + addCriterion("`name` >=", value, "name"); return (Criteria) this; } public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); + addCriterion("`name` <", value, "name"); return (Criteria) this; } public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); + addCriterion("`name` <=", value, "name"); return (Criteria) this; } public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); + addCriterion("`name` like", value, "name"); return (Criteria) this; } public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); + addCriterion("`name` not like", value, "name"); return (Criteria) this; } public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); + addCriterion("`name` in", values, "name"); return (Criteria) this; } public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); + addCriterion("`name` not in", values, "name"); return (Criteria) this; } public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); + addCriterion("`name` between", value1, value2, "name"); return (Criteria) this; } public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); + addCriterion("`name` not between", value1, value2, "name"); return (Criteria) this; } public Criteria andTypeIsNull() { - addCriterion("type is null"); + addCriterion("`type` is null"); return (Criteria) this; } public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); + addCriterion("`type` is not null"); return (Criteria) this; } public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); + addCriterion("`type` =", value, "type"); return (Criteria) this; } public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); + addCriterion("`type` <>", value, "type"); return (Criteria) this; } public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); + addCriterion("`type` >", value, "type"); return (Criteria) this; } public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); + addCriterion("`type` >=", value, "type"); return (Criteria) this; } public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); + addCriterion("`type` <", value, "type"); return (Criteria) this; } public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); + addCriterion("`type` <=", value, "type"); return (Criteria) this; } public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); + addCriterion("`type` like", value, "type"); return (Criteria) this; } public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); + addCriterion("`type` not like", value, "type"); return (Criteria) this; } public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); + addCriterion("`type` in", values, "type"); return (Criteria) this; } public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); + addCriterion("`type` not in", values, "type"); return (Criteria) this; } public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); + addCriterion("`type` between", value1, value2, "type"); return (Criteria) this; } public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); + addCriterion("`type` not between", value1, value2, "type"); return (Criteria) this; } @@ -385,72 +385,72 @@ public class TestResourcePoolExample { } public Criteria andStatusIsNull() { - addCriterion("status is null"); + addCriterion("`status` is null"); return (Criteria) this; } public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); + addCriterion("`status` is not null"); return (Criteria) this; } public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); + addCriterion("`status` =", value, "status"); return (Criteria) this; } public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); + addCriterion("`status` <>", value, "status"); return (Criteria) this; } public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); + addCriterion("`status` >", value, "status"); return (Criteria) this; } public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); + addCriterion("`status` >=", value, "status"); return (Criteria) this; } public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); + addCriterion("`status` <", value, "status"); return (Criteria) this; } public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); + addCriterion("`status` <=", value, "status"); return (Criteria) this; } public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); + addCriterion("`status` like", value, "status"); return (Criteria) this; } public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); + addCriterion("`status` not like", value, "status"); return (Criteria) this; } public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); + addCriterion("`status` in", values, "status"); return (Criteria) this; } public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); + addCriterion("`status` not in", values, "status"); return (Criteria) this; } public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); + addCriterion("`status` between", value1, value2, "status"); return (Criteria) this; } public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); + addCriterion("`status` not between", value1, value2, "status"); return (Criteria) this; } @@ -573,6 +573,76 @@ public class TestResourcePoolExample { addCriterion("update_time not between", value1, value2, "updateTime"); return (Criteria) this; } + + public Criteria andImageIsNull() { + addCriterion("image is null"); + return (Criteria) this; + } + + public Criteria andImageIsNotNull() { + addCriterion("image is not null"); + return (Criteria) this; + } + + public Criteria andImageEqualTo(String value) { + addCriterion("image =", value, "image"); + return (Criteria) this; + } + + public Criteria andImageNotEqualTo(String value) { + addCriterion("image <>", value, "image"); + return (Criteria) this; + } + + public Criteria andImageGreaterThan(String value) { + addCriterion("image >", value, "image"); + return (Criteria) this; + } + + public Criteria andImageGreaterThanOrEqualTo(String value) { + addCriterion("image >=", value, "image"); + return (Criteria) this; + } + + public Criteria andImageLessThan(String value) { + addCriterion("image <", value, "image"); + return (Criteria) this; + } + + public Criteria andImageLessThanOrEqualTo(String value) { + addCriterion("image <=", value, "image"); + return (Criteria) this; + } + + public Criteria andImageLike(String value) { + addCriterion("image like", value, "image"); + return (Criteria) this; + } + + public Criteria andImageNotLike(String value) { + addCriterion("image not like", value, "image"); + return (Criteria) this; + } + + public Criteria andImageIn(List values) { + addCriterion("image in", values, "image"); + return (Criteria) this; + } + + public Criteria andImageNotIn(List values) { + addCriterion("image not in", values, "image"); + return (Criteria) this; + } + + public Criteria andImageBetween(String value1, String value2) { + addCriterion("image between", value1, value2, "image"); + return (Criteria) this; + } + + public Criteria andImageNotBetween(String value1, String value2) { + addCriterion("image not between", value1, value2, "image"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioMapper.xml index 9961e13b12..5e4082cd5e 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioMapper.xml @@ -4,7 +4,7 @@ - + @@ -84,7 +84,7 @@ - id, project_id, tag_id, user_id, api_scenario_module_id, module_path, `name`, `level`, + id, project_id, tags, user_id, api_scenario_module_id, module_path, `name`, `level`, `status`, principal, step_total, follow_people, schedule, create_time, update_time, pass_rate, last_result, report_id @@ -140,7 +140,7 @@ - insert into api_scenario (id, project_id, tag_id, + insert into api_scenario (id, project_id, tags, user_id, api_scenario_module_id, module_path, `name`, `level`, `status`, principal, step_total, follow_people, @@ -148,7 +148,7 @@ pass_rate, last_result, report_id, scenario_definition, description ) - values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{tagId,jdbcType=VARCHAR}, + values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{tags,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}, @@ -166,8 +166,8 @@ project_id, - - tag_id, + + tags, user_id, @@ -228,8 +228,8 @@ #{projectId,jdbcType=VARCHAR}, - - #{tagId,jdbcType=VARCHAR}, + + #{tags,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, @@ -299,8 +299,8 @@ project_id = #{record.projectId,jdbcType=VARCHAR}, - - tag_id = #{record.tagId,jdbcType=VARCHAR}, + + tags = #{record.tags,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=VARCHAR}, @@ -362,7 +362,7 @@ update api_scenario set id = #{record.id,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, - tag_id = #{record.tagId,jdbcType=VARCHAR}, + tags = #{record.tags,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=VARCHAR}, api_scenario_module_id = #{record.apiScenarioModuleId,jdbcType=VARCHAR}, module_path = #{record.modulePath,jdbcType=VARCHAR}, @@ -388,7 +388,7 @@ update api_scenario set id = #{record.id,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, - tag_id = #{record.tagId,jdbcType=VARCHAR}, + tags = #{record.tags,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=VARCHAR}, api_scenario_module_id = #{record.apiScenarioModuleId,jdbcType=VARCHAR}, module_path = #{record.modulePath,jdbcType=VARCHAR}, @@ -414,8 +414,8 @@ project_id = #{projectId,jdbcType=VARCHAR}, - - tag_id = #{tagId,jdbcType=VARCHAR}, + + tags = #{tags,jdbcType=VARCHAR}, user_id = #{userId,jdbcType=VARCHAR}, @@ -474,7 +474,7 @@ update api_scenario set project_id = #{projectId,jdbcType=VARCHAR}, - tag_id = #{tagId,jdbcType=VARCHAR}, + tags = #{tags,jdbcType=VARCHAR}, user_id = #{userId,jdbcType=VARCHAR}, api_scenario_module_id = #{apiScenarioModuleId,jdbcType=VARCHAR}, module_path = #{modulePath,jdbcType=VARCHAR}, @@ -497,7 +497,7 @@ update api_scenario set project_id = #{projectId,jdbcType=VARCHAR}, - tag_id = #{tagId,jdbcType=VARCHAR}, + tags = #{tags,jdbcType=VARCHAR}, user_id = #{userId,jdbcType=VARCHAR}, api_scenario_module_id = #{apiScenarioModuleId,jdbcType=VARCHAR}, module_path = #{modulePath,jdbcType=VARCHAR}, diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiTagMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ApiTagMapper.java deleted file mode 100644 index 8795a292f5..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/ApiTagMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package io.metersphere.base.mapper; - -import io.metersphere.base.domain.ApiTag; -import io.metersphere.base.domain.ApiTagExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface ApiTagMapper { - long countByExample(ApiTagExample example); - - int deleteByExample(ApiTagExample example); - - int deleteByPrimaryKey(String id); - - int insert(ApiTag record); - - int insertSelective(ApiTag record); - - List selectByExample(ApiTagExample example); - - ApiTag selectByPrimaryKey(String id); - - int updateByExampleSelective(@Param("record") ApiTag record, @Param("example") ApiTagExample example); - - int updateByExample(@Param("record") ApiTag record, @Param("example") ApiTagExample example); - - int updateByPrimaryKeySelective(ApiTag record); - - int updateByPrimaryKey(ApiTag record); -} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiTagMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ApiTagMapper.xml deleted file mode 100644 index 044be8cc4a..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/ApiTagMapper.xml +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, project_id, `name`, user_id, create_time, update_time - - - - - delete from api_tag - where id = #{id,jdbcType=VARCHAR} - - - delete from api_tag - - - - - - insert into api_tag (id, project_id, `name`, - user_id, create_time, update_time - ) - values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT} - ) - - - insert into api_tag - - - id, - - - project_id, - - - `name`, - - - user_id, - - - create_time, - - - update_time, - - - - - #{id,jdbcType=VARCHAR}, - - - #{projectId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{userId,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=BIGINT}, - - - #{updateTime,jdbcType=BIGINT}, - - - - - - update api_tag - - - id = #{record.id,jdbcType=VARCHAR}, - - - project_id = #{record.projectId,jdbcType=VARCHAR}, - - - `name` = #{record.name,jdbcType=VARCHAR}, - - - user_id = #{record.userId,jdbcType=VARCHAR}, - - - create_time = #{record.createTime,jdbcType=BIGINT}, - - - update_time = #{record.updateTime,jdbcType=BIGINT}, - - - - - - - - update api_tag - set id = #{record.id,jdbcType=VARCHAR}, - project_id = #{record.projectId,jdbcType=VARCHAR}, - `name` = #{record.name,jdbcType=VARCHAR}, - user_id = #{record.userId,jdbcType=VARCHAR}, - create_time = #{record.createTime,jdbcType=BIGINT}, - update_time = #{record.updateTime,jdbcType=BIGINT} - - - - - - update api_tag - - - project_id = #{projectId,jdbcType=VARCHAR}, - - - `name` = #{name,jdbcType=VARCHAR}, - - - user_id = #{userId,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=BIGINT}, - - - update_time = #{updateTime,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=VARCHAR} - - - update api_tag - set project_id = #{projectId,jdbcType=VARCHAR}, - `name` = #{name,jdbcType=VARCHAR}, - user_id = #{userId,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=BIGINT}, - update_time = #{updateTime,jdbcType=BIGINT} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ScheduleMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ScheduleMapper.java index d8e8c4f4b2..8d1d4b68ec 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ScheduleMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ScheduleMapper.java @@ -1,13 +1,9 @@ package io.metersphere.base.mapper; -import io.metersphere.api.dto.dataCount.response.TaskInfoResult; import io.metersphere.base.domain.Schedule; import io.metersphere.base.domain.ScheduleExample; import java.util.List; import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; -import org.apache.ibatis.annotations.Update; -import org.python.antlr.ast.Str; public interface ScheduleMapper { long countByExample(ScheduleExample example); diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml index 071918ef1f..23969480f4 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml @@ -9,6 +9,7 @@ + @@ -69,7 +70,7 @@ - id, name, type, description, status, create_time, update_time + id, `name`, `type`, description, `status`, create_time, update_time, image @@ -171,16 +178,16 @@ id = #{record.id,jdbcType=VARCHAR}, - name = #{record.name,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, description = #{record.description,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, + `status` = #{record.status,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, @@ -188,6 +195,9 @@ update_time = #{record.updateTime,jdbcType=BIGINT}, + + image = #{record.image,jdbcType=VARCHAR}, + @@ -196,12 +206,13 @@ update test_resource_pool set id = #{record.id,jdbcType=VARCHAR}, - name = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, description = #{record.description,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, + `status` = #{record.status,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, - update_time = #{record.updateTime,jdbcType=BIGINT} + update_time = #{record.updateTime,jdbcType=BIGINT}, + image = #{record.image,jdbcType=VARCHAR} @@ -210,16 +221,16 @@ update test_resource_pool - name = #{name,jdbcType=VARCHAR}, + `name` = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, @@ -227,17 +238,21 @@ update_time = #{updateTime,jdbcType=BIGINT}, + + image = #{image,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} update test_resource_pool - set name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, + set `name` = #{name,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, - update_time = #{updateTime,jdbcType=BIGINT} + update_time = #{updateTime,jdbcType=BIGINT}, + image = #{image,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java index 5ed8b5a14e..14031ed479 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java @@ -1,9 +1,8 @@ package io.metersphere.base.mapper.ext; -import io.metersphere.api.dto.dataCount.ExecutedCaseInfoResult; +import io.metersphere.api.dto.datacount.ExecutedCaseInfoResult; import io.metersphere.base.domain.ApiDefinitionExecResult; import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; import java.util.List; diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml index a2d6f08944..855d071d08 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml @@ -32,7 +32,7 @@ WHERE testCase.project_id = #{projectId}) - SELECT * FROM ( SELECT testCase.testCaseName AS caseName,testCase.testPlanName AS testPlan ,caseErrorCountData.dataCountNumber AS failureTimes,'apiCase' AS caseType FROM ( diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.java index a9d1627ff8..2e4c12554b 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.java @@ -1,11 +1,10 @@ package io.metersphere.base.mapper.ext; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; +import io.metersphere.api.dto.datacount.ApiDataCountResult; import io.metersphere.api.dto.definition.ApiComputeResult; import io.metersphere.api.dto.definition.ApiDefinitionRequest; import io.metersphere.api.dto.definition.ApiDefinitionResult; import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; import java.util.List; diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index a34f9d8610..3fc21d282b 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -274,10 +274,10 @@ - SELECT protocol AS groupField,count(id) AS countNumber FROM api_definition WHERE project_id = #{0} GROUP BY protocol - SELECT status AS groupField,count(id) AS countNumber FROM api_definition WHERE project_id = #{0} GROUP BY status - SELECT count(api.id) AS countNumber, if(test_case_api.api_definition_id is null,"uncoverage","coverage") AS groupField FROM api_definition api left Join ( SELECT DISTINCT api_definition_id FROM api_test_case ) test_case_api ON api.id = test_case_api.api_definition_id diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.java index 35b3cd3e53..dd368189cd 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.java @@ -2,7 +2,7 @@ package io.metersphere.base.mapper.ext; import io.metersphere.api.dto.automation.ApiScenarioDTO; import io.metersphere.api.dto.automation.ApiScenarioRequest; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; +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; diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml index 538039e649..50f380b849 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml @@ -9,7 +9,7 @@ - SELECT count(id) AS countNumber, if(last_result is null,"notRun",last_result) AS groupField FROM api_scenario WHERE project_id = #{0} GROUP BY groupField diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTagMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTagMapper.java deleted file mode 100644 index 0deb7a41db..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTagMapper.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.metersphere.base.mapper.ext; - -import io.metersphere.api.dto.automation.ApiTagRequest; -import io.metersphere.base.domain.ApiTag; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface ExtApiTagMapper { - List list(@Param("request") ApiTagRequest request); -} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTagMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTagMapper.xml deleted file mode 100644 index 402fed7498..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTagMapper.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java index 4d6f4f624d..f1ccf24c0f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java @@ -1,6 +1,6 @@ package io.metersphere.base.mapper.ext; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; +import io.metersphere.api.dto.datacount.ApiDataCountResult; import io.metersphere.api.dto.definition.ApiTestCaseDTO; import io.metersphere.api.dto.definition.ApiTestCaseRequest; import io.metersphere.api.dto.definition.ApiTestCaseResult; diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.java index ea9a4db48c..f2d150f0e5 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.java @@ -2,11 +2,9 @@ package io.metersphere.base.mapper.ext; import io.metersphere.api.dto.APIReportResult; import io.metersphere.api.dto.QueryAPIReportRequest; -import io.metersphere.api.dto.dataCount.ApiDataCountResult; -import io.metersphere.dto.ApiReportDTO; +import io.metersphere.api.dto.datacount.ApiDataCountResult; import io.metersphere.dto.DashboardTestDTO; import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; import java.util.List; diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.xml index 64af48550c..38f2523e0b 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestReportMapper.xml @@ -152,7 +152,7 @@ GROUP BY x - SELECT testReport.`status` AS groupField,COUNT(testReportDetail.report_id) AS countNumber FROM api_test_report_detail testReportDetail INNER JOIN `schedule` sch ON sch.resource_id = testReportDetail.test_id diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtScheduleMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtScheduleMapper.java index b43f0dde45..9920d429ea 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtScheduleMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtScheduleMapper.java @@ -1,10 +1,9 @@ package io.metersphere.base.mapper.ext; -import io.metersphere.api.dto.dataCount.response.TaskInfoResult; +import io.metersphere.api.dto.datacount.response.TaskInfoResult; import io.metersphere.controller.request.QueryScheduleRequest; import io.metersphere.dto.ScheduleDao; import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; import java.util.List; diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtScheduleMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtScheduleMapper.xml index d3e7e87d85..5e599d5993 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtScheduleMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtScheduleMapper.xml @@ -45,7 +45,7 @@ AND `group` = #{group} AND create_time BETWEEN #{startTime} and #{endTime} - SELECT apiTest.`name` AS scenario,sch.id AS taskID,sch.`value` AS rule,sch.`enable` AS `taskStatus`,u.`name` AS creator,sch.update_time AS updateTime FROM api_test apiTest INNER JOIN `schedule` sch ON apiTest.id = sch.resource_id diff --git a/backend/src/main/java/io/metersphere/controller/ScheduleController.java b/backend/src/main/java/io/metersphere/controller/ScheduleController.java index 2c1e9759e6..26e0f7084b 100644 --- a/backend/src/main/java/io/metersphere/controller/ScheduleController.java +++ b/backend/src/main/java/io/metersphere/controller/ScheduleController.java @@ -2,6 +2,7 @@ package io.metersphere.controller; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; +import io.metersphere.base.domain.Schedule; import io.metersphere.controller.request.QueryScheduleRequest; import io.metersphere.dto.ScheduleDao; import io.metersphere.service.ScheduleService; @@ -22,4 +23,9 @@ public class ScheduleController { return scheduleService.list(request); } + @GetMapping("/findOne/{testId}/{group}") + public Schedule schedule(@PathVariable String testId,@PathVariable String group) { + Schedule schedule = scheduleService.getScheduleByResource(testId,group); + return schedule; + } } diff --git a/backend/src/main/java/io/metersphere/performance/base/TestOverview.java b/backend/src/main/java/io/metersphere/performance/base/TestOverview.java index 2cdc238888..1f67a0e1b1 100644 --- a/backend/src/main/java/io/metersphere/performance/base/TestOverview.java +++ b/backend/src/main/java/io/metersphere/performance/base/TestOverview.java @@ -11,5 +11,5 @@ public class TestOverview { private String avgResponseTime; private String responseTime90; private String avgBandwidth; - + private String avgTransactions; } diff --git a/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java b/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java index a2fec3c680..f6eda2e823 100644 --- a/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java +++ b/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java @@ -30,8 +30,8 @@ public abstract class AbstractEngine implements Engine { protected Integer threadNum; protected List resourceList; - private TestResourcePoolService testResourcePoolService; - private TestResourceService testResourceService; + private final TestResourcePoolService testResourcePoolService; + private final TestResourceService testResourceService; public AbstractEngine() { testResourcePoolService = CommonBeanFactory.getBean(TestResourcePoolService.class); @@ -62,6 +62,11 @@ public abstract class AbstractEngine implements Engine { && !ResourcePoolTypeEnum.NODE.name().equals(resourcePool.getType())) { MSException.throwException("Invalid Resource Pool type."); } + // image + String image = resourcePool.getImage(); + if (StringUtils.isNotEmpty(image)) { + JMETER_IMAGE = image; + } this.resourceList = testResourceService.getResourcesByPoolId(resourcePool.getId()); if (CollectionUtils.isEmpty(this.resourceList)) { MSException.throwException("Test Resource is empty"); diff --git a/backend/src/main/java/io/metersphere/performance/service/ReportService.java b/backend/src/main/java/io/metersphere/performance/service/ReportService.java index 016852399b..f6e9d65882 100644 --- a/backend/src/main/java/io/metersphere/performance/service/ReportService.java +++ b/backend/src/main/java/io/metersphere/performance/service/ReportService.java @@ -193,11 +193,13 @@ public class ReportService { public List getReportLogResource(String reportId) { List result = new ArrayList<>(); - List resourceIds = extLoadTestReportMapper.selectResourceId(reportId); - resourceIds.forEach(resourceId -> { + List resourceIdAndIndexes = extLoadTestReportMapper.selectResourceId(reportId); + resourceIdAndIndexes.forEach(resourceIdAndIndex -> { LogDetailDTO detailDTO = new LogDetailDTO(); + String[] split = StringUtils.split(resourceIdAndIndex, "_"); + String resourceId = split[0]; TestResource testResource = testResourceService.getTestResource(resourceId); - detailDTO.setResourceId(resourceId); + detailDTO.setResourceId(resourceIdAndIndex); if (testResource == null) { detailDTO.setResourceName(resourceId); result.add(detailDTO); diff --git a/backend/src/main/java/io/metersphere/service/ScheduleService.java b/backend/src/main/java/io/metersphere/service/ScheduleService.java index 2c8c34ea51..36f5ea1530 100644 --- a/backend/src/main/java/io/metersphere/service/ScheduleService.java +++ b/backend/src/main/java/io/metersphere/service/ScheduleService.java @@ -1,7 +1,7 @@ package io.metersphere.service; import com.alibaba.fastjson.JSON; -import io.metersphere.api.dto.dataCount.response.TaskInfoResult; +import io.metersphere.api.dto.datacount.response.TaskInfoResult; import io.metersphere.base.domain.Schedule; import io.metersphere.base.domain.ScheduleExample; import io.metersphere.base.domain.User; diff --git a/backend/src/main/resources/db/migration/V50__api_scenario.sql b/backend/src/main/resources/db/migration/V50__api_scenario.sql index cdee3a499f..7afc0d42ac 100644 --- a/backend/src/main/resources/db/migration/V50__api_scenario.sql +++ b/backend/src/main/resources/db/migration/V50__api_scenario.sql @@ -16,7 +16,7 @@ CREATE TABLE `api_scenario` ( `follow_people` varchar(100) DEFAULT NULL COMMENT 'api scenario Follow people ', `schedule` varchar(255) DEFAULT NULL COMMENT 'Test schedule (cron list)', `scenario_definition` longtext COMMENT 'Test scenario_definition json', - `description` varchar(255) DEFAULT NULL COMMENT 'api scenario description', + `description` longtext DEFAULT NULL COMMENT 'api scenario description', `create_time` bigint(13) NOT NULL COMMENT 'Create timestamp', `update_time` bigint(13) NOT NULL COMMENT 'Update timestamp', `pass_rate` varchar(100) DEFAULT NULL, @@ -43,12 +43,13 @@ CREATE TABLE `api_scenario_report` ( `id` varchar(50) NOT NULL COMMENT 'Test report ID', `project_id` varchar(50) NOT NULL COMMENT 'scenario ID this test report belongs to', `name` varchar(64) NOT NULL COMMENT 'Test report name', - `description` varchar(255) DEFAULT NULL COMMENT 'Test report name', + `description` longtext DEFAULT NULL COMMENT 'Test report name', `create_time` bigint(13) NOT NULL COMMENT 'Create timestamp', `update_time` bigint(13) NOT NULL COMMENT 'Update timestamp', `status` varchar(64) NOT NULL COMMENT 'Status of this test run', `user_id` varchar(64) DEFAULT NULL, `trigger_mode` varchar(64) DEFAULT NULL, + `execute_type` varchar(200) NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; @@ -57,14 +58,4 @@ CREATE TABLE `api_scenario_report_detail` ( `project_id` varchar(64) NOT NULL COMMENT 'scenario ID', `content` longblob COMMENT 'Report Content', PRIMARY KEY (`report_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE `api_tag` ( - `id` varchar(50) NOT NULL COMMENT 'Test ID', - `project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to', - `name` varchar(200) NOT NULL COMMENT 'api tag', - `user_id` varchar(64) DEFAULT NULL COMMENT 'User ID', - `create_time` bigint(13) NOT NULL COMMENT 'Create timestamp', - `update_time` bigint(13) NOT NULL COMMENT 'Update timestamp', - PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; \ No newline at end of file diff --git a/backend/src/main/resources/db/migration/V46__api_definition.sql b/backend/src/main/resources/db/migration/V51__api_definition.sql similarity index 95% rename from backend/src/main/resources/db/migration/V46__api_definition.sql rename to backend/src/main/resources/db/migration/V51__api_definition.sql index 188e584390..223818b694 100644 --- a/backend/src/main/resources/db/migration/V46__api_definition.sql +++ b/backend/src/main/resources/db/migration/V51__api_definition.sql @@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS `api_definition` ( `protocol` varchar(255) NOT NULL COMMENT 'request protocol', `path` varchar(1000) DEFAULT NULL COMMENT 'request path', `module_path` varchar(1000) COMMENT 'module path', - `description` varchar(255) DEFAULT NULL COMMENT 'Test description', + `description` longtext DEFAULT NULL COMMENT 'Test description', `environment_id` varchar(50) DEFAULT NULL COMMENT 'environment id', `request` longtext COMMENT 'request (JSON format)', `response` longtext COMMENT 'request (JSON format)', @@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS `api_test_case` ( `name` varchar(64) NOT NULL COMMENT 'Test name', `priority` varchar(64) NOT NULL COMMENT 'priority', `api_definition_id` varchar(50) NOT NULL COMMENT 'api definition id', - `description` varchar(255) DEFAULT NULL COMMENT 'Test description', + `description` longtext DEFAULT NULL COMMENT 'Test description', `request` longtext COMMENT 'request (JSON format)', `response` longtext COMMENT 'response (JSON format)', `create_user_id` varchar(64) DEFAULT NULL COMMENT 'User ID', @@ -59,6 +59,7 @@ CREATE TABLE IF NOT EXISTS `api_definition_exec_result` ( `user_id` varchar(64) DEFAULT NULL COMMENT 'User ID', `start_time` bigint(13) NOT NULL COMMENT 'Create timestamp', `end_time` bigint(13) NOT NULL COMMENT 'Update timestamp', + `create_time` bigint(13) NULL COMMENT 'Create time', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/backend/src/main/resources/db/migration/V51__modify_api_definition_exec_result.sql b/backend/src/main/resources/db/migration/V51__modify_api_definition_exec_result.sql deleted file mode 100644 index 9d3d443338..0000000000 --- a/backend/src/main/resources/db/migration/V51__modify_api_definition_exec_result.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE api_definition_exec_result ADD create_time BIGINT(13) NULL; diff --git a/backend/src/main/resources/db/migration/V53__modify_api_scenario.sql b/backend/src/main/resources/db/migration/V53__modify_api_scenario.sql index d783a7bea8..ee6a7c1c3c 100644 --- a/backend/src/main/resources/db/migration/V53__modify_api_scenario.sql +++ b/backend/src/main/resources/db/migration/V53__modify_api_scenario.sql @@ -1,5 +1 @@ -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'; \ No newline at end of file +ALTER TABLE api_scenario CHANGE tag_id tags varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'tag list'; \ No newline at end of file diff --git a/backend/src/main/resources/db/migration/V54__test_resource_pool_image.sql b/backend/src/main/resources/db/migration/V54__test_resource_pool_image.sql new file mode 100644 index 0000000000..f81852c814 --- /dev/null +++ b/backend/src/main/resources/db/migration/V54__test_resource_pool_image.sql @@ -0,0 +1,2 @@ +ALTER TABLE test_resource_pool + ADD image VARCHAR(100) NULL; \ No newline at end of file diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index 0c20e9f502..8e314a92d4 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -64,7 +64,7 @@ - +
diff --git a/frontend/package.json b/frontend/package.json index cc05d4c0c6..8f2fc5b9ee 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,29 +17,30 @@ "@fortawesome/vue-fontawesome": "^0.1.9", "axios": "^0.19.0", "core-js": "^3.4.3", + "diffable-html": "^4.0.0", "echarts": "^4.6.0", + "el-table-infinite-scroll": "^1.0.10", "element-ui": "^2.13.0", + "html2canvas": "^1.0.0-rc.7", + "js-base64": "^3.4.4", + "json-bigint": "^1.0.0", + "jsoneditor": "^9.1.2", + "jspdf": "^2.1.1", + "md5": "^2.3.0", + "mockjs": "^1.1.0", + "nprogress": "^0.2.0", + "sha.js": "^2.4.11", "vue": "^2.6.10", + "vue-calendar-heatmap": "^0.8.4", "vue-echarts": "^4.1.0", "vue-i18n": "^8.15.3", + "vue-input-tag": "^2.0.7", + "vue-pdf": "^4.2.0", "vue-router": "^3.1.3", "vuedraggable": "^2.23.2", "vuex": "^3.1.2", - "vue-calendar-heatmap": "^0.8.4", - "mockjs": "^1.1.0", - "md5": "^2.3.0", - "sha.js": "^2.4.11", - "js-base64": "^3.4.4", - "json-bigint": "^1.0.0", - "html2canvas": "^1.0.0-rc.7", - "jspdf": "^2.1.1", - "yan-progress": "^1.0.3", - "nprogress": "^0.2.0", - "el-table-infinite-scroll": "^1.0.10", - "vue-pdf": "^4.2.0", - "diffable-html": "^4.0.0", "xml-js": "^1.6.11", - "jsoneditor": "^9.1.2" + "yan-progress": "^1.0.3" }, "devDependencies": { "@vue/cli-plugin-babel": "^4.1.0", diff --git a/frontend/src/business/components/api/automation/report/components/RequestResult.vue b/frontend/src/business/components/api/automation/report/components/RequestResult.vue index 28efc6cbea..3af4ceb7aa 100644 --- a/frontend/src/business/components/api/automation/report/components/RequestResult.vue +++ b/frontend/src/business/components/api/automation/report/components/RequestResult.vue @@ -73,7 +73,6 @@ methods: { active() { this.isActive = !this.isActive; - console.log(this.request) //this.$emit("requestResult", {request: this.request, scenarioName: this.scenarioName}); } }, diff --git a/frontend/src/business/components/api/automation/report/components/RequestSubResult.vue b/frontend/src/business/components/api/automation/report/components/RequestSubResult.vue index b65bc1afd4..53e26c0c27 100644 --- a/frontend/src/business/components/api/automation/report/components/RequestSubResult.vue +++ b/frontend/src/business/components/api/automation/report/components/RequestSubResult.vue @@ -59,7 +59,6 @@ methods: { active() { this.isActive = !this.isActive; - console.log(this.request) //this.$emit("requestResult", {request: this.request, scenarioName: this.scenarioName}); } }, diff --git a/frontend/src/business/components/api/automation/scenario/AddTag.vue b/frontend/src/business/components/api/automation/scenario/AddTag.vue deleted file mode 100644 index f9c073820e..0000000000 --- a/frontend/src/business/components/api/automation/scenario/AddTag.vue +++ /dev/null @@ -1,126 +0,0 @@ - - - diff --git a/frontend/src/business/components/api/automation/scenario/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/ApiComponent.vue index 928eafd66a..3e1dd54499 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiComponent.vue @@ -2,18 +2,18 @@
-
+
{{request.index}}
{{request.index}}
- + {{$t('api_test.automation.api_list_import')}} - + {{$t('api_test.automation.customize_req')}} @@ -21,6 +21,7 @@ {{$t('api_test.automation.reference_deleted')}} + {{ $t('commons.copy') }} {{ $t('api_test.scenario.reference') }}
- + diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioComponent.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioComponent.vue index c2f9e326c0..41e6781716 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioComponent.vue @@ -8,6 +8,7 @@ {{$t('api_test.automation.scenario_import')}} {{scenario.name}} {{$t('api_test.automation.reference_deleted')}} + {{ $t('commons.copy') }} {{ $t('api_test.scenario.reference') }}
diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index 1e1bea9afc..bf94769711 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -25,9 +25,9 @@ - + @@ -167,6 +167,11 @@ let data = response.data; this.total = data.itemCount; this.tableData = data.listObject; + this.tableData.forEach(item => { + if (item.tags && item.tags.length > 0) { + item.tags = JSON.parse(item.tags); + } + }) this.loading = false; }); }, diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index d618d155e3..5b629ca447 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -79,25 +79,8 @@ - - - - - {{ $t('api_test.automation.create_tag') }} - - - - + + @@ -123,21 +106,21 @@
- + {{currentScenario.name ===undefined || ''? $t('api_test.scenario.name') : currentScenario.name}} - + {{$t('api_test.automation.step_total')}}:{{scenarioDefinition.length}} - + {{$t('api_test.automation.scenario_total')}} :{{this.currentScenario.variables!=undefined?this.currentScenario.variables.length-1: 0}} - - {{ '共享cookie' }} + + 共享cookie - - {{$t('api_test.definition.request.run_env')}}: + + {{$t('api_test.definition.request.run_env')}}: @@ -259,8 +242,6 @@ - - @@ -293,13 +274,14 @@ import MsApiCustomize from "./ApiCustomize"; import {getUUID, getCurrentProjectID} from "@/common/js/utils"; import ApiEnvironmentConfig from "../../definition/components/environment/ApiEnvironmentConfig"; - import MsAddTag from "./AddTag"; + import MsInputTag from "./MsInputTag"; import MsRun from "./DebugRun"; import MsImportApiScenario from "./ImportApiScenario"; import MsApiScenarioComponent from "./ApiScenarioComponent"; import MsApiReportDetail from "../report/ApiReportDetail"; import MsScenarioParameters from "./ScenarioParameters"; import ApiImport from "../../definition/components/import/ApiImport"; + import InputTag from 'vue-input-tag' export default { name: "EditApiScenario", @@ -311,7 +293,7 @@ ApiEnvironmentConfig, MsScenarioParameters, MsApiReportDetail, - MsAddTag, MsRun, + MsInputTag, MsRun, MsApiScenarioComponent, MsImportApiScenario, MsJsr233Processor, @@ -323,6 +305,7 @@ MsApiComponent, MsApiCustomize, ApiImport, + InputTag, }, data() { return { @@ -341,7 +324,6 @@ principal: [{required: true, message: this.$t('api_test.definition.request.responsible'), trigger: 'change'}], }, environments: [], - tags: [], currentEnvironmentId: "", maintainerOptions: [], value: API_STATUS[0].id, @@ -366,7 +348,8 @@ visibleRef: "", enableCookieShare: false, } - }, + } + , created() { if (!this.currentScenario.apiScenarioModuleId) { this.currentScenario.apiScenarioModuleId = ""; @@ -374,11 +357,12 @@ this.projectId = getCurrentProjectID(); this.operatingElements = ELEMENTS.get("ALL"); this.getMaintainerOptions(); - this.refreshTags(); this.getApiScenario(); this.getEnvironments(); - }, - watch: {}, + } + , + watch: {} + , methods: { addComponent(type) { switch (type) { @@ -423,7 +407,8 @@ } this.sort(); this.reload(); - }, + } + , nodeClick(e) { if (e.referenced != 'REF' && e.referenced != 'Deleted') { this.operatingElements = ELEMENTS.get(e.type); @@ -431,16 +416,19 @@ this.operatingElements = []; } this.selectedTreeNode = e; - }, + } + , showAll() { this.operatingElements = ELEMENTS.get("ALL"); this.selectedTreeNode = undefined; this.reload(); - }, + } + , apiListImport() { this.visibleRef = getUUID(); this.apiListVisible = true; - }, + } + , recursiveSorting(arr) { for (let i in arr) { arr[i].index = Number(i) + 1; @@ -448,7 +436,8 @@ this.recursiveSorting(arr[i].hashTree); } } - }, + } + , sort() { for (let i in this.scenarioDefinition) { this.scenarioDefinition[i].index = Number(i) + 1; @@ -456,7 +445,8 @@ this.recursiveSorting(this.scenarioDefinition[i].hashTree); } } - }, + } + , addCustomizeApi(request) { this.customizeVisible = false; request.enable === undefined ? request.enable = true : request.enable; @@ -468,7 +458,8 @@ this.customizeRequest = {}; this.sort(); this.reload(); - }, + } + , addScenario(arr) { if (arr && arr.length > 0) { arr.forEach(item => { @@ -483,7 +474,8 @@ this.sort(); this.reload(); this.scenarioVisible = false; - }, + } + , setApiParameter(item, refType, referenced) { let request = {}; if (Object.prototype.toString.call(item.request).indexOf("String") > 0) { @@ -512,7 +504,8 @@ } else { this.scenarioDefinition.push(request); } - }, + } + , pushApiOrCase(referenced) { if (this.currentRow.cases.length === 0 && this.currentRow.apis.length === 0) { this.$warning(this.$t('api_test.automation.reference_info')); @@ -529,13 +522,15 @@ this.currentRow.apis = []; this.sort(); this.reload(); - }, + } + , getMaintainerOptions() { let workspaceId = localStorage.getItem(WORKSPACE_ID); this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => { this.maintainerOptions = response.data; }); - }, + } + , openTagConfig() { if (!this.projectId) { this.$error(this.$t('api_test.select_project')); @@ -543,20 +538,6 @@ } this.$refs.tag.open(); }, - refreshTags() { - let obj = {projectId: this.projectId}; - let tagIds = []; - this.$post('/api/tag/list', obj, response => { - this.tags = response.data; - this.tags.forEach(item => { - tagIds.push(item.id); - }) - if (this.currentScenario.tagId != undefined && this.currentScenario.tagId.length > 0) { - this.currentScenario.tagId = this.currentScenario.tagId.filter(id => tagIds.indexOf(id) != -1); - } - }); - - }, remove(row, node) { const parent = node.parent const hashTree = parent.data.hashTree || parent.data; @@ -564,7 +545,8 @@ hashTree.splice(index, 1); this.sort(); this.reload(); - }, + } + , copyRow(row, node) { const parent = node.parent const hashTree = parent.data.hashTree || parent.data; @@ -574,13 +556,15 @@ hashTree.push(obj); this.sort(); this.reload(); - }, + } + , reload() { this.loading = true this.$nextTick(() => { this.loading = false }) - }, + } + , runDebug() { /*触发执行操作*/ if (!this.currentEnvironmentId) { @@ -593,7 +577,8 @@ environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition }; this.reportId = getUUID().substring(0, 8); - }, + } + , getEnvironments() { if (this.projectId) { this.$get('/api/environment/list/' + this.projectId, response => { @@ -603,17 +588,20 @@ }); }); } - }, + } + , openEnvironmentConfig() { if (!this.projectId) { this.$error(this.$t('api_test.select_project')); return; } this.$refs.environmentConfig.open(this.projectId); - }, + } + , environmentConfigClose() { this.getEnvironments(); - }, + } + , allowDrop(draggingNode, dropNode, dropType) { if (dropType != "inner") { return true; @@ -622,21 +610,25 @@ return true; } return false; - }, + } + , allowDrag(draggingNode, dropNode, dropType) { this.sort(); this.reload(); - }, + } + , nodeExpand(data) { if (data.resourceId) { this.expandedNode.push(data.resourceId); } - }, + } + , nodeCollapse(data) { if (data.resourceId) { this.expandedNode.splice(this.expandedNode.indexOf(data.resourceId), 1); } - }, + } + , getPath(id) { if (id === null) { return null; @@ -645,7 +637,8 @@ return item.id === id ? item.path : ""; }); return path[0].path; - }, + } + , setFiles(item, bodyUploadFiles, obj) { if (item.body) { if (item.body.kvs) { @@ -683,7 +676,8 @@ }); } } - }, + } + , recursiveFile(arr, bodyUploadFiles, obj) { arr.forEach(item => { this.setFiles(item, bodyUploadFiles, obj); @@ -691,7 +685,8 @@ this.recursiveFile(item.hashTree, bodyUploadFiles, obj); } }); - }, + } + , getBodyUploadFiles(obj) { let bodyUploadFiles = []; obj.bodyUploadIds = []; @@ -702,7 +697,8 @@ } }) return bodyUploadFiles; - }, + } + , editScenario() { this.$refs['currentScenario'].validate((valid) => { if (valid) { @@ -714,15 +710,18 @@ if (response.data) { this.currentScenario.id = response.data.id; } - this.currentScenario.tagId = JSON.parse(this.currentScenario.tagId); + if (this.currentScenario.tags instanceof String) { + this.currentScenario.tags = JSON.parse(this.currentScenario.tags); + } this.$emit('refresh'); }) } }) - }, + } + , getApiScenario() { - if (this.currentScenario.tagId != undefined && !(this.currentScenario.tagId instanceof Array)) { - this.currentScenario.tagId = JSON.parse(this.currentScenario.tagId); + if (this.currentScenario.tags != undefined && !(this.currentScenario.tags instanceof Array)) { + this.currentScenario.tags = JSON.parse(this.currentScenario.tags); } if (this.currentScenario.id) { this.result = this.$get("/api/automation/getApiScenario/" + this.currentScenario.id, response => { @@ -743,7 +742,8 @@ } }) } - }, + } + , setParameter() { this.currentScenario.stepTotal = this.scenarioDefinition.length; this.currentScenario.projectId = getCurrentProjectID(); @@ -754,26 +754,30 @@ type: "scenario", referenced: 'Created', environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition }; this.currentScenario.scenarioDefinition = scenario; - if (this.currentScenario.tagId instanceof Array) { - this.currentScenario.tagId = JSON.stringify(this.currentScenario.tagId); + if (this.currentScenario.tags instanceof Array) { + this.currentScenario.tags = JSON.stringify(this.currentScenario.tags); } if (this.currentModule != null) { this.currentScenario.modulePath = this.currentModule.method !== undefined ? this.currentModule.method : null; this.currentScenario.apiScenarioModuleId = this.currentModule.id; } this.currentScenario.projectId = this.projectId; - }, + } + , runRefresh() { this.debugVisible = true; this.loading = false; - }, + } + , showScenarioParameters() { this.$refs.scenarioParameters.open(this.currentScenario.variables); - }, + } + , addParameters(data) { this.currentScenario.variables = data; this.reload(); - }, + } + , apiImport(importData) { if (importData && importData.data) { importData.data.forEach(item => { @@ -827,6 +831,12 @@ color: white; } + .ms-font { + color: #303133; + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif; + font-size: 13px; + } + .ms-col-one { margin-top: 6px; } @@ -912,8 +922,30 @@ margin-bottom: 0px; } + /deep/ .el-link { + font-weight: normal; + } + + /deep/ .el-checkbox { + color: #303133; + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif; + font-size: 13px; + font-weight: normal; + } + + /deep/ .el-checkbox__label { + padding-left: 5px; + } + .head { - border-bottom: 1px solid #474849; + border-bottom: 1px solid #303133; + color: #303133; + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif; font-size: 13px; } + + /deep/ .el-form-item__content { + line-height: 100%; + } + diff --git a/frontend/src/business/components/api/automation/scenario/MsInputTag.vue b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue new file mode 100644 index 0000000000..f9f5c26ff6 --- /dev/null +++ b/frontend/src/business/components/api/automation/scenario/MsInputTag.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/frontend/src/business/components/api/definition/components/body/ApiBody.vue b/frontend/src/business/components/api/definition/components/body/ApiBody.vue index 2e42b00377..1e84c6a0c8 100644 --- a/frontend/src/business/components/api/definition/components/body/ApiBody.vue +++ b/frontend/src/business/components/api/definition/components/body/ApiBody.vue @@ -1,5 +1,5 @@ diff --git a/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue b/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue index 26b1040fc2..47301e9c71 100644 --- a/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue +++ b/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue @@ -48,7 +48,7 @@ - + diff --git a/frontend/src/business/components/api/definition/components/response/ResponseResult.vue b/frontend/src/business/components/api/definition/components/response/ResponseResult.vue index a7f9a7305f..8be2966cc5 100644 --- a/frontend/src/business/components/api/definition/components/response/ResponseResult.vue +++ b/frontend/src/business/components/api/definition/components/response/ResponseResult.vue @@ -10,7 +10,7 @@ - + @@ -26,17 +26,21 @@ -
- {{$t('api_test.request.address')}} : {{ response.url }} +
+ {{$t('api_test.request.address')}} : +
{{ response.url }}
-
- {{$t('api_test.scenario.headers')}} : {{ response.headers }} +
+ {{$t('api_test.scenario.headers')}} : +
{{ response.headers }}
-
- Cookies : {{response.cookies}} +
+ Cookies : +
{{response.cookies}}
-
- Body : {{response.body}} +
+ Body : +
{{response.body}}
@@ -45,7 +49,6 @@ @@ -139,6 +142,10 @@ height: 0px; } + .ms-div { + margin-top: 20px; + } + pre { margin: 0; } diff --git a/frontend/src/business/components/api/definition/components/response/SqlResultTable.vue b/frontend/src/business/components/api/definition/components/response/SqlResultTable.vue index 5406710eef..baf93f46c4 100644 --- a/frontend/src/business/components/api/definition/components/response/SqlResultTable.vue +++ b/frontend/src/business/components/api/definition/components/response/SqlResultTable.vue @@ -24,79 +24,83 @@ diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index fd02887d7b..5125544200 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -3,13 +3,13 @@ + :visible.sync="dialogFormVisible" width="85%">
- - + + @@ -170,7 +170,7 @@ clearable/> - +