parent
116994bbe6
commit
74e1b0ce90
|
@ -0,0 +1,20 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
||||
public class RunningParamKeys {
|
||||
public static final String API_ENVIRONMENT_ID = "${__metersphere_evn_id}";
|
||||
|
||||
public static String escapeExprSpecialWord(String keyword) {
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
String[] fbsArr = {"\\", "$", "(", ")", "*", "+", ".", "[", "]", "?", "^", "{", "}", "|"};
|
||||
for (String key : fbsArr) {
|
||||
if (keyword.contains(key)) {
|
||||
keyword = keyword.replace(key, "\\" + key);
|
||||
}
|
||||
}
|
||||
}
|
||||
return keyword;
|
||||
}
|
||||
}
|
|
@ -108,7 +108,8 @@ public abstract class MsTestElement {
|
|||
private String projectId;
|
||||
@JSONField(ordinal = 13)
|
||||
private boolean isMockEnvironment;
|
||||
|
||||
@JSONField(ordinal = 14)
|
||||
private String useEnviroment;
|
||||
private MsTestElement parent;
|
||||
|
||||
private static final String BODY_FILE_DIR = FileUtils.BODY_FILE_DIR;
|
||||
|
|
|
@ -2,6 +2,7 @@ package io.metersphere.api.dto.definition.request.processors.post;
|
|||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.alibaba.fastjson.annotation.JSONType;
|
||||
import io.metersphere.api.dto.RunningParamKeys;
|
||||
import io.metersphere.api.dto.definition.request.MsTestElement;
|
||||
import io.metersphere.api.dto.definition.request.ParameterConfig;
|
||||
import lombok.Data;
|
||||
|
@ -29,6 +30,9 @@ public class MsJSR223PostProcessor extends MsTestElement {
|
|||
|
||||
@Override
|
||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||
//替换Metersphere环境变量
|
||||
script = StringUtils.replace(script,RunningParamKeys.API_ENVIRONMENT_ID,"\""+this.getUseEnviroment()+"\"");
|
||||
|
||||
// 非导出操作,且不是启用状态则跳过执行
|
||||
if (!config.isOperating() && !this.isEnable()) {
|
||||
return;
|
||||
|
|
|
@ -2,6 +2,7 @@ package io.metersphere.api.dto.definition.request.processors.pre;
|
|||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.alibaba.fastjson.annotation.JSONType;
|
||||
import io.metersphere.api.dto.RunningParamKeys;
|
||||
import io.metersphere.api.dto.definition.request.MsTestElement;
|
||||
import io.metersphere.api.dto.definition.request.ParameterConfig;
|
||||
import lombok.Data;
|
||||
|
@ -29,6 +30,9 @@ public class MsJSR223PreProcessor extends MsTestElement {
|
|||
|
||||
@Override
|
||||
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
|
||||
//替换Metersphere环境变量
|
||||
script = StringUtils.replace(script,RunningParamKeys.API_ENVIRONMENT_ID,"\""+this.getUseEnviroment()+"\"");
|
||||
|
||||
// 非导出操作,且不是启用状态则跳过执行
|
||||
if (!config.isOperating() && !this.isEnable()) {
|
||||
return;
|
||||
|
|
|
@ -405,6 +405,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
}
|
||||
if (CollectionUtils.isNotEmpty(hashTree)) {
|
||||
for (MsTestElement el : hashTree) {
|
||||
el.setUseEnviroment(useEnvironment);
|
||||
el.toHashTree(httpSamplerTree, el.getHashTree(), config);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package io.metersphere.api.jmeter;
|
||||
|
||||
import io.metersphere.api.service.ApiEnvironmentRunningParamService;
|
||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||
|
||||
/**
|
||||
* @author song.tianyang
|
||||
* 2021/5/13 5:24 下午
|
||||
*/
|
||||
public class RunningParam {
|
||||
private static ApiEnvironmentRunningParamService apiEnvironmentRunningParamService;
|
||||
|
||||
public static void setParam(String enviromentId, String key, String value){
|
||||
checkService();
|
||||
apiEnvironmentRunningParamService.addParam(enviromentId,key,value);
|
||||
}
|
||||
|
||||
public static void deleteParam(String enviromentId, String key){
|
||||
checkService();
|
||||
apiEnvironmentRunningParamService.deleteParam(enviromentId,key);
|
||||
}
|
||||
|
||||
public static String getParam(String enviromentId, String key){
|
||||
checkService();
|
||||
return apiEnvironmentRunningParamService.getParam(enviromentId,key);
|
||||
}
|
||||
|
||||
public static String showParams(String enviromentId){
|
||||
checkService();
|
||||
return apiEnvironmentRunningParamService.showParams(enviromentId);
|
||||
}
|
||||
|
||||
public static void checkService(){
|
||||
if(apiEnvironmentRunningParamService == null){
|
||||
apiEnvironmentRunningParamService = CommonBeanFactory.getBean(ApiEnvironmentRunningParamService.class);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
package io.metersphere.api.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import io.metersphere.base.domain.ApiEnvironmentRunningParam;
|
||||
import io.metersphere.base.domain.ApiEnvironmentRunningParamExample;
|
||||
import io.metersphere.base.mapper.ApiEnvironmentRunningParamMapper;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author song.tianyang
|
||||
* 2021/5/13 6:24 下午
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ApiEnvironmentRunningParamService {
|
||||
@Resource
|
||||
ApiEnvironmentRunningParamMapper apiEnvironmentRunningParamMapper;
|
||||
|
||||
public synchronized void addParam(String enviromentId, String key, String value) {
|
||||
if(StringUtils.isEmpty(key)){
|
||||
return;
|
||||
}
|
||||
ApiEnvironmentRunningParamExample example = new ApiEnvironmentRunningParamExample();
|
||||
example.createCriteria().andApiEnviromentIdEqualTo(enviromentId).andKeyEqualTo(key);
|
||||
List<ApiEnvironmentRunningParam> list = apiEnvironmentRunningParamMapper.selectByExampleWithBLOBs(example);
|
||||
long timeStamp = System.currentTimeMillis();
|
||||
String userId = SessionUtils.getUserId();
|
||||
if(list.isEmpty()){
|
||||
ApiEnvironmentRunningParam model = new ApiEnvironmentRunningParam();
|
||||
model.setApiEnviromentId(enviromentId);
|
||||
model.setKey(key);
|
||||
model.setValue(value);
|
||||
model.setCreateUserId(userId);
|
||||
model.setId(UUID.randomUUID().toString());
|
||||
model.setCreateTime(timeStamp);
|
||||
model.setUpdateTime(timeStamp);
|
||||
model.setUpdateUserId(userId);
|
||||
apiEnvironmentRunningParamMapper.insert(model);
|
||||
}else {
|
||||
ApiEnvironmentRunningParam model = list.get(0);
|
||||
model.setValue(value);
|
||||
model.setUpdateTime(timeStamp);
|
||||
model.setUpdateUserId(userId);
|
||||
apiEnvironmentRunningParamMapper.updateByPrimaryKeySelective(model);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteParam(String enviromentId, String key) {
|
||||
ApiEnvironmentRunningParamExample example = new ApiEnvironmentRunningParamExample();
|
||||
example.createCriteria().andApiEnviromentIdEqualTo(enviromentId).andKeyEqualTo(key);
|
||||
apiEnvironmentRunningParamMapper.deleteByExample(example);
|
||||
}
|
||||
|
||||
public String getParam(String enviromentId, String key) {
|
||||
ApiEnvironmentRunningParamExample example = new ApiEnvironmentRunningParamExample();
|
||||
example.createCriteria().andApiEnviromentIdEqualTo(enviromentId).andKeyEqualTo(key);
|
||||
List<ApiEnvironmentRunningParam> list = apiEnvironmentRunningParamMapper.selectByExampleWithBLOBs(example);
|
||||
if(list.isEmpty()){
|
||||
return "";
|
||||
}else {
|
||||
return list.get(0).getValue();
|
||||
}
|
||||
}
|
||||
|
||||
public String showParams(String enviromentId) {
|
||||
Map<String,String> paramMap = new LinkedHashMap<>();
|
||||
|
||||
ApiEnvironmentRunningParamExample example = new ApiEnvironmentRunningParamExample();
|
||||
example.createCriteria().andApiEnviromentIdEqualTo(enviromentId);
|
||||
List<ApiEnvironmentRunningParam> list = apiEnvironmentRunningParamMapper.selectByExampleWithBLOBs(example);
|
||||
|
||||
for (ApiEnvironmentRunningParam model:
|
||||
list) {
|
||||
paramMap.put(model.getKey(),model.getValue());
|
||||
}
|
||||
|
||||
return JSONArray.toJSONString(paramMap);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiEnvironmentRunningParam implements Serializable {
|
||||
private String id;
|
||||
|
||||
private String apiEnviromentId;
|
||||
|
||||
private String key;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private Long updateTime;
|
||||
|
||||
private String createUserId;
|
||||
|
||||
private String updateUserId;
|
||||
|
||||
private String value;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -0,0 +1,670 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ApiEnvironmentRunningParamExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public ApiEnvironmentRunningParamExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
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<Criteria> 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<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> 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<String> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<String> 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 andApiEnviromentIdIsNull() {
|
||||
addCriterion("api_enviroment_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdIsNotNull() {
|
||||
addCriterion("api_enviroment_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdEqualTo(String value) {
|
||||
addCriterion("api_enviroment_id =", value, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdNotEqualTo(String value) {
|
||||
addCriterion("api_enviroment_id <>", value, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdGreaterThan(String value) {
|
||||
addCriterion("api_enviroment_id >", value, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("api_enviroment_id >=", value, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdLessThan(String value) {
|
||||
addCriterion("api_enviroment_id <", value, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("api_enviroment_id <=", value, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdLike(String value) {
|
||||
addCriterion("api_enviroment_id like", value, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdNotLike(String value) {
|
||||
addCriterion("api_enviroment_id not like", value, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdIn(List<String> values) {
|
||||
addCriterion("api_enviroment_id in", values, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdNotIn(List<String> values) {
|
||||
addCriterion("api_enviroment_id not in", values, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdBetween(String value1, String value2) {
|
||||
addCriterion("api_enviroment_id between", value1, value2, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andApiEnviromentIdNotBetween(String value1, String value2) {
|
||||
addCriterion("api_enviroment_id not between", value1, value2, "apiEnviromentId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyIsNull() {
|
||||
addCriterion("`key` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyIsNotNull() {
|
||||
addCriterion("`key` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyEqualTo(String value) {
|
||||
addCriterion("`key` =", value, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyNotEqualTo(String value) {
|
||||
addCriterion("`key` <>", value, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyGreaterThan(String value) {
|
||||
addCriterion("`key` >", value, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`key` >=", value, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyLessThan(String value) {
|
||||
addCriterion("`key` <", value, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyLessThanOrEqualTo(String value) {
|
||||
addCriterion("`key` <=", value, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyLike(String value) {
|
||||
addCriterion("`key` like", value, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyNotLike(String value) {
|
||||
addCriterion("`key` not like", value, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyIn(List<String> values) {
|
||||
addCriterion("`key` in", values, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyNotIn(List<String> values) {
|
||||
addCriterion("`key` not in", values, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyBetween(String value1, String value2) {
|
||||
addCriterion("`key` between", value1, value2, "key");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andKeyNotBetween(String value1, String value2) {
|
||||
addCriterion("`key` not between", value1, value2, "key");
|
||||
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<Long> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Long> 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<Long> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Long> 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 Criteria andCreateUserIdIsNull() {
|
||||
addCriterion("create_user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdIsNotNull() {
|
||||
addCriterion("create_user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdEqualTo(String value) {
|
||||
addCriterion("create_user_id =", value, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdNotEqualTo(String value) {
|
||||
addCriterion("create_user_id <>", value, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdGreaterThan(String value) {
|
||||
addCriterion("create_user_id >", value, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("create_user_id >=", value, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdLessThan(String value) {
|
||||
addCriterion("create_user_id <", value, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("create_user_id <=", value, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdLike(String value) {
|
||||
addCriterion("create_user_id like", value, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdNotLike(String value) {
|
||||
addCriterion("create_user_id not like", value, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdIn(List<String> values) {
|
||||
addCriterion("create_user_id in", values, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdNotIn(List<String> values) {
|
||||
addCriterion("create_user_id not in", values, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdBetween(String value1, String value2) {
|
||||
addCriterion("create_user_id between", value1, value2, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateUserIdNotBetween(String value1, String value2) {
|
||||
addCriterion("create_user_id not between", value1, value2, "createUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdIsNull() {
|
||||
addCriterion("update_user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdIsNotNull() {
|
||||
addCriterion("update_user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdEqualTo(String value) {
|
||||
addCriterion("update_user_id =", value, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdNotEqualTo(String value) {
|
||||
addCriterion("update_user_id <>", value, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdGreaterThan(String value) {
|
||||
addCriterion("update_user_id >", value, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("update_user_id >=", value, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdLessThan(String value) {
|
||||
addCriterion("update_user_id <", value, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("update_user_id <=", value, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdLike(String value) {
|
||||
addCriterion("update_user_id like", value, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdNotLike(String value) {
|
||||
addCriterion("update_user_id not like", value, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdIn(List<String> values) {
|
||||
addCriterion("update_user_id in", values, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdNotIn(List<String> values) {
|
||||
addCriterion("update_user_id not in", values, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdBetween(String value1, String value2) {
|
||||
addCriterion("update_user_id between", value1, value2, "updateUserId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateUserIdNotBetween(String value1, String value2) {
|
||||
addCriterion("update_user_id not between", value1, value2, "updateUserId");
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package io.metersphere.base.mapper;
|
||||
|
||||
import io.metersphere.base.domain.ApiEnvironmentRunningParam;
|
||||
import io.metersphere.base.domain.ApiEnvironmentRunningParamExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface ApiEnvironmentRunningParamMapper {
|
||||
long countByExample(ApiEnvironmentRunningParamExample example);
|
||||
|
||||
int deleteByExample(ApiEnvironmentRunningParamExample example);
|
||||
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
int insert(ApiEnvironmentRunningParam record);
|
||||
|
||||
int insertSelective(ApiEnvironmentRunningParam record);
|
||||
|
||||
List<ApiEnvironmentRunningParam> selectByExampleWithBLOBs(ApiEnvironmentRunningParamExample example);
|
||||
|
||||
List<ApiEnvironmentRunningParam> selectByExample(ApiEnvironmentRunningParamExample example);
|
||||
|
||||
ApiEnvironmentRunningParam selectByPrimaryKey(String id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") ApiEnvironmentRunningParam record, @Param("example") ApiEnvironmentRunningParamExample example);
|
||||
|
||||
int updateByExampleWithBLOBs(@Param("record") ApiEnvironmentRunningParam record, @Param("example") ApiEnvironmentRunningParamExample example);
|
||||
|
||||
int updateByExample(@Param("record") ApiEnvironmentRunningParam record, @Param("example") ApiEnvironmentRunningParamExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(ApiEnvironmentRunningParam record);
|
||||
|
||||
int updateByPrimaryKeyWithBLOBs(ApiEnvironmentRunningParam record);
|
||||
|
||||
int updateByPrimaryKey(ApiEnvironmentRunningParam record);
|
||||
}
|
|
@ -0,0 +1,304 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.metersphere.base.mapper.ApiEnvironmentRunningParamMapper">
|
||||
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiEnvironmentRunningParam">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="api_enviroment_id" jdbcType="VARCHAR" property="apiEnviromentId" />
|
||||
<result column="key" jdbcType="VARCHAR" property="key" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiEnvironmentRunningParam">
|
||||
<result column="value" jdbcType="LONGVARCHAR" property="value" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, api_enviroment_id, `key`, create_time, update_time, create_user_id, update_user_id
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
`value`
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiEnvironmentRunningParamExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from api_environment_running_param
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.ApiEnvironmentRunningParamExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from api_environment_running_param
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from api_environment_running_param
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from api_environment_running_param
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiEnvironmentRunningParamExample">
|
||||
delete from api_environment_running_param
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.ApiEnvironmentRunningParam">
|
||||
insert into api_environment_running_param (id, api_enviroment_id, `key`,
|
||||
create_time, update_time, create_user_id,
|
||||
update_user_id, `value`)
|
||||
values (#{id,jdbcType=VARCHAR}, #{apiEnviromentId,jdbcType=VARCHAR}, #{key,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{createUserId,jdbcType=VARCHAR},
|
||||
#{updateUserId,jdbcType=VARCHAR}, #{value,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiEnvironmentRunningParam">
|
||||
insert into api_environment_running_param
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="apiEnviromentId != null">
|
||||
api_enviroment_id,
|
||||
</if>
|
||||
<if test="key != null">
|
||||
`key`,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="createUserId != null">
|
||||
create_user_id,
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
update_user_id,
|
||||
</if>
|
||||
<if test="value != null">
|
||||
`value`,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="apiEnviromentId != null">
|
||||
#{apiEnviromentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="key != null">
|
||||
#{key,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createUserId != null">
|
||||
#{createUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
#{updateUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
#{value,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiEnvironmentRunningParamExample" resultType="java.lang.Long">
|
||||
select count(*) from api_environment_running_param
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update api_environment_running_param
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.apiEnviromentId != null">
|
||||
api_enviroment_id = #{record.apiEnviromentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.key != null">
|
||||
`key` = #{record.key,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.createUserId != null">
|
||||
create_user_id = #{record.createUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.updateUserId != null">
|
||||
update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.value != null">
|
||||
`value` = #{record.value,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||
update api_environment_running_param
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
api_enviroment_id = #{record.apiEnviromentId,jdbcType=VARCHAR},
|
||||
`key` = #{record.key,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
create_user_id = #{record.createUserId,jdbcType=VARCHAR},
|
||||
update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
|
||||
`value` = #{record.value,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update api_environment_running_param
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
api_enviroment_id = #{record.apiEnviromentId,jdbcType=VARCHAR},
|
||||
`key` = #{record.key,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
create_user_id = #{record.createUserId,jdbcType=VARCHAR},
|
||||
update_user_id = #{record.updateUserId,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiEnvironmentRunningParam">
|
||||
update api_environment_running_param
|
||||
<set>
|
||||
<if test="apiEnviromentId != null">
|
||||
api_enviroment_id = #{apiEnviromentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="key != null">
|
||||
`key` = #{key,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createUserId != null">
|
||||
create_user_id = #{createUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
update_user_id = #{updateUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
`value` = #{value,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.ApiEnvironmentRunningParam">
|
||||
update api_environment_running_param
|
||||
set api_enviroment_id = #{apiEnviromentId,jdbcType=VARCHAR},
|
||||
`key` = #{key,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
create_user_id = #{createUserId,jdbcType=VARCHAR},
|
||||
update_user_id = #{updateUserId,jdbcType=VARCHAR},
|
||||
`value` = #{value,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiEnvironmentRunningParam">
|
||||
update api_environment_running_param
|
||||
set api_enviroment_id = #{apiEnviromentId,jdbcType=VARCHAR},
|
||||
`key` = #{key,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
create_user_id = #{createUserId,jdbcType=VARCHAR},
|
||||
update_user_id = #{updateUserId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -13,6 +13,18 @@ SET load_test_report.project_id = load_test.project_id;
|
|||
|
||||
UPDATE load_test_report JOIN load_test ON load_test.id = load_test_report.test_id
|
||||
SET load_test_report.test_name = load_test.name;
|
||||
--
|
||||
|
||||
-- api_environment_running_param
|
||||
CREATE TABLE IF NOT EXISTS api_environment_running_param (
|
||||
`id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`api_enviroment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
|
||||
`create_time` bigint(13) NULL DEFAULT NULL,
|
||||
`update_time` bigint(13) NULL DEFAULT NULL,
|
||||
`create_user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`update_user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `api_enviroment_id`(`api_enviroment_id`) USING BTREE,
|
||||
INDEX `key_api_enviroment_id`(`api_enviroment_id`,`key`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
<table tableName="test_case_review_scenario"/>
|
||||
<table tableName="test_plan"/>
|
||||
<table tableName="test_case_test"/>-->
|
||||
<table tableName="issues"></table>
|
||||
<table tableName="api_environment_running_param"></table>
|
||||
<!-- <table tableName="custom_field"></table>-->
|
||||
<!-- <table tableName="test_case"></table>-->
|
||||
<!-- <table tableName="test_case"></table>-->
|
||||
|
|
|
@ -45,6 +45,26 @@
|
|||
title: this.$t('api_test.request.processor.code_template_get_global_variable'),
|
||||
value: 'props.get("variable_name")',
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.request.processor.code_template_set_global_variable'),
|
||||
value: 'props.put("variable_name", "variable_value")',
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.request.processor.param_environment_get_global_variable'),
|
||||
value: 'io.metersphere.api.jmeter.RunningParam.getParam(${__metersphere_evn_id},"key")',
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.request.processor.param_environment_set_global_variable'),
|
||||
value: 'io.metersphere.api.jmeter.RunningParam.setParam(${__metersphere_evn_id},"key","value")',
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.request.processor.param_environment_delete_global_variable'),
|
||||
value: 'io.metersphere.api.jmeter.RunningParam.deleteParam(${__metersphere_evn_id},"key")',
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.request.processor.param_environment_show_global_variable'),
|
||||
value: 'io.metersphere.api.jmeter.RunningParam.showParams(${__metersphere_evn_id})',
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.request.processor.code_add_report_length'),
|
||||
value: 'String report = ctx.getCurrentSampler().getRequestData();\n' +
|
||||
|
@ -55,10 +75,6 @@
|
|||
' ctx.getCurrentSampler().setRequestData(report);\n' +
|
||||
'}',
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.request.processor.code_template_set_global_variable'),
|
||||
value: 'props.put("variable_name", "variable_value")',
|
||||
},
|
||||
{
|
||||
title: this.$t('api_test.request.processor.code_template_get_response_header'),
|
||||
value: 'prev.getResponseHeaders()',
|
||||
|
|
|
@ -1003,7 +1003,11 @@ export default {
|
|||
code_template_get_response_code: "Get Response Code",
|
||||
code_template_get_response_result: "Get Response Result",
|
||||
code_add_report_length: "Add report length to head",
|
||||
code_hide_report_length: "Hide report length"
|
||||
code_hide_report_length: "Hide report length",
|
||||
param_environment_get_global_variable: "Get run environment param",
|
||||
param_environment_set_global_variable: "Set run environment param",
|
||||
param_environment_delete_global_variable: "Delete run environment param",
|
||||
param_environment_show_global_variable: "Show all environment params",
|
||||
},
|
||||
dubbo: {
|
||||
protocol: "protocol",
|
||||
|
|
|
@ -1005,7 +1005,11 @@ export default {
|
|||
code_template_get_response_code: "获取响应码",
|
||||
code_template_get_response_result: "获取响应结果",
|
||||
code_add_report_length: "报文头添加长度",
|
||||
code_hide_report_length: "隐藏报文长度"
|
||||
code_hide_report_length: "隐藏报文长度",
|
||||
param_environment_get_global_variable: "获取环境参数",
|
||||
param_environment_set_global_variable: "设置环境参数",
|
||||
param_environment_delete_global_variable: "删除环境参数",
|
||||
param_environment_show_global_variable: "获取所有环境参数",
|
||||
},
|
||||
dubbo: {
|
||||
protocol: "协议",
|
||||
|
|
|
@ -1005,7 +1005,11 @@ export default {
|
|||
code_template_get_response_code: "獲取響應碼",
|
||||
code_template_get_response_result: "獲取響應結果",
|
||||
code_add_report_length: "報文頭添加長度",
|
||||
code_hide_report_length: "隱藏報文長度"
|
||||
code_hide_report_length: "隱藏報文長度",
|
||||
param_environment_get_global_variable: "獲取環境參數",
|
||||
param_environment_set_global_variable: "設置環境參數",
|
||||
param_environment_delete_global_variable: "刪除環境參數",
|
||||
param_environment_show_global_variable: "獲取所有環境參數",
|
||||
},
|
||||
dubbo: {
|
||||
protocol: "協議",
|
||||
|
|
Loading…
Reference in New Issue