Commit 407fcb45 authored by fit2cloud-yangxiaoyan's avatar fit2cloud-yangxiaoyan Committed by LuoTing
Browse files

feat:新增API模版功能

parent 8ac710de
Showing with 1906 additions and 294 deletions
+1906 -294
package io.metersphere.api.controller;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.metersphere.api.dto.APIReportResult;
......@@ -26,6 +27,7 @@ import io.metersphere.commons.constants.OperLogModule;
import io.metersphere.commons.constants.PermissionConstants;
import io.metersphere.commons.json.JSONSchemaGenerator;
import io.metersphere.commons.json.JSONToDocumentUtils;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.ResetOrderRequest;
......
......@@ -35,5 +35,7 @@ public class ApiTestImportRequest {
private List<KeyValue> headers;
private List<KeyValue> arguments;
private MsAuthManager authManager;
//自定义字段
private String customFields;
}
......@@ -26,4 +26,6 @@ public class ApiDefinitionRequest extends BaseQueryRequest {
// 测试计划是否允许重复
private boolean repeatCase;
//自定义字段
private String customFields;
}
......@@ -64,4 +64,8 @@ public class SaveApiDefinitionRequest {
// 创建新版本时用到的
private boolean newVersionRemark;
private boolean newVersionDeps;
//自定义字段
private String customFields;
}
package io.metersphere.api.dto.swaggerurl;
import io.metersphere.base.domain.SwaggerUrlProject;
import io.metersphere.base.domain.SwaggerUrlProjectWithBLOBs;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SwaggerTaskResult extends SwaggerUrlProject {
public class SwaggerTaskResult extends SwaggerUrlProjectWithBLOBs {
//序号
private int index;
//定时任务号
......
......@@ -580,6 +580,7 @@ public class ApiDefinitionService {
test.setEnvironmentId(request.getEnvironmentId());
test.setUserId(request.getUserId());
test.setRemark(request.getRemark());
test.setCustomFields(request.getCustomFields());
if (StringUtils.isNotEmpty(request.getTags()) && !StringUtils.equals(request.getTags(), "[]")) {
test.setTags(request.getTags());
} else {
......@@ -687,6 +688,7 @@ public class ApiDefinitionService {
test.setRefId(request.getId());
test.setVersionId(request.getVersionId());
test.setLatest(true); // 新建一定是最新的
test.setCustomFields(request.getCustomFields());
if (StringUtils.isEmpty(request.getModuleId()) || "default-module".equals(request.getModuleId())) {
ApiModuleExample example = new ApiModuleExample();
example.createCriteria().andProjectIdEqualTo(test.getProjectId()).andProtocolEqualTo(test.getProtocol()).andNameEqualTo("未规划接口");
......@@ -734,6 +736,7 @@ public class ApiDefinitionService {
BeanUtils.copyBean(saveReq, apiDefinition);
apiDefinition.setCreateTime(System.currentTimeMillis());
apiDefinition.setUpdateTime(System.currentTimeMillis());
apiDefinition.setCustomFields(apiDefinition.getCustomFields());
if (StringUtils.isEmpty(apiDefinition.getStatus())) {
apiDefinition.setStatus(APITestStatus.Underway.name());
}
......@@ -1198,6 +1201,7 @@ public class ApiDefinitionService {
item.setName(item.getName().substring(0, 255));
}
item.setNum(num++);
item.setCustomFields(request.getCustomFields());
//如果EsbData需要存储,则需要进行接口是否更新的判断
if (apiImport.getEsbApiParamsMap() != null) {
String apiId = item.getId();
......@@ -1467,9 +1471,10 @@ public class ApiDefinitionService {
/*swagger定时导入*/
public void createSchedule(ScheduleRequest request) {
/*保存swaggerUrl*/
SwaggerUrlProject swaggerUrlProject = new SwaggerUrlProject();
SwaggerUrlProjectWithBLOBs swaggerUrlProject = new SwaggerUrlProjectWithBLOBs();
BeanUtils.copyBean(swaggerUrlProject, request);
swaggerUrlProject.setId(UUID.randomUUID().toString());
swaggerUrlProject.setCustomFields(request.getCustomFields());
// 设置鉴权信息
if (request.getHeaders() != null || request.getArguments() != null || request.getAuthManager() != null) {
String config = setAuthParams(request);
......@@ -1495,7 +1500,7 @@ public class ApiDefinitionService {
}
public void updateSchedule(ScheduleRequest request) {
SwaggerUrlProject swaggerUrlProject = new SwaggerUrlProject();
SwaggerUrlProjectWithBLOBs swaggerUrlProject = new SwaggerUrlProjectWithBLOBs();
BeanUtils.copyBean(swaggerUrlProject, request);
// 设置鉴权信息
if (request.getHeaders() != null || request.getArguments() != null || request.getAuthManager() != null) {
......@@ -1555,7 +1560,7 @@ public class ApiDefinitionService {
}
//查询swaggerUrl详情
public SwaggerUrlProject getSwaggerInfo(String resourceId) {
public SwaggerUrlProjectWithBLOBs getSwaggerInfo(String resourceId) {
return swaggerUrlProjectMapper.selectByPrimaryKey(resourceId);
}
......
package io.metersphere.base.domain;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
@Data
public class ApiDefinition implements Serializable {
......@@ -14,6 +13,10 @@ public class ApiDefinition implements Serializable {
private String method;
private String protocol;
private String path;
private String modulePath;
private String environmentId;
......@@ -30,10 +33,6 @@ public class ApiDefinition implements Serializable {
private Long updateTime;
private String protocol;
private String path;
private Integer num;
private String tags;
......@@ -54,10 +53,10 @@ public class ApiDefinition implements Serializable {
private Long order;
private String refId;
private String versionId;
private String refId;
private Boolean latest;
private static final long serialVersionUID = 1L;
......
......@@ -384,6 +384,146 @@ public class ApiDefinitionExample {
return (Criteria) this;
}
public Criteria andProtocolIsNull() {
addCriterion("protocol is null");
return (Criteria) this;
}
public Criteria andProtocolIsNotNull() {
addCriterion("protocol is not null");
return (Criteria) this;
}
public Criteria andProtocolEqualTo(String value) {
addCriterion("protocol =", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotEqualTo(String value) {
addCriterion("protocol <>", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThan(String value) {
addCriterion("protocol >", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThanOrEqualTo(String value) {
addCriterion("protocol >=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThan(String value) {
addCriterion("protocol <", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThanOrEqualTo(String value) {
addCriterion("protocol <=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLike(String value) {
addCriterion("protocol like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotLike(String value) {
addCriterion("protocol not like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolIn(List<String> values) {
addCriterion("protocol in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotIn(List<String> values) {
addCriterion("protocol not in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolBetween(String value1, String value2) {
addCriterion("protocol between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotBetween(String value1, String value2) {
addCriterion("protocol not between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andPathIsNull() {
addCriterion("`path` is null");
return (Criteria) this;
}
public Criteria andPathIsNotNull() {
addCriterion("`path` is not null");
return (Criteria) this;
}
public Criteria andPathEqualTo(String value) {
addCriterion("`path` =", value, "path");
return (Criteria) this;
}
public Criteria andPathNotEqualTo(String value) {
addCriterion("`path` <>", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThan(String value) {
addCriterion("`path` >", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThanOrEqualTo(String value) {
addCriterion("`path` >=", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThan(String value) {
addCriterion("`path` <", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThanOrEqualTo(String value) {
addCriterion("`path` <=", value, "path");
return (Criteria) this;
}
public Criteria andPathLike(String value) {
addCriterion("`path` like", value, "path");
return (Criteria) this;
}
public Criteria andPathNotLike(String value) {
addCriterion("`path` not like", value, "path");
return (Criteria) this;
}
public Criteria andPathIn(List<String> values) {
addCriterion("`path` in", values, "path");
return (Criteria) this;
}
public Criteria andPathNotIn(List<String> values) {
addCriterion("`path` not in", values, "path");
return (Criteria) this;
}
public Criteria andPathBetween(String value1, String value2) {
addCriterion("`path` between", value1, value2, "path");
return (Criteria) this;
}
public Criteria andPathNotBetween(String value1, String value2) {
addCriterion("`path` not between", value1, value2, "path");
return (Criteria) this;
}
public Criteria andModulePathIsNull() {
addCriterion("module_path is null");
return (Criteria) this;
......@@ -924,146 +1064,6 @@ public class ApiDefinitionExample {
return (Criteria) this;
}
public Criteria andProtocolIsNull() {
addCriterion("protocol is null");
return (Criteria) this;
}
public Criteria andProtocolIsNotNull() {
addCriterion("protocol is not null");
return (Criteria) this;
}
public Criteria andProtocolEqualTo(String value) {
addCriterion("protocol =", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotEqualTo(String value) {
addCriterion("protocol <>", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThan(String value) {
addCriterion("protocol >", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolGreaterThanOrEqualTo(String value) {
addCriterion("protocol >=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThan(String value) {
addCriterion("protocol <", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLessThanOrEqualTo(String value) {
addCriterion("protocol <=", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolLike(String value) {
addCriterion("protocol like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotLike(String value) {
addCriterion("protocol not like", value, "protocol");
return (Criteria) this;
}
public Criteria andProtocolIn(List<String> values) {
addCriterion("protocol in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotIn(List<String> values) {
addCriterion("protocol not in", values, "protocol");
return (Criteria) this;
}
public Criteria andProtocolBetween(String value1, String value2) {
addCriterion("protocol between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andProtocolNotBetween(String value1, String value2) {
addCriterion("protocol not between", value1, value2, "protocol");
return (Criteria) this;
}
public Criteria andPathIsNull() {
addCriterion("`path` is null");
return (Criteria) this;
}
public Criteria andPathIsNotNull() {
addCriterion("`path` is not null");
return (Criteria) this;
}
public Criteria andPathEqualTo(String value) {
addCriterion("`path` =", value, "path");
return (Criteria) this;
}
public Criteria andPathNotEqualTo(String value) {
addCriterion("`path` <>", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThan(String value) {
addCriterion("`path` >", value, "path");
return (Criteria) this;
}
public Criteria andPathGreaterThanOrEqualTo(String value) {
addCriterion("`path` >=", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThan(String value) {
addCriterion("`path` <", value, "path");
return (Criteria) this;
}
public Criteria andPathLessThanOrEqualTo(String value) {
addCriterion("`path` <=", value, "path");
return (Criteria) this;
}
public Criteria andPathLike(String value) {
addCriterion("`path` like", value, "path");
return (Criteria) this;
}
public Criteria andPathNotLike(String value) {
addCriterion("`path` not like", value, "path");
return (Criteria) this;
}
public Criteria andPathIn(List<String> values) {
addCriterion("`path` in", values, "path");
return (Criteria) this;
}
public Criteria andPathNotIn(List<String> values) {
addCriterion("`path` not in", values, "path");
return (Criteria) this;
}
public Criteria andPathBetween(String value1, String value2) {
addCriterion("`path` between", value1, value2, "path");
return (Criteria) this;
}
public Criteria andPathNotBetween(String value1, String value2) {
addCriterion("`path` not between", value1, value2, "path");
return (Criteria) this;
}
public Criteria andNumIsNull() {
addCriterion("num is null");
return (Criteria) this;
......@@ -1734,143 +1734,143 @@ public class ApiDefinitionExample {
return (Criteria) this;
}
public Criteria andRefIdIsNull() {
addCriterion("ref_id is null");
public Criteria andVersionIdIsNull() {
addCriterion("version_id is null");
return (Criteria) this;
}
public Criteria andRefIdIsNotNull() {
addCriterion("ref_id is not null");
public Criteria andVersionIdIsNotNull() {
addCriterion("version_id is not null");
return (Criteria) this;
}
public Criteria andRefIdEqualTo(String value) {
addCriterion("ref_id =", value, "refId");
public Criteria andVersionIdEqualTo(String value) {
addCriterion("version_id =", value, "versionId");
return (Criteria) this;
}
public Criteria andRefIdNotEqualTo(String value) {
addCriterion("ref_id <>", value, "refId");
public Criteria andVersionIdNotEqualTo(String value) {
addCriterion("version_id <>", value, "versionId");
return (Criteria) this;
}
public Criteria andRefIdGreaterThan(String value) {
addCriterion("ref_id >", value, "refId");
public Criteria andVersionIdGreaterThan(String value) {
addCriterion("version_id >", value, "versionId");
return (Criteria) this;
}
public Criteria andRefIdGreaterThanOrEqualTo(String value) {
addCriterion("ref_id >=", value, "refId");
public Criteria andVersionIdGreaterThanOrEqualTo(String value) {
addCriterion("version_id >=", value, "versionId");
return (Criteria) this;
}
public Criteria andRefIdLessThan(String value) {
addCriterion("ref_id <", value, "refId");
public Criteria andVersionIdLessThan(String value) {
addCriterion("version_id <", value, "versionId");
return (Criteria) this;
}
public Criteria andRefIdLessThanOrEqualTo(String value) {
addCriterion("ref_id <=", value, "refId");
public Criteria andVersionIdLessThanOrEqualTo(String value) {
addCriterion("version_id <=", value, "versionId");
return (Criteria) this;
}
public Criteria andRefIdLike(String value) {
addCriterion("ref_id like", value, "refId");
public Criteria andVersionIdLike(String value) {
addCriterion("version_id like", value, "versionId");
return (Criteria) this;
}
public Criteria andRefIdNotLike(String value) {
addCriterion("ref_id not like", value, "refId");
public Criteria andVersionIdNotLike(String value) {
addCriterion("version_id not like", value, "versionId");
return (Criteria) this;
}
public Criteria andRefIdIn(List<String> values) {
addCriterion("ref_id in", values, "refId");
public Criteria andVersionIdIn(List<String> values) {
addCriterion("version_id in", values, "versionId");
return (Criteria) this;
}
public Criteria andRefIdNotIn(List<String> values) {
addCriterion("ref_id not in", values, "refId");
public Criteria andVersionIdNotIn(List<String> values) {
addCriterion("version_id not in", values, "versionId");
return (Criteria) this;
}
public Criteria andRefIdBetween(String value1, String value2) {
addCriterion("ref_id between", value1, value2, "refId");
public Criteria andVersionIdBetween(String value1, String value2) {
addCriterion("version_id between", value1, value2, "versionId");
return (Criteria) this;
}
public Criteria andRefIdNotBetween(String value1, String value2) {
addCriterion("ref_id not between", value1, value2, "refId");
public Criteria andVersionIdNotBetween(String value1, String value2) {
addCriterion("version_id not between", value1, value2, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdIsNull() {
addCriterion("version_id is null");
public Criteria andRefIdIsNull() {
addCriterion("ref_id is null");
return (Criteria) this;
}
public Criteria andVersionIdIsNotNull() {
addCriterion("version_id is not null");
public Criteria andRefIdIsNotNull() {
addCriterion("ref_id is not null");
return (Criteria) this;
}
public Criteria andVersionIdEqualTo(String value) {
addCriterion("version_id =", value, "versionId");
public Criteria andRefIdEqualTo(String value) {
addCriterion("ref_id =", value, "refId");
return (Criteria) this;
}
public Criteria andVersionIdNotEqualTo(String value) {
addCriterion("version_id <>", value, "versionId");
public Criteria andRefIdNotEqualTo(String value) {
addCriterion("ref_id <>", value, "refId");
return (Criteria) this;
}
public Criteria andVersionIdGreaterThan(String value) {
addCriterion("version_id >", value, "versionId");
public Criteria andRefIdGreaterThan(String value) {
addCriterion("ref_id >", value, "refId");
return (Criteria) this;
}
public Criteria andVersionIdGreaterThanOrEqualTo(String value) {
addCriterion("version_id >=", value, "versionId");
public Criteria andRefIdGreaterThanOrEqualTo(String value) {
addCriterion("ref_id >=", value, "refId");
return (Criteria) this;
}
public Criteria andVersionIdLessThan(String value) {
addCriterion("version_id <", value, "versionId");
public Criteria andRefIdLessThan(String value) {
addCriterion("ref_id <", value, "refId");
return (Criteria) this;
}
public Criteria andVersionIdLessThanOrEqualTo(String value) {
addCriterion("version_id <=", value, "versionId");
public Criteria andRefIdLessThanOrEqualTo(String value) {
addCriterion("ref_id <=", value, "refId");
return (Criteria) this;
}
public Criteria andVersionIdLike(String value) {
addCriterion("version_id like", value, "versionId");
public Criteria andRefIdLike(String value) {
addCriterion("ref_id like", value, "refId");
return (Criteria) this;
}
public Criteria andVersionIdNotLike(String value) {
addCriterion("version_id not like", value, "versionId");
public Criteria andRefIdNotLike(String value) {
addCriterion("ref_id not like", value, "refId");
return (Criteria) this;
}
public Criteria andVersionIdIn(List<String> values) {
addCriterion("version_id in", values, "versionId");
public Criteria andRefIdIn(List<String> values) {
addCriterion("ref_id in", values, "refId");
return (Criteria) this;
}
public Criteria andVersionIdNotIn(List<String> values) {
addCriterion("version_id not in", values, "versionId");
public Criteria andRefIdNotIn(List<String> values) {
addCriterion("ref_id not in", values, "refId");
return (Criteria) this;
}
public Criteria andVersionIdBetween(String value1, String value2) {
addCriterion("version_id between", value1, value2, "versionId");
public Criteria andRefIdBetween(String value1, String value2) {
addCriterion("ref_id between", value1, value2, "refId");
return (Criteria) this;
}
public Criteria andVersionIdNotBetween(String value1, String value2) {
addCriterion("version_id not between", value1, value2, "versionId");
public Criteria andRefIdNotBetween(String value1, String value2) {
addCriterion("ref_id not between", value1, value2, "refId");
return (Criteria) this;
}
......
......@@ -17,5 +17,7 @@ public class ApiDefinitionWithBLOBs extends ApiDefinition implements Serializabl
private String remark;
private String customFields;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class ApiTemplate implements Serializable {
private String id;
private String name;
private String type;
private String description;
private Boolean system;
private Boolean global;
private String workspaceId;
private String createUser;
private String apiName;
private String apiMethod;
private String apiPath;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
This diff is collapsed.
......@@ -67,6 +67,8 @@ public class Project implements Serializable {
private String cleanLoadReportExpr;
private String apiTemplateId;
private String issueConfig;
private static final long serialVersionUID = 1L;
......
......@@ -2143,6 +2143,76 @@ public class ProjectExample {
addCriterion("clean_load_report_expr not between", value1, value2, "cleanLoadReportExpr");
return (Criteria) this;
}
public Criteria andApiTemplateIdIsNull() {
addCriterion("api_template_id is null");
return (Criteria) this;
}
public Criteria andApiTemplateIdIsNotNull() {
addCriterion("api_template_id is not null");
return (Criteria) this;
}
public Criteria andApiTemplateIdEqualTo(String value) {
addCriterion("api_template_id =", value, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdNotEqualTo(String value) {
addCriterion("api_template_id <>", value, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdGreaterThan(String value) {
addCriterion("api_template_id >", value, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdGreaterThanOrEqualTo(String value) {
addCriterion("api_template_id >=", value, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdLessThan(String value) {
addCriterion("api_template_id <", value, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdLessThanOrEqualTo(String value) {
addCriterion("api_template_id <=", value, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdLike(String value) {
addCriterion("api_template_id like", value, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdNotLike(String value) {
addCriterion("api_template_id not like", value, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdIn(List<String> values) {
addCriterion("api_template_id in", values, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdNotIn(List<String> values) {
addCriterion("api_template_id not in", values, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdBetween(String value1, String value2) {
addCriterion("api_template_id between", value1, value2, "apiTemplateId");
return (Criteria) this;
}
public Criteria andApiTemplateIdNotBetween(String value1, String value2) {
addCriterion("api_template_id not between", value1, value2, "apiTemplateId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
......@@ -17,7 +17,5 @@ public class SwaggerUrlProject implements Serializable {
private String modeId;
private String config;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SwaggerUrlProjectWithBLOBs extends SwaggerUrlProject implements Serializable {
private String config;
private String customFields;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -6,6 +6,8 @@
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
<result column="path" jdbcType="VARCHAR" property="path" />
<result column="module_path" jdbcType="VARCHAR" property="modulePath" />
<result column="environment_id" jdbcType="VARCHAR" property="environmentId" />
<result column="schedule" jdbcType="VARCHAR" property="schedule" />
......@@ -14,8 +16,6 @@
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
<result column="path" jdbcType="VARCHAR" property="path" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="tags" jdbcType="VARCHAR" property="tags" />
<result column="original_state" jdbcType="VARCHAR" property="originalState" />
......@@ -26,8 +26,8 @@
<result column="delete_time" jdbcType="BIGINT" property="deleteTime" />
<result column="delete_user_id" jdbcType="VARCHAR" property="deleteUserId" />
<result column="order" jdbcType="BIGINT" property="order" />
<result column="ref_id" jdbcType="VARCHAR" property="refId" />
<result column="version_id" jdbcType="VARCHAR" property="versionId" />
<result column="ref_id" jdbcType="VARCHAR" property="refId" />
<result column="latest" jdbcType="BIT" property="latest" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
......@@ -35,6 +35,7 @@
<result column="request" jdbcType="LONGVARCHAR" property="request" />
<result column="response" jdbcType="LONGVARCHAR" property="response" />
<result column="remark" jdbcType="LONGVARCHAR" property="remark" />
<result column="custom_fields" jdbcType="LONGVARCHAR" property="customFields" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -95,13 +96,13 @@
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, `name`, `method`, module_path, environment_id, schedule, `status`,
module_id, user_id, create_time, update_time, protocol, `path`, num, tags, original_state,
id, project_id, `name`, `method`, protocol, `path`, module_path, environment_id,
schedule, `status`, module_id, user_id, create_time, update_time, num, tags, original_state,
create_user, case_total, case_status, case_passing_rate, delete_time, delete_user_id,
`order`, ref_id, version_id, latest
`order`, version_id, ref_id, latest
</sql>
<sql id="Blob_Column_List">
description, request, response, remark
description, request, response, remark, custom_fields
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.ApiDefinitionExample" resultMap="ResultMapWithBLOBs">
select
......@@ -152,28 +153,28 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
INSERT INTO api_definition (id, project_id, `name`,
`method`, module_path, environment_id,
schedule, `status`, module_id,
user_id, create_time, update_time,
protocol, `path`, num,
insert into api_definition (id, project_id, `name`,
`method`, protocol, `path`,
module_path, environment_id, schedule,
`status`, module_id, user_id,
create_time, update_time, num,
tags, original_state, create_user,
case_total, case_status, case_passing_rate,
delete_time, delete_user_id, `order`,
ref_id, version_id, latest,
version_id, ref_id, latest,
description, request, response,
remark)
VALUES (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{method,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR},
#{schedule,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{protocol,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER},
remark, custom_fields)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{method,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR},
#{modulePath,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{schedule,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{num,jdbcType=INTEGER},
#{tags,jdbcType=VARCHAR}, #{originalState,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
#{caseTotal,jdbcType=VARCHAR}, #{caseStatus,jdbcType=VARCHAR}, #{casePassingRate,jdbcType=VARCHAR},
#{deleteTime,jdbcType=BIGINT}, #{deleteUserId,jdbcType=VARCHAR}, #{order,jdbcType=BIGINT},
#{refId,jdbcType=VARCHAR}, #{versionId,jdbcType=VARCHAR}, #{latest,jdbcType=BIT},
#{versionId,jdbcType=VARCHAR}, #{refId,jdbcType=VARCHAR}, #{latest,jdbcType=BIT},
#{description,jdbcType=LONGVARCHAR}, #{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR},
#{remark,jdbcType=LONGVARCHAR})
#{remark,jdbcType=LONGVARCHAR}, #{customFields,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
insert into api_definition
......@@ -190,6 +191,12 @@
<if test="method != null">
`method`,
</if>
<if test="protocol != null">
protocol,
</if>
<if test="path != null">
`path`,
</if>
<if test="modulePath != null">
module_path,
</if>
......@@ -214,12 +221,6 @@
<if test="updateTime != null">
update_time,
</if>
<if test="protocol != null">
protocol,
</if>
<if test="path != null">
`path`,
</if>
<if test="num != null">
num,
</if>
......@@ -250,12 +251,12 @@
<if test="order != null">
`order`,
</if>
<if test="refId != null">
ref_id,
</if>
<if test="versionId != null">
version_id,
</if>
<if test="refId != null">
ref_id,
</if>
<if test="latest != null">
latest,
</if>
......@@ -271,6 +272,9 @@
<if test="remark != null">
remark,
</if>
<if test="customFields != null">
custom_fields,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -285,6 +289,12 @@
<if test="method != null">
#{method,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
#{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
#{path,jdbcType=VARCHAR},
</if>
<if test="modulePath != null">
#{modulePath,jdbcType=VARCHAR},
</if>
......@@ -309,12 +319,6 @@
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="protocol != null">
#{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
#{path,jdbcType=VARCHAR},
</if>
<if test="num != null">
#{num,jdbcType=INTEGER},
</if>
......@@ -345,12 +349,12 @@
<if test="order != null">
#{order,jdbcType=BIGINT},
</if>
<if test="refId != null">
#{refId,jdbcType=VARCHAR},
</if>
<if test="versionId != null">
#{versionId,jdbcType=VARCHAR},
</if>
<if test="refId != null">
#{refId,jdbcType=VARCHAR},
</if>
<if test="latest != null">
#{latest,jdbcType=BIT},
</if>
......@@ -366,6 +370,9 @@
<if test="remark != null">
#{remark,jdbcType=LONGVARCHAR},
</if>
<if test="customFields != null">
#{customFields,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiDefinitionExample" resultType="java.lang.Long">
......@@ -389,6 +396,12 @@
<if test="record.method != null">
`method` = #{record.method,jdbcType=VARCHAR},
</if>
<if test="record.protocol != null">
protocol = #{record.protocol,jdbcType=VARCHAR},
</if>
<if test="record.path != null">
`path` = #{record.path,jdbcType=VARCHAR},
</if>
<if test="record.modulePath != null">
module_path = #{record.modulePath,jdbcType=VARCHAR},
</if>
......@@ -413,12 +426,6 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.protocol != null">
protocol = #{record.protocol,jdbcType=VARCHAR},
</if>
<if test="record.path != null">
`path` = #{record.path,jdbcType=VARCHAR},
</if>
<if test="record.num != null">
num = #{record.num,jdbcType=INTEGER},
</if>
......@@ -449,12 +456,12 @@
<if test="record.order != null">
`order` = #{record.order,jdbcType=BIGINT},
</if>
<if test="record.refId != null">
ref_id = #{record.refId,jdbcType=VARCHAR},
</if>
<if test="record.versionId != null">
version_id = #{record.versionId,jdbcType=VARCHAR},
</if>
<if test="record.refId != null">
ref_id = #{record.refId,jdbcType=VARCHAR},
</if>
<if test="record.latest != null">
latest = #{record.latest,jdbcType=BIT},
</if>
......@@ -470,6 +477,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=LONGVARCHAR},
</if>
<if test="record.customFields != null">
custom_fields = #{record.customFields,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -481,6 +491,8 @@
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`method` = #{record.method,jdbcType=VARCHAR},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR},
module_path = #{record.modulePath,jdbcType=VARCHAR},
environment_id = #{record.environmentId,jdbcType=VARCHAR},
schedule = #{record.schedule,jdbcType=VARCHAR},
......@@ -489,8 +501,6 @@
user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR},
num = #{record.num,jdbcType=INTEGER},
tags = #{record.tags,jdbcType=VARCHAR},
original_state = #{record.originalState,jdbcType=VARCHAR},
......@@ -501,13 +511,14 @@
delete_time = #{record.deleteTime,jdbcType=BIGINT},
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT},
ref_id = #{record.refId,jdbcType=VARCHAR},
version_id = #{record.versionId,jdbcType=VARCHAR},
ref_id = #{record.refId,jdbcType=VARCHAR},
latest = #{record.latest,jdbcType=BIT},
description = #{record.description,jdbcType=LONGVARCHAR},
request = #{record.request,jdbcType=LONGVARCHAR},
response = #{record.response,jdbcType=LONGVARCHAR},
remark = #{record.remark,jdbcType=LONGVARCHAR}
remark = #{record.remark,jdbcType=LONGVARCHAR},
custom_fields = #{record.customFields,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -518,6 +529,8 @@
project_id = #{record.projectId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`method` = #{record.method,jdbcType=VARCHAR},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR},
module_path = #{record.modulePath,jdbcType=VARCHAR},
environment_id = #{record.environmentId,jdbcType=VARCHAR},
schedule = #{record.schedule,jdbcType=VARCHAR},
......@@ -526,8 +539,6 @@
user_id = #{record.userId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
protocol = #{record.protocol,jdbcType=VARCHAR},
`path` = #{record.path,jdbcType=VARCHAR},
num = #{record.num,jdbcType=INTEGER},
tags = #{record.tags,jdbcType=VARCHAR},
original_state = #{record.originalState,jdbcType=VARCHAR},
......@@ -538,8 +549,8 @@
delete_time = #{record.deleteTime,jdbcType=BIGINT},
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
`order` = #{record.order,jdbcType=BIGINT},
ref_id = #{record.refId,jdbcType=VARCHAR},
version_id = #{record.versionId,jdbcType=VARCHAR},
ref_id = #{record.refId,jdbcType=VARCHAR},
latest = #{record.latest,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -557,6 +568,12 @@
<if test="method != null">
`method` = #{method,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
`path` = #{path,jdbcType=VARCHAR},
</if>
<if test="modulePath != null">
module_path = #{modulePath,jdbcType=VARCHAR},
</if>
......@@ -581,12 +598,6 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="protocol != null">
protocol = #{protocol,jdbcType=VARCHAR},
</if>
<if test="path != null">
`path` = #{path,jdbcType=VARCHAR},
</if>
<if test="num != null">
num = #{num,jdbcType=INTEGER},
</if>
......@@ -617,12 +628,12 @@
<if test="order != null">
`order` = #{order,jdbcType=BIGINT},
</if>
<if test="refId != null">
ref_id = #{refId,jdbcType=VARCHAR},
</if>
<if test="versionId != null">
version_id = #{versionId,jdbcType=VARCHAR},
</if>
<if test="refId != null">
ref_id = #{refId,jdbcType=VARCHAR},
</if>
<if test="latest != null">
latest = #{latest,jdbcType=BIT},
</if>
......@@ -638,6 +649,9 @@
<if test="remark != null">
remark = #{remark,jdbcType=LONGVARCHAR},
</if>
<if test="customFields != null">
custom_fields = #{customFields,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
......@@ -646,6 +660,8 @@
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR},
schedule = #{schedule,jdbcType=VARCHAR},
......@@ -654,8 +670,6 @@
user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR},
num = #{num,jdbcType=INTEGER},
tags = #{tags,jdbcType=VARCHAR},
original_state = #{originalState,jdbcType=VARCHAR},
......@@ -666,13 +680,14 @@
delete_time = #{deleteTime,jdbcType=BIGINT},
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT},
ref_id = #{refId,jdbcType=VARCHAR},
version_id = #{versionId,jdbcType=VARCHAR},
ref_id = #{refId,jdbcType=VARCHAR},
latest = #{latest,jdbcType=BIT},
description = #{description,jdbcType=LONGVARCHAR},
request = #{request,jdbcType=LONGVARCHAR},
response = #{response,jdbcType=LONGVARCHAR},
remark = #{remark,jdbcType=LONGVARCHAR}
remark = #{remark,jdbcType=LONGVARCHAR},
custom_fields = #{customFields,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiDefinition">
......@@ -680,6 +695,8 @@
set project_id = #{projectId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR},
module_path = #{modulePath,jdbcType=VARCHAR},
environment_id = #{environmentId,jdbcType=VARCHAR},
schedule = #{schedule,jdbcType=VARCHAR},
......@@ -688,8 +705,6 @@
user_id = #{userId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
protocol = #{protocol,jdbcType=VARCHAR},
`path` = #{path,jdbcType=VARCHAR},
num = #{num,jdbcType=INTEGER},
tags = #{tags,jdbcType=VARCHAR},
original_state = #{originalState,jdbcType=VARCHAR},
......@@ -700,8 +715,8 @@
delete_time = #{deleteTime,jdbcType=BIGINT},
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
`order` = #{order,jdbcType=BIGINT},
ref_id = #{refId,jdbcType=VARCHAR},
version_id = #{versionId,jdbcType=VARCHAR},
ref_id = #{refId,jdbcType=VARCHAR},
latest = #{latest,jdbcType=BIT}
where id = #{id,jdbcType=VARCHAR}
</update>
......
package io.metersphere.base.mapper;
import io.metersphere.base.domain.ApiTemplate;
import io.metersphere.base.domain.ApiTemplateExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ApiTemplateMapper {
long countByExample(ApiTemplateExample example);
int deleteByExample(ApiTemplateExample example);
int deleteByPrimaryKey(String id);
int insert(ApiTemplate record);
int insertSelective(ApiTemplate record);
List<ApiTemplate> selectByExample(ApiTemplateExample example);
ApiTemplate selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") ApiTemplate record, @Param("example") ApiTemplateExample example);
int updateByExample(@Param("record") ApiTemplate record, @Param("example") ApiTemplateExample example);
int updateByPrimaryKeySelective(ApiTemplate record);
int updateByPrimaryKey(ApiTemplate record);
}
\ No newline at end of file
<?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.ApiTemplateMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.ApiTemplate">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="system" jdbcType="BIT" property="system" />
<result column="global" jdbcType="BIT" property="global" />
<result column="workspace_id" jdbcType="VARCHAR" property="workspaceId" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="api_name" jdbcType="VARCHAR" property="apiName" />
<result column="api_method" jdbcType="VARCHAR" property="apiMethod" />
<result column="api_path" jdbcType="VARCHAR" property="apiPath" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</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, `name`, `type`, description, `system`, `global`, workspace_id, create_user, api_name,
api_method, api_path, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.ApiTemplateExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from api_template
<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="BaseResultMap">
select
<include refid="Base_Column_List" />
from api_template
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from api_template
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.ApiTemplateExample">
delete from api_template
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiTemplate">
insert into api_template (id, `name`, `type`,
description, `system`, `global`,
workspace_id, create_user, api_name,
api_method, api_path, create_time,
update_time)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{system,jdbcType=BIT}, #{global,jdbcType=BIT},
#{workspaceId,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{apiName,jdbcType=VARCHAR},
#{apiMethod,jdbcType=VARCHAR}, #{apiPath,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiTemplate">
insert into api_template
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
`name`,
</if>
<if test="type != null">
`type`,
</if>
<if test="description != null">
description,
</if>
<if test="system != null">
`system`,
</if>
<if test="global != null">
`global`,
</if>
<if test="workspaceId != null">
workspace_id,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="apiName != null">
api_name,
</if>
<if test="apiMethod != null">
api_method,
</if>
<if test="apiPath != null">
api_path,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="system != null">
#{system,jdbcType=BIT},
</if>
<if test="global != null">
#{global,jdbcType=BIT},
</if>
<if test="workspaceId != null">
#{workspaceId,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="apiName != null">
#{apiName,jdbcType=VARCHAR},
</if>
<if test="apiMethod != null">
#{apiMethod,jdbcType=VARCHAR},
</if>
<if test="apiPath != null">
#{apiPath,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.ApiTemplateExample" resultType="java.lang.Long">
select count(*) from api_template
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update api_template
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.system != null">
`system` = #{record.system,jdbcType=BIT},
</if>
<if test="record.global != null">
`global` = #{record.global,jdbcType=BIT},
</if>
<if test="record.workspaceId != null">
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.apiName != null">
api_name = #{record.apiName,jdbcType=VARCHAR},
</if>
<if test="record.apiMethod != null">
api_method = #{record.apiMethod,jdbcType=VARCHAR},
</if>
<if test="record.apiPath != null">
api_path = #{record.apiPath,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>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update api_template
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
`system` = #{record.system,jdbcType=BIT},
`global` = #{record.global,jdbcType=BIT},
workspace_id = #{record.workspaceId,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
api_name = #{record.apiName,jdbcType=VARCHAR},
api_method = #{record.apiMethod,jdbcType=VARCHAR},
api_path = #{record.apiPath,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.ApiTemplate">
update api_template
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
`type` = #{type,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="system != null">
`system` = #{system,jdbcType=BIT},
</if>
<if test="global != null">
`global` = #{global,jdbcType=BIT},
</if>
<if test="workspaceId != null">
workspace_id = #{workspaceId,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="apiName != null">
api_name = #{apiName,jdbcType=VARCHAR},
</if>
<if test="apiMethod != null">
api_method = #{apiMethod,jdbcType=VARCHAR},
</if>
<if test="apiPath != null">
api_path = #{apiPath,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.ApiTemplate">
update api_template
set `name` = #{name,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
`system` = #{system,jdbcType=BIT},
`global` = #{global,jdbcType=BIT},
workspace_id = #{workspaceId,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
api_name = #{apiName,jdbcType=VARCHAR},
api_method = #{apiMethod,jdbcType=VARCHAR},
api_path = #{apiPath,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
......@@ -33,6 +33,7 @@
<result column="clean_api_report_expr" jdbcType="VARCHAR" property="cleanApiReportExpr" />
<result column="clean_load_report" jdbcType="BIT" property="cleanLoadReport" />
<result column="clean_load_report_expr" jdbcType="VARCHAR" property="cleanLoadReportExpr" />
<result column="api_template_id" jdbcType="VARCHAR" property="apiTemplateId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.Project">
<result column="issue_config" jdbcType="LONGVARCHAR" property="issueConfig" />
......@@ -101,7 +102,7 @@
scenario_custom_num, create_user, system_id, mock_tcp_port, is_mock_tcp_open, azure_filter_id,
platform, third_part_template, case_public, api_quick, version_enable, clean_track_report,
clean_track_report_expr, clean_api_report, clean_api_report_expr, clean_load_report,
clean_load_report_expr
clean_load_report_expr, api_template_id
</sql>
<sql id="Blob_Column_List">
issue_config
......@@ -165,7 +166,8 @@
third_part_template, case_public, api_quick,
version_enable, clean_track_report, clean_track_report_expr,
clean_api_report, clean_api_report_expr, clean_load_report,
clean_load_report_expr, issue_config)
clean_load_report_expr, api_template_id, issue_config
)
values (#{id,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{tapdId,jdbcType=VARCHAR}, #{jiraKey,jdbcType=VARCHAR}, #{zentaoId,jdbcType=VARCHAR},
......@@ -176,7 +178,8 @@
#{thirdPartTemplate,jdbcType=BIT}, #{casePublic,jdbcType=BIT}, #{apiQuick,jdbcType=VARCHAR},
#{versionEnable,jdbcType=BIT}, #{cleanTrackReport,jdbcType=BIT}, #{cleanTrackReportExpr,jdbcType=VARCHAR},
#{cleanApiReport,jdbcType=BIT}, #{cleanApiReportExpr,jdbcType=VARCHAR}, #{cleanLoadReport,jdbcType=BIT},
#{cleanLoadReportExpr,jdbcType=VARCHAR}, #{issueConfig,jdbcType=LONGVARCHAR})
#{cleanLoadReportExpr,jdbcType=VARCHAR}, #{apiTemplateId,jdbcType=VARCHAR}, #{issueConfig,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.Project">
insert into project
......@@ -274,6 +277,9 @@
<if test="cleanLoadReportExpr != null">
clean_load_report_expr,
</if>
<if test="apiTemplateId != null">
api_template_id,
</if>
<if test="issueConfig != null">
issue_config,
</if>
......@@ -372,6 +378,9 @@
<if test="cleanLoadReportExpr != null">
#{cleanLoadReportExpr,jdbcType=VARCHAR},
</if>
<if test="apiTemplateId != null">
#{apiTemplateId,jdbcType=VARCHAR},
</if>
<if test="issueConfig != null">
#{issueConfig,jdbcType=LONGVARCHAR},
</if>
......@@ -479,6 +488,9 @@
<if test="record.cleanLoadReportExpr != null">
clean_load_report_expr = #{record.cleanLoadReportExpr,jdbcType=VARCHAR},
</if>
<if test="record.apiTemplateId != null">
api_template_id = #{record.apiTemplateId,jdbcType=VARCHAR},
</if>
<if test="record.issueConfig != null">
issue_config = #{record.issueConfig,jdbcType=LONGVARCHAR},
</if>
......@@ -520,6 +532,7 @@
clean_api_report_expr = #{record.cleanApiReportExpr,jdbcType=VARCHAR},
clean_load_report = #{record.cleanLoadReport,jdbcType=BIT},
clean_load_report_expr = #{record.cleanLoadReportExpr,jdbcType=VARCHAR},
api_template_id = #{record.apiTemplateId,jdbcType=VARCHAR},
issue_config = #{record.issueConfig,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -557,7 +570,8 @@
clean_api_report = #{record.cleanApiReport,jdbcType=BIT},
clean_api_report_expr = #{record.cleanApiReportExpr,jdbcType=VARCHAR},
clean_load_report = #{record.cleanLoadReport,jdbcType=BIT},
clean_load_report_expr = #{record.cleanLoadReportExpr,jdbcType=VARCHAR}
clean_load_report_expr = #{record.cleanLoadReportExpr,jdbcType=VARCHAR},
api_template_id = #{record.apiTemplateId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -655,6 +669,9 @@
<if test="cleanLoadReportExpr != null">
clean_load_report_expr = #{cleanLoadReportExpr,jdbcType=VARCHAR},
</if>
<if test="apiTemplateId != null">
api_template_id = #{apiTemplateId,jdbcType=VARCHAR},
</if>
<if test="issueConfig != null">
issue_config = #{issueConfig,jdbcType=LONGVARCHAR},
</if>
......@@ -693,6 +710,7 @@
clean_api_report_expr = #{cleanApiReportExpr,jdbcType=VARCHAR},
clean_load_report = #{cleanLoadReport,jdbcType=BIT},
clean_load_report_expr = #{cleanLoadReportExpr,jdbcType=VARCHAR},
api_template_id = #{apiTemplateId,jdbcType=VARCHAR},
issue_config = #{issueConfig,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
......@@ -727,7 +745,8 @@
clean_api_report = #{cleanApiReport,jdbcType=BIT},
clean_api_report_expr = #{cleanApiReportExpr,jdbcType=VARCHAR},
clean_load_report = #{cleanLoadReport,jdbcType=BIT},
clean_load_report_expr = #{cleanLoadReportExpr,jdbcType=VARCHAR}
clean_load_report_expr = #{cleanLoadReportExpr,jdbcType=VARCHAR},
api_template_id = #{apiTemplateId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
......@@ -2,6 +2,7 @@ package io.metersphere.base.mapper;
import io.metersphere.base.domain.SwaggerUrlProject;
import io.metersphere.base.domain.SwaggerUrlProjectExample;
import io.metersphere.base.domain.SwaggerUrlProjectWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Param;
......@@ -12,25 +13,25 @@ public interface SwaggerUrlProjectMapper {
int deleteByPrimaryKey(String id);
int insert(SwaggerUrlProject record);
int insert(SwaggerUrlProjectWithBLOBs record);
int insertSelective(SwaggerUrlProject record);
int insertSelective(SwaggerUrlProjectWithBLOBs record);
List<SwaggerUrlProject> selectByExampleWithBLOBs(SwaggerUrlProjectExample example);
List<SwaggerUrlProjectWithBLOBs> selectByExampleWithBLOBs(SwaggerUrlProjectExample example);
List<SwaggerUrlProject> selectByExample(SwaggerUrlProjectExample example);
SwaggerUrlProject selectByPrimaryKey(String id);
SwaggerUrlProjectWithBLOBs selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") SwaggerUrlProject record, @Param("example") SwaggerUrlProjectExample example);
int updateByExampleSelective(@Param("record") SwaggerUrlProjectWithBLOBs record, @Param("example") SwaggerUrlProjectExample example);
int updateByExampleWithBLOBs(@Param("record") SwaggerUrlProject record, @Param("example") SwaggerUrlProjectExample example);
int updateByExampleWithBLOBs(@Param("record") SwaggerUrlProjectWithBLOBs record, @Param("example") SwaggerUrlProjectExample example);
int updateByExample(@Param("record") SwaggerUrlProject record, @Param("example") SwaggerUrlProjectExample example);
int updateByPrimaryKeySelective(SwaggerUrlProject record);
int updateByPrimaryKeySelective(SwaggerUrlProjectWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(SwaggerUrlProject record);
int updateByPrimaryKeyWithBLOBs(SwaggerUrlProjectWithBLOBs record);
int updateByPrimaryKey(SwaggerUrlProject record);
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment