diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java index 75d38cb2b6..4c7f302816 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java @@ -1,11 +1,20 @@ package io.metersphere.api.controller; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import io.metersphere.api.dto.automation.ApiScenarioDTO; +import io.metersphere.api.dto.automation.ApiScenarioRequest; +import io.metersphere.api.dto.automation.SaveApiScenarioRequest; import io.metersphere.api.service.ApiAutomationService; 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.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; import javax.annotation.Resource; @@ -17,5 +26,36 @@ public class ApiAutomationController { @Resource ApiAutomationService apiAutomationService; + @PostMapping("/list/{goPage}/{pageSize}") + public Pager> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiScenarioRequest request) { + Page page = PageHelper.startPage(goPage, pageSize, true); + request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId()); + return PageUtils.setPageInfo(page, apiAutomationService.list(request)); + } + + @PostMapping(value = "/create") + public void create(@RequestBody SaveApiScenarioRequest request) { + apiAutomationService.create(request); + } + + @PostMapping(value = "/update") + public void update(@RequestBody SaveApiScenarioRequest request) { + apiAutomationService.update(request); + } + + @GetMapping("/delete/{id}") + public void delete(@PathVariable String id) { + apiAutomationService.delete(id); + } + + @PostMapping("/deleteBatch") + public void deleteBatch(@RequestBody List ids) { + apiAutomationService.deleteBatch(ids); + } + + @PostMapping("/removeToGc") + public void removeToGc(@RequestBody List ids) { + apiAutomationService.removeToGc(ids); + } } diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiScenarioModuleController.java b/backend/src/main/java/io/metersphere/api/controller/ApiScenarioModuleController.java new file mode 100644 index 0000000000..7997423950 --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/controller/ApiScenarioModuleController.java @@ -0,0 +1,57 @@ +package io.metersphere.api.controller; + +import io.metersphere.api.dto.automation.ApiScenarioModuleDTO; +import io.metersphere.api.dto.automation.DragApiScenarioModuleRequest; +import io.metersphere.api.service.ApiScenarioModuleService; +import io.metersphere.base.domain.ApiScenarioModule; +import io.metersphere.commons.constants.RoleConstants; +import io.metersphere.service.CheckOwnerService; +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresRoles; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +import javax.annotation.Resource; + +@RequestMapping("/api/automation/module") +@RestController +@RequiresRoles(value = {RoleConstants.ADMIN, RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER, RoleConstants.ORG_ADMIN}, logical = Logical.OR) +public class ApiScenarioModuleController { + + @Resource + ApiScenarioModuleService apiScenarioModuleService; + @Resource + private CheckOwnerService checkOwnerService; + + @GetMapping("/list/{projectId}") + public List getNodeByProjectId(@PathVariable String projectId) { + checkOwnerService.checkProjectOwner(projectId); + return apiScenarioModuleService.getNodeTreeByProjectId(projectId); + } + + @PostMapping("/add") + @RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR) + public String addNode(@RequestBody ApiScenarioModule node) { + return apiScenarioModuleService.addNode(node); + } + + @PostMapping("/edit") + @RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR) + public int editNode(@RequestBody DragApiScenarioModuleRequest node) { + return apiScenarioModuleService.editNode(node); + } + + @PostMapping("/delete") + @RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR) + public int deleteNode(@RequestBody List nodeIds) { + //nodeIds 包含删除节点ID及其所有子节点ID + return apiScenarioModuleService.deleteNode(nodeIds); + } + + @PostMapping("/drag") + @RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR) + public void dragNode(@RequestBody DragApiScenarioModuleRequest node) { + apiScenarioModuleService.dragNode(node); + } +} diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/ApiScenarioDTO.java b/backend/src/main/java/io/metersphere/api/dto/automation/ApiScenarioDTO.java new file mode 100644 index 0000000000..73f4272b5c --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/automation/ApiScenarioDTO.java @@ -0,0 +1,13 @@ +package io.metersphere.api.dto.automation; + +import io.metersphere.base.domain.ApiScenario; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class ApiScenarioDTO extends ApiScenario { + + private String projectName; + private String userName; +} diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/ApiScenarioModuleDTO.java b/backend/src/main/java/io/metersphere/api/dto/automation/ApiScenarioModuleDTO.java new file mode 100644 index 0000000000..40a463b38c --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/automation/ApiScenarioModuleDTO.java @@ -0,0 +1,16 @@ +package io.metersphere.api.dto.automation; + +import io.metersphere.base.domain.ApiScenarioModule; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class ApiScenarioModuleDTO extends ApiScenarioModule { + + private String label; + private List children; + +} diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/ApiScenarioRequest.java b/backend/src/main/java/io/metersphere/api/dto/automation/ApiScenarioRequest.java new file mode 100644 index 0000000000..accff480cf --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/automation/ApiScenarioRequest.java @@ -0,0 +1,26 @@ +package io.metersphere.api.dto.automation; + +import io.metersphere.controller.request.OrderRequest; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; +import java.util.Map; + +@Getter +@Setter +public class ApiScenarioRequest { + private String id; + private String excludeId; + private String projectId; + private String moduleId; + private List moduleIds; + private String name; + private String workspaceId; + private String userId; + private boolean recent = false; + private List orders; + private List filters; + private Map combine; + private List ids; +} diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/DragApiScenarioModuleRequest.java b/backend/src/main/java/io/metersphere/api/dto/automation/DragApiScenarioModuleRequest.java new file mode 100644 index 0000000000..9d9a5ee39a --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/automation/DragApiScenarioModuleRequest.java @@ -0,0 +1,15 @@ +package io.metersphere.api.dto.automation; + +import io.metersphere.base.domain.ApiScenarioModule; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class DragApiScenarioModuleRequest extends ApiScenarioModule { + + List nodeIds; + ApiScenarioModuleDTO nodeTree; +} 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 new file mode 100644 index 0000000000..9fe0085aa0 --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/automation/SaveApiScenarioRequest.java @@ -0,0 +1,38 @@ +package io.metersphere.api.dto.automation; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class SaveApiScenarioRequest { + private String id; + + private String projectId; + + private String tagId; + + private String userId; + + private String apiScenarioModuleId; + + private String modulePath; + + private String name; + + private String level; + + private String status; + + private String principal; + + private Integer stepTotal; + + private String followPeople; + + private String schedule; + + private String description; + + private String scenarioDefinition; +} diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/ScenarioStatus.java b/backend/src/main/java/io/metersphere/api/dto/automation/ScenarioStatus.java new file mode 100644 index 0000000000..ac3a2a6d66 --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/dto/automation/ScenarioStatus.java @@ -0,0 +1,5 @@ +package io.metersphere.api.dto.automation; + +public enum ScenarioStatus { + Saved, Success, Fail, Trash +} 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 9c89056ecb..032bb77c78 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -1,10 +1,113 @@ package io.metersphere.api.service; +import io.metersphere.api.dto.automation.ApiScenarioDTO; +import io.metersphere.api.dto.automation.ApiScenarioRequest; +import io.metersphere.api.dto.automation.SaveApiScenarioRequest; +import io.metersphere.api.dto.automation.ScenarioStatus; +import io.metersphere.base.domain.ApiScenario; +import io.metersphere.base.domain.ApiScenarioExample; +import io.metersphere.base.mapper.ApiScenarioMapper; +import io.metersphere.base.mapper.ext.ExtApiScenarioMapper; +import io.metersphere.commons.exception.MSException; +import io.metersphere.commons.utils.SessionUtils; +import io.metersphere.i18n.Translator; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; +import java.util.Objects; + +import javax.annotation.Resource; + @Service @Transactional(rollbackFor = Exception.class) public class ApiAutomationService { + @Resource + private ApiScenarioMapper apiScenarioMapper; + @Resource + private ExtApiScenarioMapper extApiScenarioMapper; + public List list(ApiScenarioRequest request) { + return extApiScenarioMapper.list(request); + } + + public void deleteByIds(List nodeIds) { + ApiScenarioExample example = new ApiScenarioExample(); + example.createCriteria().andApiScenarioModuleIdIn(nodeIds); + apiScenarioMapper.deleteByExample(example); + } + + public void create(SaveApiScenarioRequest request) { + checkNameExist(request); + final ApiScenario scenario = new ApiScenario(); + scenario.setId(request.getId()); + scenario.setName(request.getName()); + scenario.setProjectId(request.getProjectId()); + scenario.setTagId(request.getTagId()); + scenario.setApiScenarioModuleId(request.getApiScenarioModuleId()); + scenario.setModulePath(request.getModulePath()); + scenario.setLevel(request.getLevel()); + scenario.setFollowPeople(request.getFollowPeople()); + scenario.setPrincipal(request.getPrincipal()); + scenario.setStepTotal(request.getStepTotal()); + scenario.setScenarioDefinition(request.getScenarioDefinition()); + scenario.setCreateTime(System.currentTimeMillis()); + scenario.setUpdateTime(System.currentTimeMillis()); + scenario.setStatus(ScenarioStatus.Saved.name()); + if (request.getUserId() == null) { + scenario.setUserId(SessionUtils.getUserId()); + } else { + scenario.setUserId(request.getUserId()); + } + scenario.setDescription(request.getDescription()); + apiScenarioMapper.insert(scenario); + } + + public void update(SaveApiScenarioRequest request) { + checkNameExist(request); + final ApiScenario scenario = new ApiScenario(); + scenario.setId(request.getId()); + scenario.setName(request.getName()); + scenario.setProjectId(request.getProjectId()); + scenario.setTagId(request.getTagId()); + scenario.setApiScenarioModuleId(request.getApiScenarioModuleId()); + scenario.setModulePath(request.getModulePath()); + scenario.setLevel(request.getLevel()); + scenario.setFollowPeople(request.getFollowPeople()); + scenario.setPrincipal(request.getPrincipal()); + scenario.setStepTotal(request.getStepTotal()); + scenario.setScenarioDefinition(request.getScenarioDefinition()); + scenario.setUpdateTime(System.currentTimeMillis()); + scenario.setStatus(ScenarioStatus.Saved.name()); + scenario.setUserId(request.getUserId()); + scenario.setDescription(request.getDescription()); + apiScenarioMapper.updateByPrimaryKeySelective(scenario); + } + + public void delete(String id) { + apiScenarioMapper.deleteByPrimaryKey(id); + } + + public void deleteBatch(List ids) { + ApiScenarioExample example = new ApiScenarioExample(); + example.createCriteria().andIdIn(ids); + apiScenarioMapper.deleteByExample(example); + } + + public void removeToGc(List ids) { + ApiScenario record = new ApiScenario(); + record.setStatus(ScenarioStatus.Trash.name()); + ApiScenarioExample example = new ApiScenarioExample(); + example.createCriteria().andIdIn(ids); + apiScenarioMapper.updateByExampleSelective(record, example); + } + + private void checkNameExist(SaveApiScenarioRequest request) { + ApiScenarioExample example = new ApiScenarioExample(); + example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()) + .andApiScenarioModuleIdEqualTo(request.getApiScenarioModuleId()).andIdNotEqualTo(request.getId()); + if (apiScenarioMapper.countByExample(example) > 0) { + MSException.throwException(Translator.get("automation_name_already_exists")); + } + } } diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java new file mode 100644 index 0000000000..ffbdb54759 --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java @@ -0,0 +1,231 @@ +package io.metersphere.api.service; + + +import io.metersphere.api.dto.automation.ApiScenarioDTO; +import io.metersphere.api.dto.automation.ApiScenarioModuleDTO; +import io.metersphere.api.dto.automation.ApiScenarioRequest; +import io.metersphere.api.dto.automation.DragApiScenarioModuleRequest; +import io.metersphere.base.domain.ApiScenario; +import io.metersphere.base.domain.ApiScenarioModule; +import io.metersphere.base.domain.ApiScenarioModuleExample; +import io.metersphere.base.mapper.ApiScenarioMapper; +import io.metersphere.base.mapper.ApiScenarioModuleMapper; +import io.metersphere.commons.constants.TestCaseConstants; +import io.metersphere.commons.exception.MSException; +import io.metersphere.commons.utils.BeanUtils; +import io.metersphere.i18n.Translator; +import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.session.ExecutorType; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +@Service +@Transactional(rollbackFor = Exception.class) +public class ApiScenarioModuleService { + + @Resource + ApiScenarioModuleMapper apiScenarioModuleMapper; + @Resource + ApiAutomationService apiAutomationService; + @Resource + SqlSessionFactory sqlSessionFactory; + + public List getNodeTreeByProjectId(String projectId) { + ApiScenarioModuleExample example = new ApiScenarioModuleExample(); + example.createCriteria().andProjectIdEqualTo(projectId); + example.setOrderByClause("create_time asc"); + List nodes = apiScenarioModuleMapper.selectByExample(example); + return getNodeTrees(nodes); + } + + public List getNodeTrees(List nodes) { + List nodeTreeList = new ArrayList<>(); + Map> nodeLevelMap = new HashMap<>(); + nodes.forEach(node -> { + Integer level = node.getLevel(); + if (nodeLevelMap.containsKey(level)) { + nodeLevelMap.get(level).add(node); + } else { + List apiScenarioModules = new ArrayList<>(); + apiScenarioModules.add(node); + nodeLevelMap.put(node.getLevel(), apiScenarioModules); + } + }); + List rootNodes = Optional.ofNullable(nodeLevelMap.get(1)).orElse(new ArrayList<>()); + rootNodes.forEach(rootNode -> nodeTreeList.add(buildNodeTree(nodeLevelMap, rootNode))); + return nodeTreeList; + } + + /** + * 递归构建节点树 + */ + private ApiScenarioModuleDTO buildNodeTree(Map> nodeLevelMap, ApiScenarioModule rootNode) { + + ApiScenarioModuleDTO nodeTree = new ApiScenarioModuleDTO(); + BeanUtils.copyBean(nodeTree, rootNode); + nodeTree.setLabel(rootNode.getName()); + + List lowerNodes = nodeLevelMap.get(rootNode.getLevel() + 1); + if (lowerNodes == null) { + return nodeTree; + } + List children = Optional.ofNullable(nodeTree.getChildren()).orElse(new ArrayList<>()); + lowerNodes.forEach(node -> { + if (node.getParentId() != null && node.getParentId().equals(rootNode.getId())) { + children.add(buildNodeTree(nodeLevelMap, node)); + nodeTree.setChildren(children); + } + }); + + return nodeTree; + } + + public String addNode(ApiScenarioModule node) { + validateNode(node); + node.setCreateTime(System.currentTimeMillis()); + node.setUpdateTime(System.currentTimeMillis()); + node.setId(UUID.randomUUID().toString()); + apiScenarioModuleMapper.insertSelective(node); + return node.getId(); + } + + private void validateNode(ApiScenarioModule node) { + if (node.getLevel() > TestCaseConstants.MAX_NODE_DEPTH) { + throw new RuntimeException(Translator.get("test_case_node_level_tip") + + TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level")); + } + checkApiScenarioModuleExist(node); + } + + private void checkApiScenarioModuleExist(ApiScenarioModule node) { + if (node.getName() != null) { + ApiScenarioModuleExample example = new ApiScenarioModuleExample(); + ApiScenarioModuleExample.Criteria criteria = example.createCriteria(); + criteria.andNameEqualTo(node.getName()) + .andProjectIdEqualTo(node.getProjectId()); + if (StringUtils.isNotBlank(node.getParentId())) { + criteria.andParentIdEqualTo(node.getParentId()); + } else { + criteria.andParentIdIsNull(); + } + if (StringUtils.isNotBlank(node.getId())) { + criteria.andIdNotEqualTo(node.getId()); + } + if (apiScenarioModuleMapper.selectByExample(example).size() > 0) { + MSException.throwException(Translator.get("test_case_module_already_exists")); + } + } + } + + private List queryByModuleIds(List nodeIds) { + ApiScenarioRequest apiScenarioRequest = new ApiScenarioRequest(); + apiScenarioRequest.setModuleIds(nodeIds); + return apiAutomationService.list(apiScenarioRequest); + } + + public int editNode(DragApiScenarioModuleRequest request) { + request.setUpdateTime(System.currentTimeMillis()); + checkApiScenarioModuleExist(request); + List apiScenarios = queryByModuleIds(request.getNodeIds()); + + apiScenarios.forEach(apiScenario -> { + StringBuilder path = new StringBuilder(apiScenario.getModulePath()); + List pathLists = Arrays.asList(path.toString().split("/")); + pathLists.set(request.getLevel(), request.getName()); + path.delete(0, path.length()); + for (int i = 1; i < pathLists.size(); i++) { + path.append("/").append(pathLists.get(i)); + } + apiScenario.setModulePath(path.toString()); + }); + + batchUpdateApiScenario(apiScenarios); + + return apiScenarioModuleMapper.updateByPrimaryKeySelective(request); + } + + public int deleteNode(List nodeIds) { + apiAutomationService.deleteByIds(nodeIds); + + ApiScenarioModuleExample apiScenarioModuleExample = new ApiScenarioModuleExample(); + apiScenarioModuleExample.createCriteria().andIdIn(nodeIds); + return apiScenarioModuleMapper.deleteByExample(apiScenarioModuleExample); + } + + private void batchUpdateApiScenario(List apiScenarios) { + SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); + ApiScenarioMapper apiScenarioMapper = sqlSession.getMapper(ApiScenarioMapper.class); + apiScenarios.forEach(apiScenarioMapper::updateByPrimaryKey); + sqlSession.flushStatements(); + } + + public void dragNode(DragApiScenarioModuleRequest request) { + + checkApiScenarioModuleExist(request); + + List nodeIds = request.getNodeIds(); + + List apiScenarios = queryByModuleIds(nodeIds); + + ApiScenarioModuleDTO nodeTree = request.getNodeTree(); + + List updateNodes = new ArrayList<>(); + + buildUpdateDefinition(nodeTree, apiScenarios, updateNodes, "/", "0", nodeTree.getLevel()); + + updateNodes = updateNodes.stream() + .filter(item -> nodeIds.contains(item.getId())) + .collect(Collectors.toList()); + + batchUpdateModule(updateNodes); + + batchUpdateApiScenario(apiScenarios); + } + + private void buildUpdateDefinition(ApiScenarioModuleDTO rootNode, List apiScenarios, + List updateNodes, String rootPath, String pId, int level) { + + rootPath = rootPath + rootNode.getName(); + + if (level > 8) { + MSException.throwException(Translator.get("node_deep_limit")); + } + if (rootNode.getId().equals("root")) { + rootPath = ""; + } + ApiScenarioModule apiScenarioModule = new ApiScenarioModule(); + apiScenarioModule.setId(rootNode.getId()); + apiScenarioModule.setLevel(level); + apiScenarioModule.setParentId(pId); + updateNodes.add(apiScenarioModule); + + for (ApiScenario item : apiScenarios) { + if (StringUtils.equals(item.getApiScenarioModuleId(), rootNode.getId())) { + item.setModulePath(rootPath); + } + } + + List children = rootNode.getChildren(); + if (children != null && children.size() > 0) { + for (ApiScenarioModuleDTO child : children) { + buildUpdateDefinition(child, apiScenarios, updateNodes, rootPath + '/', rootNode.getId(), level + 1); + } + } + } + + private void batchUpdateModule(List updateNodes) { + SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); + ApiScenarioModuleMapper apiScenarioModuleMapper = sqlSession.getMapper(ApiScenarioModuleMapper.class); + updateNodes.forEach(apiScenarioModuleMapper::updateByPrimaryKeySelective); + sqlSession.flushStatements(); + } + + +} 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 20a6d7d8a8..ceba28c3dc 100644 --- a/backend/src/main/java/io/metersphere/base/domain/ApiScenario.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenario.java @@ -1,8 +1,7 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; @Data public class ApiScenario implements Serializable { @@ -10,9 +9,15 @@ public class ApiScenario implements Serializable { private String projectId; - private String name; + private String tagId; - private String scenarioId; + private String userId; + + private String apiScenarioModuleId; + + private String modulePath; + + private String name; private String level; @@ -20,17 +25,19 @@ public class ApiScenario implements Serializable { private String principal; - private String stepTotal; + private Integer stepTotal; private String followPeople; + private String schedule; + private String description; - private String scenarioDefinition; - - private String userId; - private Long createTime; private Long updateTime; + + private String scenarioDefinition; + + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiScenarioExample.java b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioExample.java new file mode 100644 index 0000000000..45c28b2630 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioExample.java @@ -0,0 +1,1290 @@ +package io.metersphere.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class ApiScenarioExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ApiScenarioExample() { + 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 andTagIdIsNull() { + addCriterion("tag_id is null"); + return (Criteria) this; + } + + public Criteria andTagIdIsNotNull() { + addCriterion("tag_id is not null"); + return (Criteria) this; + } + + public Criteria andTagIdEqualTo(String value) { + addCriterion("tag_id =", value, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdNotEqualTo(String value) { + addCriterion("tag_id <>", value, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdGreaterThan(String value) { + addCriterion("tag_id >", value, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdGreaterThanOrEqualTo(String value) { + addCriterion("tag_id >=", value, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdLessThan(String value) { + addCriterion("tag_id <", value, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdLessThanOrEqualTo(String value) { + addCriterion("tag_id <=", value, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdLike(String value) { + addCriterion("tag_id like", value, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdNotLike(String value) { + addCriterion("tag_id not like", value, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdIn(List values) { + addCriterion("tag_id in", values, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdNotIn(List values) { + addCriterion("tag_id not in", values, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdBetween(String value1, String value2) { + addCriterion("tag_id between", value1, value2, "tagId"); + return (Criteria) this; + } + + public Criteria andTagIdNotBetween(String value1, String value2) { + addCriterion("tag_id not between", value1, value2, "tagId"); + 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 andApiScenarioModuleIdIsNull() { + addCriterion("api_scenario_module_id is null"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdIsNotNull() { + addCriterion("api_scenario_module_id is not null"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdEqualTo(String value) { + addCriterion("api_scenario_module_id =", value, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdNotEqualTo(String value) { + addCriterion("api_scenario_module_id <>", value, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdGreaterThan(String value) { + addCriterion("api_scenario_module_id >", value, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdGreaterThanOrEqualTo(String value) { + addCriterion("api_scenario_module_id >=", value, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdLessThan(String value) { + addCriterion("api_scenario_module_id <", value, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdLessThanOrEqualTo(String value) { + addCriterion("api_scenario_module_id <=", value, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdLike(String value) { + addCriterion("api_scenario_module_id like", value, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdNotLike(String value) { + addCriterion("api_scenario_module_id not like", value, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdIn(List values) { + addCriterion("api_scenario_module_id in", values, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdNotIn(List values) { + addCriterion("api_scenario_module_id not in", values, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdBetween(String value1, String value2) { + addCriterion("api_scenario_module_id between", value1, value2, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andApiScenarioModuleIdNotBetween(String value1, String value2) { + addCriterion("api_scenario_module_id not between", value1, value2, "apiScenarioModuleId"); + return (Criteria) this; + } + + public Criteria andModulePathIsNull() { + addCriterion("module_path is null"); + return (Criteria) this; + } + + public Criteria andModulePathIsNotNull() { + addCriterion("module_path is not null"); + return (Criteria) this; + } + + public Criteria andModulePathEqualTo(String value) { + addCriterion("module_path =", value, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathNotEqualTo(String value) { + addCriterion("module_path <>", value, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathGreaterThan(String value) { + addCriterion("module_path >", value, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathGreaterThanOrEqualTo(String value) { + addCriterion("module_path >=", value, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathLessThan(String value) { + addCriterion("module_path <", value, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathLessThanOrEqualTo(String value) { + addCriterion("module_path <=", value, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathLike(String value) { + addCriterion("module_path like", value, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathNotLike(String value) { + addCriterion("module_path not like", value, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathIn(List values) { + addCriterion("module_path in", values, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathNotIn(List values) { + addCriterion("module_path not in", values, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathBetween(String value1, String value2) { + addCriterion("module_path between", value1, value2, "modulePath"); + return (Criteria) this; + } + + public Criteria andModulePathNotBetween(String value1, String value2) { + addCriterion("module_path not between", value1, value2, "modulePath"); + return (Criteria) this; + } + + 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 andLevelIsNull() { + addCriterion("`level` is null"); + return (Criteria) this; + } + + public Criteria andLevelIsNotNull() { + addCriterion("`level` is not null"); + return (Criteria) this; + } + + public Criteria andLevelEqualTo(String value) { + addCriterion("`level` =", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelNotEqualTo(String value) { + addCriterion("`level` <>", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelGreaterThan(String value) { + addCriterion("`level` >", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelGreaterThanOrEqualTo(String value) { + addCriterion("`level` >=", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelLessThan(String value) { + addCriterion("`level` <", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelLessThanOrEqualTo(String value) { + addCriterion("`level` <=", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelLike(String value) { + addCriterion("`level` like", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelNotLike(String value) { + addCriterion("`level` not like", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelIn(List values) { + addCriterion("`level` in", values, "level"); + return (Criteria) this; + } + + public Criteria andLevelNotIn(List values) { + addCriterion("`level` not in", values, "level"); + return (Criteria) this; + } + + public Criteria andLevelBetween(String value1, String value2) { + addCriterion("`level` between", value1, value2, "level"); + return (Criteria) this; + } + + public Criteria andLevelNotBetween(String value1, String value2) { + addCriterion("`level` not between", value1, value2, "level"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("`status` like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("`status` not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andPrincipalIsNull() { + addCriterion("principal is null"); + return (Criteria) this; + } + + public Criteria andPrincipalIsNotNull() { + addCriterion("principal is not null"); + return (Criteria) this; + } + + public Criteria andPrincipalEqualTo(String value) { + addCriterion("principal =", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotEqualTo(String value) { + addCriterion("principal <>", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalGreaterThan(String value) { + addCriterion("principal >", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalGreaterThanOrEqualTo(String value) { + addCriterion("principal >=", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalLessThan(String value) { + addCriterion("principal <", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalLessThanOrEqualTo(String value) { + addCriterion("principal <=", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalLike(String value) { + addCriterion("principal like", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotLike(String value) { + addCriterion("principal not like", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalIn(List values) { + addCriterion("principal in", values, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotIn(List values) { + addCriterion("principal not in", values, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalBetween(String value1, String value2) { + addCriterion("principal between", value1, value2, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotBetween(String value1, String value2) { + addCriterion("principal not between", value1, value2, "principal"); + return (Criteria) this; + } + + public Criteria andStepTotalIsNull() { + addCriterion("step_total is null"); + return (Criteria) this; + } + + public Criteria andStepTotalIsNotNull() { + addCriterion("step_total is not null"); + return (Criteria) this; + } + + public Criteria andStepTotalEqualTo(Integer value) { + addCriterion("step_total =", value, "stepTotal"); + return (Criteria) this; + } + + public Criteria andStepTotalNotEqualTo(Integer value) { + addCriterion("step_total <>", value, "stepTotal"); + return (Criteria) this; + } + + public Criteria andStepTotalGreaterThan(Integer value) { + addCriterion("step_total >", value, "stepTotal"); + return (Criteria) this; + } + + public Criteria andStepTotalGreaterThanOrEqualTo(Integer value) { + addCriterion("step_total >=", value, "stepTotal"); + return (Criteria) this; + } + + public Criteria andStepTotalLessThan(Integer value) { + addCriterion("step_total <", value, "stepTotal"); + return (Criteria) this; + } + + public Criteria andStepTotalLessThanOrEqualTo(Integer value) { + addCriterion("step_total <=", value, "stepTotal"); + return (Criteria) this; + } + + public Criteria andStepTotalIn(List values) { + addCriterion("step_total in", values, "stepTotal"); + return (Criteria) this; + } + + public Criteria andStepTotalNotIn(List values) { + addCriterion("step_total not in", values, "stepTotal"); + return (Criteria) this; + } + + public Criteria andStepTotalBetween(Integer value1, Integer value2) { + addCriterion("step_total between", value1, value2, "stepTotal"); + return (Criteria) this; + } + + public Criteria andStepTotalNotBetween(Integer value1, Integer value2) { + addCriterion("step_total not between", value1, value2, "stepTotal"); + return (Criteria) this; + } + + public Criteria andFollowPeopleIsNull() { + addCriterion("follow_people is null"); + return (Criteria) this; + } + + public Criteria andFollowPeopleIsNotNull() { + addCriterion("follow_people is not null"); + return (Criteria) this; + } + + public Criteria andFollowPeopleEqualTo(String value) { + addCriterion("follow_people =", value, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleNotEqualTo(String value) { + addCriterion("follow_people <>", value, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleGreaterThan(String value) { + addCriterion("follow_people >", value, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleGreaterThanOrEqualTo(String value) { + addCriterion("follow_people >=", value, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleLessThan(String value) { + addCriterion("follow_people <", value, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleLessThanOrEqualTo(String value) { + addCriterion("follow_people <=", value, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleLike(String value) { + addCriterion("follow_people like", value, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleNotLike(String value) { + addCriterion("follow_people not like", value, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleIn(List values) { + addCriterion("follow_people in", values, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleNotIn(List values) { + addCriterion("follow_people not in", values, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleBetween(String value1, String value2) { + addCriterion("follow_people between", value1, value2, "followPeople"); + return (Criteria) this; + } + + public Criteria andFollowPeopleNotBetween(String value1, String value2) { + addCriterion("follow_people not between", value1, value2, "followPeople"); + return (Criteria) this; + } + + public Criteria andScheduleIsNull() { + addCriterion("schedule is null"); + return (Criteria) this; + } + + public Criteria andScheduleIsNotNull() { + addCriterion("schedule is not null"); + return (Criteria) this; + } + + public Criteria andScheduleEqualTo(String value) { + addCriterion("schedule =", value, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleNotEqualTo(String value) { + addCriterion("schedule <>", value, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleGreaterThan(String value) { + addCriterion("schedule >", value, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleGreaterThanOrEqualTo(String value) { + addCriterion("schedule >=", value, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleLessThan(String value) { + addCriterion("schedule <", value, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleLessThanOrEqualTo(String value) { + addCriterion("schedule <=", value, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleLike(String value) { + addCriterion("schedule like", value, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleNotLike(String value) { + addCriterion("schedule not like", value, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleIn(List values) { + addCriterion("schedule in", values, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleNotIn(List values) { + addCriterion("schedule not in", values, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleBetween(String value1, String value2) { + addCriterion("schedule between", value1, value2, "schedule"); + return (Criteria) this; + } + + public Criteria andScheduleNotBetween(String value1, String value2) { + addCriterion("schedule not between", value1, value2, "schedule"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + 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/ApiScenarioModule.java b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioModule.java index 9981a8982e..ca48bfb138 100644 --- a/backend/src/main/java/io/metersphere/base/domain/ApiScenarioModule.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioModule.java @@ -1,8 +1,7 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; @Data public class ApiScenarioModule implements Serializable { @@ -12,14 +11,13 @@ public class ApiScenarioModule implements Serializable { private String name; - private String userId; - private String parentId; - private String level; + private Integer level; 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/ApiScenarioModuleExample.java b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioModuleExample.java new file mode 100644 index 0000000000..48d8f981dd --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioModuleExample.java @@ -0,0 +1,660 @@ +package io.metersphere.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class ApiScenarioModuleExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ApiScenarioModuleExample() { + 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 andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(String value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(String value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(String value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(String value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(String value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(String value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLike(String value) { + addCriterion("parent_id like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotLike(String value) { + addCriterion("parent_id not like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(String value1, String value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(String value1, String value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andLevelIsNull() { + addCriterion("`level` is null"); + return (Criteria) this; + } + + public Criteria andLevelIsNotNull() { + addCriterion("`level` is not null"); + return (Criteria) this; + } + + public Criteria andLevelEqualTo(Integer value) { + addCriterion("`level` =", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelNotEqualTo(Integer value) { + addCriterion("`level` <>", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelGreaterThan(Integer value) { + addCriterion("`level` >", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelGreaterThanOrEqualTo(Integer value) { + addCriterion("`level` >=", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelLessThan(Integer value) { + addCriterion("`level` <", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelLessThanOrEqualTo(Integer value) { + addCriterion("`level` <=", value, "level"); + return (Criteria) this; + } + + public Criteria andLevelIn(List values) { + addCriterion("`level` in", values, "level"); + return (Criteria) this; + } + + public Criteria andLevelNotIn(List values) { + addCriterion("`level` not in", values, "level"); + return (Criteria) this; + } + + public Criteria andLevelBetween(Integer value1, Integer value2) { + addCriterion("`level` between", value1, value2, "level"); + return (Criteria) this; + } + + public Criteria andLevelNotBetween(Integer value1, Integer value2) { + addCriterion("`level` not between", value1, value2, "level"); + 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/mapper/ApiScenarioMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioMapper.java new file mode 100644 index 0000000000..340b205de8 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioMapper.java @@ -0,0 +1,36 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.ApiScenario; +import io.metersphere.base.domain.ApiScenarioExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ApiScenarioMapper { + long countByExample(ApiScenarioExample example); + + int deleteByExample(ApiScenarioExample example); + + int deleteByPrimaryKey(String id); + + int insert(ApiScenario record); + + int insertSelective(ApiScenario record); + + List selectByExampleWithBLOBs(ApiScenarioExample example); + + List selectByExample(ApiScenarioExample example); + + ApiScenario selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") ApiScenario record, @Param("example") ApiScenarioExample example); + + int updateByExampleWithBLOBs(@Param("record") ApiScenario record, @Param("example") ApiScenarioExample example); + + int updateByExample(@Param("record") ApiScenario record, @Param("example") ApiScenarioExample example); + + int updateByPrimaryKeySelective(ApiScenario record); + + int updateByPrimaryKeyWithBLOBs(ApiScenario record); + + int updateByPrimaryKey(ApiScenario record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioMapper.xml new file mode 100644 index 0000000000..bca2504e6d --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioMapper.xml @@ -0,0 +1,465 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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, tag_id, user_id, api_scenario_module_id, module_path, `name`, `level`, + `status`, principal, step_total, follow_people, schedule, description, create_time, + update_time + + + scenario_definition + + + + + + delete from api_scenario + where id = #{id,jdbcType=VARCHAR} + + + delete from api_scenario + + + + + + insert into api_scenario (id, project_id, tag_id, + user_id, api_scenario_module_id, module_path, + `name`, `level`, `status`, + principal, step_total, follow_people, + schedule, description, create_time, + update_time, scenario_definition) + values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{tagId,jdbcType=VARCHAR}, + #{userId,jdbcType=VARCHAR}, #{apiScenarioModuleId,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, + #{principal,jdbcType=VARCHAR}, #{stepTotal,jdbcType=INTEGER}, #{followPeople,jdbcType=VARCHAR}, + #{schedule,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, + #{updateTime,jdbcType=BIGINT}, #{scenarioDefinition,jdbcType=LONGVARCHAR}) + + + insert into api_scenario + + + id, + + + project_id, + + + tag_id, + + + user_id, + + + api_scenario_module_id, + + + module_path, + + + `name`, + + + `level`, + + + `status`, + + + principal, + + + step_total, + + + follow_people, + + + schedule, + + + description, + + + create_time, + + + update_time, + + + scenario_definition, + + + + + #{id,jdbcType=VARCHAR}, + + + #{projectId,jdbcType=VARCHAR}, + + + #{tagId,jdbcType=VARCHAR}, + + + #{userId,jdbcType=VARCHAR}, + + + #{apiScenarioModuleId,jdbcType=VARCHAR}, + + + #{modulePath,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{level,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{principal,jdbcType=VARCHAR}, + + + #{stepTotal,jdbcType=INTEGER}, + + + #{followPeople,jdbcType=VARCHAR}, + + + #{schedule,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + #{scenarioDefinition,jdbcType=LONGVARCHAR}, + + + + + + update api_scenario + + + id = #{record.id,jdbcType=VARCHAR}, + + + project_id = #{record.projectId,jdbcType=VARCHAR}, + + + tag_id = #{record.tagId,jdbcType=VARCHAR}, + + + user_id = #{record.userId,jdbcType=VARCHAR}, + + + api_scenario_module_id = #{record.apiScenarioModuleId,jdbcType=VARCHAR}, + + + module_path = #{record.modulePath,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + `level` = #{record.level,jdbcType=VARCHAR}, + + + `status` = #{record.status,jdbcType=VARCHAR}, + + + principal = #{record.principal,jdbcType=VARCHAR}, + + + step_total = #{record.stepTotal,jdbcType=INTEGER}, + + + follow_people = #{record.followPeople,jdbcType=VARCHAR}, + + + schedule = #{record.schedule,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + scenario_definition = #{record.scenarioDefinition,jdbcType=LONGVARCHAR}, + + + + + + + + update api_scenario + set id = #{record.id,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + tag_id = #{record.tagId,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=VARCHAR}, + api_scenario_module_id = #{record.apiScenarioModuleId,jdbcType=VARCHAR}, + module_path = #{record.modulePath,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + `level` = #{record.level,jdbcType=VARCHAR}, + `status` = #{record.status,jdbcType=VARCHAR}, + principal = #{record.principal,jdbcType=VARCHAR}, + step_total = #{record.stepTotal,jdbcType=INTEGER}, + follow_people = #{record.followPeople,jdbcType=VARCHAR}, + schedule = #{record.schedule,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + scenario_definition = #{record.scenarioDefinition,jdbcType=LONGVARCHAR} + + + + + + update api_scenario + set id = #{record.id,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + tag_id = #{record.tagId,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=VARCHAR}, + api_scenario_module_id = #{record.apiScenarioModuleId,jdbcType=VARCHAR}, + module_path = #{record.modulePath,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + `level` = #{record.level,jdbcType=VARCHAR}, + `status` = #{record.status,jdbcType=VARCHAR}, + principal = #{record.principal,jdbcType=VARCHAR}, + step_total = #{record.stepTotal,jdbcType=INTEGER}, + follow_people = #{record.followPeople,jdbcType=VARCHAR}, + schedule = #{record.schedule,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + + + update api_scenario + + + project_id = #{projectId,jdbcType=VARCHAR}, + + + tag_id = #{tagId,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=VARCHAR}, + + + api_scenario_module_id = #{apiScenarioModuleId,jdbcType=VARCHAR}, + + + module_path = #{modulePath,jdbcType=VARCHAR}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + `level` = #{level,jdbcType=VARCHAR}, + + + `status` = #{status,jdbcType=VARCHAR}, + + + principal = #{principal,jdbcType=VARCHAR}, + + + step_total = #{stepTotal,jdbcType=INTEGER}, + + + follow_people = #{followPeople,jdbcType=VARCHAR}, + + + schedule = #{schedule,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + scenario_definition = #{scenarioDefinition,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=VARCHAR} + + + update api_scenario + set project_id = #{projectId,jdbcType=VARCHAR}, + tag_id = #{tagId,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=VARCHAR}, + api_scenario_module_id = #{apiScenarioModuleId,jdbcType=VARCHAR}, + module_path = #{modulePath,jdbcType=VARCHAR}, + `name` = #{name,jdbcType=VARCHAR}, + `level` = #{level,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=VARCHAR}, + principal = #{principal,jdbcType=VARCHAR}, + step_total = #{stepTotal,jdbcType=INTEGER}, + follow_people = #{followPeople,jdbcType=VARCHAR}, + schedule = #{schedule,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT}, + scenario_definition = #{scenarioDefinition,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + update api_scenario + set project_id = #{projectId,jdbcType=VARCHAR}, + tag_id = #{tagId,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=VARCHAR}, + api_scenario_module_id = #{apiScenarioModuleId,jdbcType=VARCHAR}, + module_path = #{modulePath,jdbcType=VARCHAR}, + `name` = #{name,jdbcType=VARCHAR}, + `level` = #{level,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=VARCHAR}, + principal = #{principal,jdbcType=VARCHAR}, + step_total = #{stepTotal,jdbcType=INTEGER}, + follow_people = #{followPeople,jdbcType=VARCHAR}, + schedule = #{schedule,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioModuleMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioModuleMapper.java new file mode 100644 index 0000000000..b0a492dc26 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioModuleMapper.java @@ -0,0 +1,30 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.ApiScenarioModule; +import io.metersphere.base.domain.ApiScenarioModuleExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ApiScenarioModuleMapper { + long countByExample(ApiScenarioModuleExample example); + + int deleteByExample(ApiScenarioModuleExample example); + + int deleteByPrimaryKey(String id); + + int insert(ApiScenarioModule record); + + int insertSelective(ApiScenarioModule record); + + List selectByExample(ApiScenarioModuleExample example); + + ApiScenarioModule selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") ApiScenarioModule record, @Param("example") ApiScenarioModuleExample example); + + int updateByExample(@Param("record") ApiScenarioModule record, @Param("example") ApiScenarioModuleExample example); + + int updateByPrimaryKeySelective(ApiScenarioModule record); + + int updateByPrimaryKey(ApiScenarioModule record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioModuleMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioModuleMapper.xml new file mode 100644 index 0000000000..ca711317ba --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiScenarioModuleMapper.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + 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`, parent_id, `level`, create_time, update_time + + + + + delete from api_scenario_module + where id = #{id,jdbcType=VARCHAR} + + + delete from api_scenario_module + + + + + + insert into api_scenario_module (id, project_id, `name`, + parent_id, `level`, create_time, + update_time) + values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{parentId,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, + #{updateTime,jdbcType=BIGINT}) + + + insert into api_scenario_module + + + id, + + + project_id, + + + `name`, + + + parent_id, + + + `level`, + + + create_time, + + + update_time, + + + + + #{id,jdbcType=VARCHAR}, + + + #{projectId,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{parentId,jdbcType=VARCHAR}, + + + #{level,jdbcType=INTEGER}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + + + + update api_scenario_module + + + id = #{record.id,jdbcType=VARCHAR}, + + + project_id = #{record.projectId,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + parent_id = #{record.parentId,jdbcType=VARCHAR}, + + + `level` = #{record.level,jdbcType=INTEGER}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + + + + + + update api_scenario_module + set id = #{record.id,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + parent_id = #{record.parentId,jdbcType=VARCHAR}, + `level` = #{record.level,jdbcType=INTEGER}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + + + update api_scenario_module + + + project_id = #{projectId,jdbcType=VARCHAR}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + parent_id = #{parentId,jdbcType=VARCHAR}, + + + `level` = #{level,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=VARCHAR} + + + update api_scenario_module + set project_id = #{projectId,jdbcType=VARCHAR}, + `name` = #{name,jdbcType=VARCHAR}, + parent_id = #{parentId,jdbcType=VARCHAR}, + `level` = #{level,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} + + \ No newline at end of file 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 new file mode 100644 index 0000000000..9ce5b75d15 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.java @@ -0,0 +1,11 @@ +package io.metersphere.base.mapper.ext; + +import io.metersphere.api.dto.automation.ApiScenarioDTO; +import io.metersphere.api.dto.automation.ApiScenarioRequest; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface ExtApiScenarioMapper { + List list(@Param("request") ApiScenarioRequest request); +} 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 new file mode 100644 index 0000000000..4fdf4761e2 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index 8cf497635c..b627fe4fb5 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -172,6 +172,8 @@ api_definition_url_not_repeating=The interface request address already exists task_notification_jenkins=Jenkins Task notification task_notification=Result notification message_task_already_exists=Task recipient already exists +#automation +automation_name_already_exists=the scenario already exists in the project and the module diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index c659fa7432..89c8359ead 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -172,4 +172,6 @@ task_notification_=定时任务结果通知 api_definition_url_not_repeating=接口请求地址已经存在 task_notification_jenkins=jenkins任务通知 task_notification=任务通知 -message_task_already_exists=任务接收人已经存在 \ No newline at end of file +message_task_already_exists=任务接收人已经存在 +#automation +automation_name_already_exists=同一个项目和模块下,场景名称不能重复 \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 491a543523..ddd705a53e 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -174,4 +174,5 @@ task_notification=任務通知 task_notification_=定時任務通知 api_definition_url_not_repeating=接口請求地址已經存在 message_task_already_exists=任務接收人已經存在 - +#automation +automation_name_already_exists=同一個項目和模塊下,場景名稱不能重複 diff --git a/frontend/src/business/components/api/automation/ApiAutomation.vue b/frontend/src/business/components/api/automation/ApiAutomation.vue index 6679eaf355..b73f577658 100644 --- a/frontend/src/business/components/api/automation/ApiAutomation.vue +++ b/frontend/src/business/components/api/automation/ApiAutomation.vue @@ -1,23 +1,113 @@ diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue new file mode 100644 index 0000000000..69f50471d5 --- /dev/null +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -0,0 +1,461 @@ + + + + + diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index d9108754b2..e89c29f114 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -542,7 +542,32 @@ export default { scenario_import: "场景导入", customize_script: "自定义脚本", customize_req: "自定义请求", - reference_info: "请选择接口或用例" + reference_info: "请选择接口或用例", + scenario_test: "场景", + add_scenario: "创建场景", + scenario_name: "场景名称", + case_level: "用例等级", + tag: "标签", + creator: "创建人", + update_time: "最后更新时间", + step: "步骤数", + last_result: "最后结果", + passing_rate: "通过率", + success: "通过", + fail: "失败", + saved: "保存", + trash: "回收", + edit: "编辑", + execute: "执行", + copy: "复制", + remove: "删除", + scenario: { + principal: "责任人", + select_principal: "请选择责任人", + follow_people: "关注人", + select_table: "选择可见数据", + select_all: "选择全部数据" + } }, environment: { name: "环境名称",