Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
q4speed 2020-05-12 16:32:20 +08:00
commit 285e79920f
71 changed files with 213 additions and 372 deletions

View File

@ -1,8 +1,8 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.LoadTestReport;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.ReportDTO;
import io.metersphere.performance.controller.request.ReportRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;

View File

@ -1,12 +1,8 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.TestCase;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.controller.request.testcase.QueryTestCaseRequest;
import io.metersphere.controller.request.testplancase.QueryTestPlanCaseRequest;
import io.metersphere.dto.ReportDTO;
import io.metersphere.dto.TestCaseDTO;
import io.metersphere.dto.TestPlanCaseDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;

View File

@ -15,7 +15,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
/**
* 统一处理返回结果集
*/
@RestControllerAdvice(value = {"io.metersphere.controller", "io.metersphere.api.controller"})
@RestControllerAdvice(value = {"io.metersphere"})
public class ResultResponseBodyAdvice implements ResponseBodyAdvice<Object> {
@Override

View File

@ -1,24 +1,11 @@
package io.metersphere.controller.request;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class LoginRequest {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

View File

@ -1,8 +1,10 @@
package io.metersphere.controller.request;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Data
@Getter
@Setter
public class OrderRequest {
private String name;
private String type;

View File

@ -1,13 +1,10 @@
package io.metersphere.controller.request;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class OrganizationRequest {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -1,22 +1,11 @@
package io.metersphere.controller.request;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ProjectRequest {
private String workspaceId;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getWorkspaceId() {
return workspaceId;
}
public void setWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId;
}
}

View File

@ -1,22 +0,0 @@
package io.metersphere.controller.request;
public class ReportRequest {
private String name;
private String workspaceId;
public String getWorkspaceId() {
return workspaceId;
}
public void setWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -1,32 +1,12 @@
package io.metersphere.controller.request;
public class UserRequest {
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class UserRequest {
private String id;
private String name;
private String email;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}

View File

@ -1,22 +1,11 @@
package io.metersphere.controller.request;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class WorkspaceRequest {
private String organizationId;
private String name;
public String getOrganizationId() {
return organizationId;
}
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -1,34 +1,15 @@
package io.metersphere.controller.request.member;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class AddMemberRequest {
private String workspaceId;
private List<String> userIds;
private List<String> roleIds;
public List<String> getRoleIds() {
return roleIds;
}
public void setRoleIds(List<String> roleIds) {
this.roleIds = roleIds;
}
public String getWorkspaceId() {
return workspaceId;
}
public void setWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId;
}
public List<String> getUserIds() {
return userIds;
}
public void setUserIds(List<String> userIds) {
this.userIds = userIds;
}
}

View File

@ -1,9 +1,12 @@
package io.metersphere.controller.request.member;
import lombok.Data;
@Data
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class EditPassWordRequest {
private String password;
private String newpassword;
private String id;
private String password;
private String newpassword;
private String id;
}

View File

@ -1,23 +1,11 @@
package io.metersphere.controller.request.member;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class QueryMemberRequest {
private String name;
private String workspaceId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getWorkspaceId() {
return workspaceId;
}
public void setWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId;
}
}

View File

@ -1,34 +1,15 @@
package io.metersphere.controller.request.organization;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class AddOrgMemberRequest {
private String organizationId;
private List<String> userIds;
private List<String> roleIds;
public String getOrganizationId() {
return organizationId;
}
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId;
}
public List<String> getUserIds() {
return userIds;
}
public void setUserIds(List<String> userIds) {
this.userIds = userIds;
}
public List<String> getRoleIds() {
return roleIds;
}
public void setRoleIds(List<String> roleIds) {
this.roleIds = roleIds;
}
}

View File

@ -1,24 +1,11 @@
package io.metersphere.controller.request.organization;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class QueryOrgMemberRequest {
private String name;
private String organizationId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOrganizationId() {
return organizationId;
}
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId;
}
}

View File

@ -1,14 +1,10 @@
package io.metersphere.controller.request.resourcepool;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class QueryResourcePoolRequest {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -1,8 +1,10 @@
package io.metersphere.controller.request.testCaseReport;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Data
@Getter
@Setter
public class CreateReportRequest {
String planId;
String templateId;

View File

@ -1,9 +1,11 @@
package io.metersphere.controller.request.testCaseReport;
import io.metersphere.base.domain.TestCaseReportTemplate;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Data
@Getter
@Setter
public class QueryTemplateRequest extends TestCaseReportTemplate {
Boolean queryDefault;
}

View File

@ -1,26 +1,14 @@
package io.metersphere.controller.request.testcase;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
public class PlanCaseRelevanceRequest {
private String planId;
private List<String> testCaseIds = new ArrayList<>();
public String getPlanId() {
return planId;
}
public void setPlanId(String planId) {
this.planId = planId;
}
public List<String> getTestCaseIds() {
return testCaseIds;
}
public void setTestCaseIds(List<String> testCaseIds) {
this.testCaseIds = testCaseIds;
}
}

View File

@ -2,12 +2,14 @@ package io.metersphere.controller.request.testcase;
import io.metersphere.base.domain.TestCase;
import io.metersphere.controller.request.OrderRequest;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.Map;
@Data
@Getter
@Setter
public class QueryTestCaseRequest extends TestCase {
private List<String> nodeIds;

View File

@ -1,19 +1,12 @@
package io.metersphere.controller.request.testcase;
import io.metersphere.base.domain.TestCase;
import io.metersphere.base.domain.TestPlan;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class QueryTestPlanRequest extends TestPlan {
private boolean recent = false;
public boolean isRecent() {
return recent;
}
public void setRecent(boolean recent) {
this.recent = recent;
}
}

View File

@ -1,19 +1,13 @@
package io.metersphere.controller.request.testcase;
import io.metersphere.base.domain.TestCaseWithBLOBs;
import io.metersphere.base.domain.TestPlanTestCase;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class TestCaseBatchRequest extends TestCaseWithBLOBs {
private List<String> ids;
public List<String> getIds() {
return ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}
}

View File

@ -1,14 +1,13 @@
package io.metersphere.controller.request.testcase;
import io.metersphere.base.domain.TestCase;
import io.metersphere.base.domain.TestPlanTestCase;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Data
@Getter
@Setter
public class TestPlanCaseBatchRequest extends TestPlanTestCase {
private List<String> ids;
}

View File

@ -1,17 +1,13 @@
package io.metersphere.controller.request.testplan;
import io.metersphere.base.domain.FileMetadata;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class EditTestPlanRequest extends TestPlanRequest {
private List<FileMetadata> updatedFileList;
public List<FileMetadata> getUpdatedFileList() {
return updatedFileList;
}
public void setUpdatedFileList(List<FileMetadata> updatedFileList) {
this.updatedFileList = updatedFileList;
}
}

View File

@ -1,22 +1,11 @@
package io.metersphere.controller.request.testplan;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class FileOperationRequest {
private String id;
private String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -1,8 +1,10 @@
package io.metersphere.controller.request.testplan;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Data
@Getter
@Setter
public class QueryTestPlanRequest extends TestPlanRequest {
private String workspaceId;
private boolean recent = false; // 表示查询最近的测试

View File

@ -1,8 +1,10 @@
package io.metersphere.controller.request.testplan;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Data
@Getter
@Setter
public class TestPlanRequest {
private String id;

View File

@ -2,12 +2,14 @@ package io.metersphere.controller.request.testplancase;
import io.metersphere.base.domain.TestPlanTestCase;
import io.metersphere.controller.request.OrderRequest;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
import java.util.Map;
@Data
@Getter
@Setter
public class QueryTestPlanCaseRequest extends TestPlanTestCase {
private List<String> nodeIds;

View File

@ -1,4 +1,4 @@
package io.metersphere.report.base;
package io.metersphere.performance.base;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package io.metersphere.report.base;
package io.metersphere.performance.base;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package io.metersphere.report.base;
package io.metersphere.performance.base;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package io.metersphere.report.base;
package io.metersphere.performance.base;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package io.metersphere.report.base;
package io.metersphere.performance.base;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package io.metersphere.report.base;
package io.metersphere.performance.base;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package io.metersphere.controller;
package io.metersphere.performance.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
@ -6,11 +6,11 @@ import io.metersphere.base.domain.LoadTestReport;
import io.metersphere.commons.constants.RoleConstants;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.LogDetailDTO;
import io.metersphere.dto.ReportDTO;
import io.metersphere.report.base.*;
import io.metersphere.service.ReportService;
import io.metersphere.performance.base.*;
import io.metersphere.performance.controller.request.ReportRequest;
import io.metersphere.performance.service.ReportService;
import io.metersphere.user.SessionUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;

View File

@ -1,4 +1,4 @@
package io.metersphere.controller;
package io.metersphere.performance.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
@ -8,8 +8,8 @@ import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.testplan.*;
import io.metersphere.dto.LoadTestDTO;
import io.metersphere.performance.service.PerformanceTestService;
import io.metersphere.service.FileService;
import io.metersphere.service.PerformanceTestService;
import io.metersphere.user.SessionUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;

View File

@ -0,0 +1,11 @@
package io.metersphere.performance.controller.request;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ReportRequest {
private String name;
private String workspaceId;
}

View File

@ -1,4 +1,4 @@
package io.metersphere.engine;
package io.metersphere.performance.engine;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@ -11,7 +11,7 @@ import io.metersphere.commons.constants.ResourcePoolTypeEnum;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.config.JmeterProperties;
import io.metersphere.service.PerformanceTestService;
import io.metersphere.performance.service.PerformanceTestService;
import io.metersphere.service.TestResourcePoolService;
import io.metersphere.service.TestResourceService;
import org.apache.commons.collections.CollectionUtils;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine;
package io.metersphere.performance.engine;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine;
package io.metersphere.performance.engine;
import java.util.HashMap;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine;
package io.metersphere.performance.engine;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -10,11 +10,11 @@ import io.metersphere.commons.constants.FileType;
import io.metersphere.commons.constants.ResourcePoolTypeEnum;
import io.metersphere.commons.exception.MSException;
import io.metersphere.config.KafkaProperties;
import io.metersphere.engine.docker.DockerTestEngine;
import io.metersphere.engine.kubernetes.KubernetesTestEngine;
import io.metersphere.i18n.Translator;
import io.metersphere.parse.EngineSourceParser;
import io.metersphere.parse.EngineSourceParserFactory;
import io.metersphere.performance.engine.docker.DockerTestEngine;
import io.metersphere.performance.engine.kubernetes.KubernetesTestEngine;
import io.metersphere.performance.parse.EngineSourceParser;
import io.metersphere.performance.parse.EngineSourceParserFactory;
import io.metersphere.service.FileService;
import io.metersphere.service.TestResourcePoolService;
import org.apache.commons.collections.CollectionUtils;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine;
package io.metersphere.performance.engine;
import java.util.concurrent.atomic.AtomicBoolean;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.docker;
package io.metersphere.performance.engine.docker;
import com.alibaba.fastjson.JSON;
import io.metersphere.base.domain.LoadTestWithBLOBs;
@ -7,11 +7,11 @@ import io.metersphere.commons.constants.ResourceStatusEnum;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.dto.NodeDTO;
import io.metersphere.engine.AbstractEngine;
import io.metersphere.engine.EngineContext;
import io.metersphere.engine.EngineFactory;
import io.metersphere.engine.docker.request.TestRequest;
import io.metersphere.i18n.Translator;
import io.metersphere.performance.engine.AbstractEngine;
import io.metersphere.performance.engine.EngineContext;
import io.metersphere.performance.engine.EngineFactory;
import io.metersphere.performance.engine.docker.request.TestRequest;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.docker.request;
package io.metersphere.performance.engine.docker.request;
public class BaseRequest {
private String testId;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.docker.request;
package io.metersphere.performance.engine.docker.request;
import java.util.HashMap;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes;
package io.metersphere.performance.engine.kubernetes;
import com.alibaba.fastjson.JSON;
import io.fabric8.kubernetes.api.model.ConfigMap;
@ -8,14 +8,14 @@ import io.metersphere.base.domain.LoadTestWithBLOBs;
import io.metersphere.commons.constants.FileType;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.engine.AbstractEngine;
import io.metersphere.engine.EngineContext;
import io.metersphere.engine.EngineFactory;
import io.metersphere.engine.kubernetes.crds.jmeter.Jmeter;
import io.metersphere.engine.kubernetes.crds.jmeter.JmeterSpec;
import io.metersphere.engine.kubernetes.provider.ClientCredential;
import io.metersphere.engine.kubernetes.provider.KubernetesProvider;
import io.metersphere.i18n.Translator;
import io.metersphere.performance.engine.AbstractEngine;
import io.metersphere.performance.engine.EngineContext;
import io.metersphere.performance.engine.EngineFactory;
import io.metersphere.performance.engine.kubernetes.crds.jmeter.Jmeter;
import io.metersphere.performance.engine.kubernetes.crds.jmeter.JmeterSpec;
import io.metersphere.performance.engine.kubernetes.provider.ClientCredential;
import io.metersphere.performance.engine.kubernetes.provider.KubernetesProvider;
import org.apache.commons.collections.MapUtils;
import java.util.HashMap;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.crds;
package io.metersphere.performance.engine.kubernetes.crds;
import io.fabric8.kubernetes.client.CustomResource;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.crds;
package io.metersphere.performance.engine.kubernetes.crds;
import io.fabric8.kubernetes.api.builder.Function;
import io.fabric8.kubernetes.client.CustomResourceDoneable;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.crds;
package io.metersphere.performance.engine.kubernetes.crds;
import io.fabric8.kubernetes.client.CustomResourceList;

View File

@ -1,6 +1,6 @@
package io.metersphere.engine.kubernetes.crds.jmeter;
package io.metersphere.performance.engine.kubernetes.crds.jmeter;
import io.metersphere.engine.kubernetes.crds.MeterSphereCustomResource;
import io.metersphere.performance.engine.kubernetes.crds.MeterSphereCustomResource;
public class Jmeter extends MeterSphereCustomResource {
public static final String CRD = "jmeters.metersphere.io";

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.crds.jmeter;
package io.metersphere.performance.engine.kubernetes.crds.jmeter;
import io.fabric8.kubernetes.api.builder.Function;
import io.fabric8.kubernetes.client.CustomResourceDoneable;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.crds.jmeter;
package io.metersphere.performance.engine.kubernetes.crds.jmeter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.crds.jmeter;
package io.metersphere.performance.engine.kubernetes.crds.jmeter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.provider;
package io.metersphere.performance.engine.kubernetes.provider;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -8,9 +8,9 @@ import io.fabric8.kubernetes.client.ConfigBuilder;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.dsl.*;
import io.metersphere.engine.kubernetes.crds.MeterSphereCustomResource;
import io.metersphere.engine.kubernetes.crds.MeterSphereCustomResourceDoneable;
import io.metersphere.engine.kubernetes.crds.MeterSphereCustomResourceList;
import io.metersphere.performance.engine.kubernetes.crds.MeterSphereCustomResource;
import io.metersphere.performance.engine.kubernetes.crds.MeterSphereCustomResourceDoneable;
import io.metersphere.performance.engine.kubernetes.crds.MeterSphereCustomResourceList;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.provider;
package io.metersphere.performance.engine.kubernetes.provider;
public class ClientCredential {

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.provider;
package io.metersphere.performance.engine.kubernetes.provider;
public class DockerRegistry {

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.provider;
package io.metersphere.performance.engine.kubernetes.provider;
import com.alibaba.fastjson.JSONObject;

View File

@ -1,4 +1,4 @@
package io.metersphere.engine.kubernetes.provider;
package io.metersphere.performance.engine.kubernetes.provider;
public class KubernetesProvider extends AbstractClientProvider {
public KubernetesProvider(String credential) {

View File

@ -1,6 +1,6 @@
package io.metersphere.parse;
package io.metersphere.performance.parse;
import io.metersphere.engine.EngineContext;
import io.metersphere.performance.engine.EngineContext;
import java.io.InputStream;

View File

@ -1,7 +1,7 @@
package io.metersphere.parse;
package io.metersphere.performance.parse;
import io.metersphere.commons.constants.FileType;
import io.metersphere.parse.xml.XmlEngineSourceParse;
import io.metersphere.performance.parse.xml.XmlEngineSourceParse;
public class EngineSourceParserFactory {
public static EngineSourceParser createEngineSourceParser(String type) {

View File

@ -1,9 +1,9 @@
package io.metersphere.parse.xml;
package io.metersphere.performance.parse.xml;
import io.metersphere.engine.EngineContext;
import io.metersphere.parse.EngineSourceParser;
import io.metersphere.parse.xml.reader.DocumentParser;
import io.metersphere.parse.xml.reader.DocumentParserFactory;
import io.metersphere.performance.engine.EngineContext;
import io.metersphere.performance.parse.EngineSourceParser;
import io.metersphere.performance.parse.xml.reader.DocumentParser;
import io.metersphere.performance.parse.xml.reader.DocumentParserFactory;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;

View File

@ -1,10 +1,8 @@
package io.metersphere.parse.xml.reader;
package io.metersphere.performance.parse.xml.reader;
import io.metersphere.engine.EngineContext;
import io.metersphere.performance.engine.EngineContext;
import org.w3c.dom.Document;
import java.io.InputStream;
public interface DocumentParser {
String parse(EngineContext context, Document document) throws Exception;
}

View File

@ -1,7 +1,7 @@
package io.metersphere.parse.xml.reader;
package io.metersphere.performance.parse.xml.reader;
import io.metersphere.commons.constants.FileType;
import io.metersphere.parse.xml.reader.jmx.JmeterDocumentParser;
import io.metersphere.performance.parse.xml.reader.jmx.JmeterDocumentParser;
public class DocumentParserFactory {
public static DocumentParser createDocumentParser(String type) {

View File

@ -1,11 +1,11 @@
package io.metersphere.parse.xml.reader.jmx;
package io.metersphere.performance.parse.xml.reader.jmx;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.config.KafkaProperties;
import io.metersphere.engine.EngineContext;
import io.metersphere.parse.xml.reader.DocumentParser;
import io.metersphere.performance.engine.EngineContext;
import io.metersphere.performance.parse.xml.reader.DocumentParser;
import org.apache.commons.lang3.StringUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

View File

@ -1,4 +1,4 @@
package io.metersphere.service;
package io.metersphere.performance.service;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.*;
@ -10,9 +10,11 @@ import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.controller.request.testplan.*;
import io.metersphere.dto.LoadTestDTO;
import io.metersphere.engine.Engine;
import io.metersphere.engine.EngineFactory;
import io.metersphere.i18n.Translator;
import io.metersphere.performance.engine.Engine;
import io.metersphere.performance.engine.EngineFactory;
import io.metersphere.service.FileService;
import io.metersphere.service.TestResourceService;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

View File

@ -1,4 +1,4 @@
package io.metersphere.service;
package io.metersphere.performance.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@ -12,21 +12,19 @@ import io.metersphere.commons.constants.PerformanceTestStatus;
import io.metersphere.commons.constants.ReportKeys;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.LogDetailDTO;
import io.metersphere.dto.ReportDTO;
import io.metersphere.engine.Engine;
import io.metersphere.engine.EngineFactory;
import io.metersphere.report.base.*;
import io.metersphere.performance.base.*;
import io.metersphere.performance.controller.request.ReportRequest;
import io.metersphere.performance.engine.Engine;
import io.metersphere.performance.engine.EngineFactory;
import io.metersphere.service.TestResourceService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service

View File

@ -12,6 +12,7 @@ import io.metersphere.controller.request.ProjectRequest;
import io.metersphere.controller.request.testplan.DeleteTestPlanRequest;
import io.metersphere.dto.ProjectDTO;
import io.metersphere.i18n.Translator;
import io.metersphere.performance.service.PerformanceTestService;
import io.metersphere.user.SessionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

View File

@ -14,8 +14,8 @@ import io.metersphere.commons.utils.LogUtil;
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
import io.metersphere.dto.NodeDTO;
import io.metersphere.dto.TestResourcePoolDTO;
import io.metersphere.engine.kubernetes.provider.KubernetesProvider;
import io.metersphere.i18n.Translator;
import io.metersphere.performance.engine.kubernetes.provider.KubernetesProvider;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;

View File

@ -131,6 +131,10 @@ public class UserService {
}
public void deleteUser(String userId) {
SessionUser user = SessionUtils.getUser();
if (StringUtils.equals(user.getId(), userId)) {
MSException.throwException(Translator.get("cannot_delete_current_user"));
}
userMapper.deleteByPrimaryKey(userId);
}

View File

@ -32,4 +32,5 @@ workspace_not_exists=Workspace is not exists
#api
api_load_script_error=Load script error
user_id_already_exists=User ID already exists
password_modification_failed=Password modification failed
password_modification_failed=Password modification failed
cannot_delete_current_user=Cannot delete the user currently logged in

View File

@ -32,4 +32,5 @@ workspace_not_exists=工作空间不存在
#api
api_load_script_error=读取脚本失败
user_id_already_exists=用户id已存在
password_modification_failed=密码修改失败
password_modification_failed=密码修改失败
cannot_delete_current_user=无法删除当前登录用户