refactor: API插件同时支持接口定义和场景步骤

This commit is contained in:
fit2-zhao 2023-09-14 16:21:31 +08:00 committed by fit2-zhao
parent 46ed32d7d0
commit b50d6652d1
3 changed files with 16 additions and 36 deletions

View File

@ -0,0 +1,5 @@
package io.metersphere.plugin.api.constants;
public enum JMeterStepType {
SAMPLER, LOGIC_CONTROLLER, PRE_PROCESSOR, POST_PROCESSOR, ASSERTION, TIMER
}

View File

@ -1,11 +1,14 @@
package io.metersphere.plugin.api.dto; package io.metersphere.plugin.api.dto;
import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
/** /**
* 公共传递参数基类 * 公共传递参数基类
*/ */
@Data
public class BaseConfigDTO implements Serializable { public class BaseConfigDTO implements Serializable {
@Serial @Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -1,5 +1,6 @@
package io.metersphere.plugin.api.dto; package io.metersphere.plugin.api.dto;
import io.metersphere.plugin.api.constants.JMeterStepType;
import lombok.Data; import lombok.Data;
@Data @Data
@ -14,16 +15,15 @@ public class ScriptDTO {
private String name; private String name;
/** /**
* 这个参数非常重要对应继承 MsTestElement的类全名 * 对应JMeter的步骤分类
* io.xx.MsThriftSample
*/
private String clazzName;
/**
* 插件实现的jmeter基类
* 请求的基类 * 请求的基类
*/ */
private String jmeterClazz; private JMeterStepType stepType;
/**
* 协议分类 HTTPTCPJDBCJMSWEBSOCKET等
*/
private String protocol;
/** /**
* 表单基本参数 * 表单基本参数
@ -35,32 +35,4 @@ public class ScriptDTO {
* 表单脚本内容 * 表单脚本内容
*/ */
private String formScript; private String formScript;
public ScriptDTO() {
}
public ScriptDTO(String id, String name, String clazzName, String script) {
this.id = id;
this.name = name;
this.clazzName = clazzName;
this.formScript = script;
}
public ScriptDTO(String id, String name, String clazzName, String script, String option) {
this.id = id;
this.name = name;
this.clazzName = clazzName;
this.formScript = script;
this.formOption = option;
}
public ScriptDTO(String id, String name, String clazzName, String jmeterClazz, String script, String option) {
this.id = id;
this.name = name;
this.clazzName = clazzName;
this.jmeterClazz = jmeterClazz;
this.formScript = script;
this.formOption = option;
}
} }