diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReport.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReport.java index 1b9a7f481c..e37c426eec 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReport.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReport.java @@ -46,12 +46,6 @@ public class ApiReport implements Serializable { @Size(min = 1, max = 50, message = "{api_report.status.length_range}", groups = {Created.class, Updated.class}) private String status; - @Schema(description = "接口开始执行时间") - private Long startTime; - - @Schema(description = "接口执行结束时间") - private Long endTime; - @Schema(description = "执行模块/API/CASE/API_PLAN", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{api_report.run_mode.not_blank}", groups = {Created.class}) @Size(min = 1, max = 20, message = "{api_report.run_mode.length_range}", groups = {Created.class, Updated.class}) @@ -75,15 +69,13 @@ public class ApiReport implements Serializable { @Size(min = 1, max = 50, message = "{api_report.project_id.length_range}", groups = {Created.class, Updated.class}) private String projectId; - @Schema(description = "集成报告id/api_scenario_report_id", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{api_report.integrated_report_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{api_report.integrated_report_id.length_range}", groups = {Created.class, Updated.class}) - private String integratedReportId; - @Schema(description = "是否为集成报告,默认否", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "{api_report.integrated.not_blank}", groups = {Created.class}) private Boolean integrated; + @Schema(description = "环境id") + private String environmentId; + private static final long serialVersionUID = 1L; public enum Column { @@ -96,15 +88,13 @@ public class ApiReport implements Serializable { updateUser("update_user", "updateUser", "VARCHAR", false), deleted("deleted", "deleted", "BIT", false), status("status", "status", "VARCHAR", true), - startTime("start_time", "startTime", "BIGINT", false), - endTime("end_time", "endTime", "BIGINT", false), runMode("run_mode", "runMode", "VARCHAR", false), poolId("pool_id", "poolId", "VARCHAR", false), triggerMode("trigger_mode", "triggerMode", "VARCHAR", false), versionId("version_id", "versionId", "VARCHAR", false), projectId("project_id", "projectId", "VARCHAR", false), - integratedReportId("integrated_report_id", "integratedReportId", "VARCHAR", false), - integrated("integrated", "integrated", "BIT", false); + integrated("integrated", "integrated", "BIT", false), + environmentId("environment_id", "environmentId", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportDetail.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportDetail.java new file mode 100644 index 0000000000..e9c31d4b00 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportDetail.java @@ -0,0 +1,149 @@ +package io.metersphere.api.domain; + +import io.metersphere.validation.groups.*; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.*; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; + +@Data +public class ApiReportDetail implements Serializable { + @Schema(description = "报告详情id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_report_detail.id.not_blank}", groups = {Updated.class}) + @Size(min = 1, max = 50, message = "{api_report_detail.id.length_range}", groups = {Created.class, Updated.class}) + private String id; + + @Schema(description = "接口报告id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_report_detail.report_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{api_report_detail.report_id.length_range}", groups = {Created.class, Updated.class}) + private String reportId; + + @Schema(description = "场景中各个步骤请求唯一标识", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_report_detail.resource_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{api_report_detail.resource_id.length_range}", groups = {Created.class, Updated.class}) + private String resourceId; + + @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{api_report_detail.start_time.not_blank}", groups = {Created.class}) + private Long startTime; + + @Schema(description = "结果状态", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_report_detail.status.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 20, message = "{api_report_detail.status.length_range}", groups = {Created.class, Updated.class}) + private String status; + + @Schema(description = "单个请求步骤时间") + private Long requestTime; + + @Schema(description = "总断言数") + private Long assertionsTotal; + + @Schema(description = "失败断言数") + private Long passAssertionsTotal; + + @Schema(description = "误报编号") + private String fakeCode; + + @Schema(description = "请求名称") + private String requestName; + + @Schema(description = "项目fk") + private String projectId; + + @Schema(description = "失败总数") + private Integer errorTotal; + + @Schema(description = "请求响应码") + private String code; + + @Schema(description = "结果内容详情") + private byte[] content; + + private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + reportId("report_id", "reportId", "VARCHAR", false), + resourceId("resource_id", "resourceId", "VARCHAR", false), + startTime("start_time", "startTime", "BIGINT", false), + status("status", "status", "VARCHAR", true), + requestTime("request_time", "requestTime", "BIGINT", false), + assertionsTotal("assertions_total", "assertionsTotal", "BIGINT", false), + passAssertionsTotal("pass_assertions_total", "passAssertionsTotal", "BIGINT", false), + fakeCode("fake_code", "fakeCode", "VARCHAR", false), + requestName("request_name", "requestName", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + errorTotal("error_total", "errorTotal", "INTEGER", false), + code("code", "code", "VARCHAR", false), + content("content", "content", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportDetailExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportDetailExample.java new file mode 100644 index 0000000000..48c94294b3 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportDetailExample.java @@ -0,0 +1,1060 @@ +package io.metersphere.api.domain; + +import java.util.ArrayList; +import java.util.List; + +public class ApiReportDetailExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ApiReportDetailExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andReportIdIsNull() { + addCriterion("report_id is null"); + return (Criteria) this; + } + + public Criteria andReportIdIsNotNull() { + addCriterion("report_id is not null"); + return (Criteria) this; + } + + public Criteria andReportIdEqualTo(String value) { + addCriterion("report_id =", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotEqualTo(String value) { + addCriterion("report_id <>", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThan(String value) { + addCriterion("report_id >", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThanOrEqualTo(String value) { + addCriterion("report_id >=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThan(String value) { + addCriterion("report_id <", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThanOrEqualTo(String value) { + addCriterion("report_id <=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLike(String value) { + addCriterion("report_id like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotLike(String value) { + addCriterion("report_id not like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdIn(List values) { + addCriterion("report_id in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotIn(List values) { + addCriterion("report_id not in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdBetween(String value1, String value2) { + addCriterion("report_id between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotBetween(String value1, String value2) { + addCriterion("report_id not between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andResourceIdIsNull() { + addCriterion("resource_id is null"); + return (Criteria) this; + } + + public Criteria andResourceIdIsNotNull() { + addCriterion("resource_id is not null"); + return (Criteria) this; + } + + public Criteria andResourceIdEqualTo(String value) { + addCriterion("resource_id =", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotEqualTo(String value) { + addCriterion("resource_id <>", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThan(String value) { + addCriterion("resource_id >", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThanOrEqualTo(String value) { + addCriterion("resource_id >=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThan(String value) { + addCriterion("resource_id <", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThanOrEqualTo(String value) { + addCriterion("resource_id <=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLike(String value) { + addCriterion("resource_id like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotLike(String value) { + addCriterion("resource_id not like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdIn(List values) { + addCriterion("resource_id in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotIn(List values) { + addCriterion("resource_id not in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdBetween(String value1, String value2) { + addCriterion("resource_id between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotBetween(String value1, String value2) { + addCriterion("resource_id not between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Long value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Long value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Long value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Long value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Long value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Long value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Long value1, Long value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Long value1, Long value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("`status` like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("`status` not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andRequestTimeIsNull() { + addCriterion("request_time is null"); + return (Criteria) this; + } + + public Criteria andRequestTimeIsNotNull() { + addCriterion("request_time is not null"); + return (Criteria) this; + } + + public Criteria andRequestTimeEqualTo(Long value) { + addCriterion("request_time =", value, "requestTime"); + return (Criteria) this; + } + + public Criteria andRequestTimeNotEqualTo(Long value) { + addCriterion("request_time <>", value, "requestTime"); + return (Criteria) this; + } + + public Criteria andRequestTimeGreaterThan(Long value) { + addCriterion("request_time >", value, "requestTime"); + return (Criteria) this; + } + + public Criteria andRequestTimeGreaterThanOrEqualTo(Long value) { + addCriterion("request_time >=", value, "requestTime"); + return (Criteria) this; + } + + public Criteria andRequestTimeLessThan(Long value) { + addCriterion("request_time <", value, "requestTime"); + return (Criteria) this; + } + + public Criteria andRequestTimeLessThanOrEqualTo(Long value) { + addCriterion("request_time <=", value, "requestTime"); + return (Criteria) this; + } + + public Criteria andRequestTimeIn(List values) { + addCriterion("request_time in", values, "requestTime"); + return (Criteria) this; + } + + public Criteria andRequestTimeNotIn(List values) { + addCriterion("request_time not in", values, "requestTime"); + return (Criteria) this; + } + + public Criteria andRequestTimeBetween(Long value1, Long value2) { + addCriterion("request_time between", value1, value2, "requestTime"); + return (Criteria) this; + } + + public Criteria andRequestTimeNotBetween(Long value1, Long value2) { + addCriterion("request_time not between", value1, value2, "requestTime"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalIsNull() { + addCriterion("assertions_total is null"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalIsNotNull() { + addCriterion("assertions_total is not null"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalEqualTo(Long value) { + addCriterion("assertions_total =", value, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalNotEqualTo(Long value) { + addCriterion("assertions_total <>", value, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalGreaterThan(Long value) { + addCriterion("assertions_total >", value, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalGreaterThanOrEqualTo(Long value) { + addCriterion("assertions_total >=", value, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalLessThan(Long value) { + addCriterion("assertions_total <", value, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalLessThanOrEqualTo(Long value) { + addCriterion("assertions_total <=", value, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalIn(List values) { + addCriterion("assertions_total in", values, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalNotIn(List values) { + addCriterion("assertions_total not in", values, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalBetween(Long value1, Long value2) { + addCriterion("assertions_total between", value1, value2, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andAssertionsTotalNotBetween(Long value1, Long value2) { + addCriterion("assertions_total not between", value1, value2, "assertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalIsNull() { + addCriterion("pass_assertions_total is null"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalIsNotNull() { + addCriterion("pass_assertions_total is not null"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalEqualTo(Long value) { + addCriterion("pass_assertions_total =", value, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalNotEqualTo(Long value) { + addCriterion("pass_assertions_total <>", value, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalGreaterThan(Long value) { + addCriterion("pass_assertions_total >", value, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalGreaterThanOrEqualTo(Long value) { + addCriterion("pass_assertions_total >=", value, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalLessThan(Long value) { + addCriterion("pass_assertions_total <", value, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalLessThanOrEqualTo(Long value) { + addCriterion("pass_assertions_total <=", value, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalIn(List values) { + addCriterion("pass_assertions_total in", values, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalNotIn(List values) { + addCriterion("pass_assertions_total not in", values, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalBetween(Long value1, Long value2) { + addCriterion("pass_assertions_total between", value1, value2, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andPassAssertionsTotalNotBetween(Long value1, Long value2) { + addCriterion("pass_assertions_total not between", value1, value2, "passAssertionsTotal"); + return (Criteria) this; + } + + public Criteria andFakeCodeIsNull() { + addCriterion("fake_code is null"); + return (Criteria) this; + } + + public Criteria andFakeCodeIsNotNull() { + addCriterion("fake_code is not null"); + return (Criteria) this; + } + + public Criteria andFakeCodeEqualTo(String value) { + addCriterion("fake_code =", value, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeNotEqualTo(String value) { + addCriterion("fake_code <>", value, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeGreaterThan(String value) { + addCriterion("fake_code >", value, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeGreaterThanOrEqualTo(String value) { + addCriterion("fake_code >=", value, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeLessThan(String value) { + addCriterion("fake_code <", value, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeLessThanOrEqualTo(String value) { + addCriterion("fake_code <=", value, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeLike(String value) { + addCriterion("fake_code like", value, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeNotLike(String value) { + addCriterion("fake_code not like", value, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeIn(List values) { + addCriterion("fake_code in", values, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeNotIn(List values) { + addCriterion("fake_code not in", values, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeBetween(String value1, String value2) { + addCriterion("fake_code between", value1, value2, "fakeCode"); + return (Criteria) this; + } + + public Criteria andFakeCodeNotBetween(String value1, String value2) { + addCriterion("fake_code not between", value1, value2, "fakeCode"); + return (Criteria) this; + } + + public Criteria andRequestNameIsNull() { + addCriterion("request_name is null"); + return (Criteria) this; + } + + public Criteria andRequestNameIsNotNull() { + addCriterion("request_name is not null"); + return (Criteria) this; + } + + public Criteria andRequestNameEqualTo(String value) { + addCriterion("request_name =", value, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameNotEqualTo(String value) { + addCriterion("request_name <>", value, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameGreaterThan(String value) { + addCriterion("request_name >", value, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameGreaterThanOrEqualTo(String value) { + addCriterion("request_name >=", value, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameLessThan(String value) { + addCriterion("request_name <", value, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameLessThanOrEqualTo(String value) { + addCriterion("request_name <=", value, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameLike(String value) { + addCriterion("request_name like", value, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameNotLike(String value) { + addCriterion("request_name not like", value, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameIn(List values) { + addCriterion("request_name in", values, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameNotIn(List values) { + addCriterion("request_name not in", values, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameBetween(String value1, String value2) { + addCriterion("request_name between", value1, value2, "requestName"); + return (Criteria) this; + } + + public Criteria andRequestNameNotBetween(String value1, String value2) { + addCriterion("request_name not between", value1, value2, "requestName"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNull() { + addCriterion("project_id is null"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNotNull() { + addCriterion("project_id is not null"); + return (Criteria) this; + } + + public Criteria andProjectIdEqualTo(String value) { + addCriterion("project_id =", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotEqualTo(String value) { + addCriterion("project_id <>", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThan(String value) { + addCriterion("project_id >", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThanOrEqualTo(String value) { + addCriterion("project_id >=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThan(String value) { + addCriterion("project_id <", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThanOrEqualTo(String value) { + addCriterion("project_id <=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLike(String value) { + addCriterion("project_id like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotLike(String value) { + addCriterion("project_id not like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdIn(List values) { + addCriterion("project_id in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotIn(List values) { + addCriterion("project_id not in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdBetween(String value1, String value2) { + addCriterion("project_id between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotBetween(String value1, String value2) { + addCriterion("project_id not between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andErrorTotalIsNull() { + addCriterion("error_total is null"); + return (Criteria) this; + } + + public Criteria andErrorTotalIsNotNull() { + addCriterion("error_total is not null"); + return (Criteria) this; + } + + public Criteria andErrorTotalEqualTo(Integer value) { + addCriterion("error_total =", value, "errorTotal"); + return (Criteria) this; + } + + public Criteria andErrorTotalNotEqualTo(Integer value) { + addCriterion("error_total <>", value, "errorTotal"); + return (Criteria) this; + } + + public Criteria andErrorTotalGreaterThan(Integer value) { + addCriterion("error_total >", value, "errorTotal"); + return (Criteria) this; + } + + public Criteria andErrorTotalGreaterThanOrEqualTo(Integer value) { + addCriterion("error_total >=", value, "errorTotal"); + return (Criteria) this; + } + + public Criteria andErrorTotalLessThan(Integer value) { + addCriterion("error_total <", value, "errorTotal"); + return (Criteria) this; + } + + public Criteria andErrorTotalLessThanOrEqualTo(Integer value) { + addCriterion("error_total <=", value, "errorTotal"); + return (Criteria) this; + } + + public Criteria andErrorTotalIn(List values) { + addCriterion("error_total in", values, "errorTotal"); + return (Criteria) this; + } + + public Criteria andErrorTotalNotIn(List values) { + addCriterion("error_total not in", values, "errorTotal"); + return (Criteria) this; + } + + public Criteria andErrorTotalBetween(Integer value1, Integer value2) { + addCriterion("error_total between", value1, value2, "errorTotal"); + return (Criteria) this; + } + + public Criteria andErrorTotalNotBetween(Integer value1, Integer value2) { + addCriterion("error_total not between", value1, value2, "errorTotal"); + return (Criteria) this; + } + + public Criteria andCodeIsNull() { + addCriterion("code is null"); + return (Criteria) this; + } + + public Criteria andCodeIsNotNull() { + addCriterion("code is not null"); + return (Criteria) this; + } + + public Criteria andCodeEqualTo(String value) { + addCriterion("code =", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotEqualTo(String value) { + addCriterion("code <>", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThan(String value) { + addCriterion("code >", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanOrEqualTo(String value) { + addCriterion("code >=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThan(String value) { + addCriterion("code <", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThanOrEqualTo(String value) { + addCriterion("code <=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLike(String value) { + addCriterion("code like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotLike(String value) { + addCriterion("code not like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeIn(List values) { + addCriterion("code in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotIn(List values) { + addCriterion("code not in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeBetween(String value1, String value2) { + addCriterion("code between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotBetween(String value1, String value2) { + addCriterion("code not between", value1, value2, "code"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportExample.java index 325946e823..7b3d778511 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportExample.java @@ -704,126 +704,6 @@ public class ApiReportExample { return (Criteria) this; } - public Criteria andStartTimeIsNull() { - addCriterion("start_time is null"); - return (Criteria) this; - } - - public Criteria andStartTimeIsNotNull() { - addCriterion("start_time is not null"); - return (Criteria) this; - } - - public Criteria andStartTimeEqualTo(Long value) { - addCriterion("start_time =", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotEqualTo(Long value) { - addCriterion("start_time <>", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeGreaterThan(Long value) { - addCriterion("start_time >", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeGreaterThanOrEqualTo(Long value) { - addCriterion("start_time >=", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeLessThan(Long value) { - addCriterion("start_time <", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeLessThanOrEqualTo(Long value) { - addCriterion("start_time <=", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeIn(List values) { - addCriterion("start_time in", values, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotIn(List values) { - addCriterion("start_time not in", values, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeBetween(Long value1, Long value2) { - addCriterion("start_time between", value1, value2, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotBetween(Long value1, Long value2) { - addCriterion("start_time not between", value1, value2, "startTime"); - return (Criteria) this; - } - - public Criteria andEndTimeIsNull() { - addCriterion("end_time is null"); - return (Criteria) this; - } - - public Criteria andEndTimeIsNotNull() { - addCriterion("end_time is not null"); - return (Criteria) this; - } - - public Criteria andEndTimeEqualTo(Long value) { - addCriterion("end_time =", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotEqualTo(Long value) { - addCriterion("end_time <>", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeGreaterThan(Long value) { - addCriterion("end_time >", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeGreaterThanOrEqualTo(Long value) { - addCriterion("end_time >=", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeLessThan(Long value) { - addCriterion("end_time <", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeLessThanOrEqualTo(Long value) { - addCriterion("end_time <=", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeIn(List values) { - addCriterion("end_time in", values, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotIn(List values) { - addCriterion("end_time not in", values, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeBetween(Long value1, Long value2) { - addCriterion("end_time between", value1, value2, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotBetween(Long value1, Long value2) { - addCriterion("end_time not between", value1, value2, "endTime"); - return (Criteria) this; - } - public Criteria andRunModeIsNull() { addCriterion("run_mode is null"); return (Criteria) this; @@ -1174,76 +1054,6 @@ public class ApiReportExample { return (Criteria) this; } - public Criteria andIntegratedReportIdIsNull() { - addCriterion("integrated_report_id is null"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdIsNotNull() { - addCriterion("integrated_report_id is not null"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdEqualTo(String value) { - addCriterion("integrated_report_id =", value, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdNotEqualTo(String value) { - addCriterion("integrated_report_id <>", value, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdGreaterThan(String value) { - addCriterion("integrated_report_id >", value, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdGreaterThanOrEqualTo(String value) { - addCriterion("integrated_report_id >=", value, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdLessThan(String value) { - addCriterion("integrated_report_id <", value, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdLessThanOrEqualTo(String value) { - addCriterion("integrated_report_id <=", value, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdLike(String value) { - addCriterion("integrated_report_id like", value, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdNotLike(String value) { - addCriterion("integrated_report_id not like", value, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdIn(List values) { - addCriterion("integrated_report_id in", values, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdNotIn(List values) { - addCriterion("integrated_report_id not in", values, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdBetween(String value1, String value2) { - addCriterion("integrated_report_id between", value1, value2, "integratedReportId"); - return (Criteria) this; - } - - public Criteria andIntegratedReportIdNotBetween(String value1, String value2) { - addCriterion("integrated_report_id not between", value1, value2, "integratedReportId"); - return (Criteria) this; - } - public Criteria andIntegratedIsNull() { addCriterion("integrated is null"); return (Criteria) this; @@ -1303,6 +1113,76 @@ public class ApiReportExample { addCriterion("integrated not between", value1, value2, "integrated"); return (Criteria) this; } + + public Criteria andEnvironmentIdIsNull() { + addCriterion("environment_id is null"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIsNotNull() { + addCriterion("environment_id is not null"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdEqualTo(String value) { + addCriterion("environment_id =", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotEqualTo(String value) { + addCriterion("environment_id <>", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdGreaterThan(String value) { + addCriterion("environment_id >", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdGreaterThanOrEqualTo(String value) { + addCriterion("environment_id >=", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLessThan(String value) { + addCriterion("environment_id <", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLessThanOrEqualTo(String value) { + addCriterion("environment_id <=", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLike(String value) { + addCriterion("environment_id like", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotLike(String value) { + addCriterion("environment_id not like", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIn(List values) { + addCriterion("environment_id in", values, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotIn(List values) { + addCriterion("environment_id not in", values, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdBetween(String value1, String value2) { + addCriterion("environment_id between", value1, value2, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotBetween(String value1, String value2) { + addCriterion("environment_id not between", value1, value2, "environmentId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportBlob.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportLog.java similarity index 76% rename from backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportBlob.java rename to backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportLog.java index 3c7659e294..3dbc9d9350 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportLog.java @@ -9,27 +9,19 @@ import java.util.Arrays; import lombok.Data; @Data -public class ApiReportBlob implements Serializable { - @Schema(description = "接口报告fk", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{api_report_blob.id.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 50, message = "{api_report_blob.id.length_range}", groups = {Created.class, Updated.class}) - private String id; +public class ApiReportLog implements Serializable { + @Schema(description = "请求资源 id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_report_log.report_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{api_report_log.report_id.length_range}", groups = {Created.class, Updated.class}) + private String reportId; - @Schema(description = "执行环境配置") - private String environmentId; - - @Schema(description = "结果内容详情") - private byte[] content; - - @Schema(description = "执行过程日志") + @Schema(description = "执行日志") private byte[] console; private static final long serialVersionUID = 1L; public enum Column { - id("id", "id", "VARCHAR", false), - environmentId("environment_id", "environmentId", "VARCHAR", false), - content("content", "content", "LONGVARBINARY", false), + reportId("report_id", "reportId", "VARCHAR", false), console("console", "console", "LONGVARBINARY", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportBlobExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportLogExample.java similarity index 57% rename from backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportBlobExample.java rename to backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportLogExample.java index 7e39499e6b..c9489db4bd 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportBlobExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportLogExample.java @@ -3,14 +3,14 @@ package io.metersphere.api.domain; import java.util.ArrayList; import java.util.List; -public class ApiReportBlobExample { +public class ApiReportLogExample { protected String orderByClause; protected boolean distinct; protected List oredCriteria; - public ApiReportBlobExample() { + public ApiReportLogExample() { oredCriteria = new ArrayList(); } @@ -104,143 +104,73 @@ public class ApiReportBlobExample { criteria.add(new Criterion(condition, value1, value2)); } - public Criteria andIdIsNull() { - addCriterion("id is null"); + public Criteria andReportIdIsNull() { + addCriterion("report_id is null"); return (Criteria) this; } - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); + public Criteria andReportIdIsNotNull() { + addCriterion("report_id is not null"); return (Criteria) this; } - public Criteria andIdEqualTo(String value) { - addCriterion("id =", value, "id"); + public Criteria andReportIdEqualTo(String value) { + addCriterion("report_id =", value, "reportId"); return (Criteria) this; } - public Criteria andIdNotEqualTo(String value) { - addCriterion("id <>", value, "id"); + public Criteria andReportIdNotEqualTo(String value) { + addCriterion("report_id <>", value, "reportId"); return (Criteria) this; } - public Criteria andIdGreaterThan(String value) { - addCriterion("id >", value, "id"); + public Criteria andReportIdGreaterThan(String value) { + addCriterion("report_id >", value, "reportId"); return (Criteria) this; } - public Criteria andIdGreaterThanOrEqualTo(String value) { - addCriterion("id >=", value, "id"); + public Criteria andReportIdGreaterThanOrEqualTo(String value) { + addCriterion("report_id >=", value, "reportId"); return (Criteria) this; } - public Criteria andIdLessThan(String value) { - addCriterion("id <", value, "id"); + public Criteria andReportIdLessThan(String value) { + addCriterion("report_id <", value, "reportId"); return (Criteria) this; } - public Criteria andIdLessThanOrEqualTo(String value) { - addCriterion("id <=", value, "id"); + public Criteria andReportIdLessThanOrEqualTo(String value) { + addCriterion("report_id <=", value, "reportId"); return (Criteria) this; } - public Criteria andIdLike(String value) { - addCriterion("id like", value, "id"); + public Criteria andReportIdLike(String value) { + addCriterion("report_id like", value, "reportId"); return (Criteria) this; } - public Criteria andIdNotLike(String value) { - addCriterion("id not like", value, "id"); + public Criteria andReportIdNotLike(String value) { + addCriterion("report_id not like", value, "reportId"); return (Criteria) this; } - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); + public Criteria andReportIdIn(List values) { + addCriterion("report_id in", values, "reportId"); return (Criteria) this; } - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); + public Criteria andReportIdNotIn(List values) { + addCriterion("report_id not in", values, "reportId"); return (Criteria) this; } - public Criteria andIdBetween(String value1, String value2) { - addCriterion("id between", value1, value2, "id"); + public Criteria andReportIdBetween(String value1, String value2) { + addCriterion("report_id between", value1, value2, "reportId"); return (Criteria) this; } - public Criteria andIdNotBetween(String value1, String value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdIsNull() { - addCriterion("environment_id is null"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdIsNotNull() { - addCriterion("environment_id is not null"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdEqualTo(String value) { - addCriterion("environment_id =", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdNotEqualTo(String value) { - addCriterion("environment_id <>", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdGreaterThan(String value) { - addCriterion("environment_id >", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdGreaterThanOrEqualTo(String value) { - addCriterion("environment_id >=", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdLessThan(String value) { - addCriterion("environment_id <", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdLessThanOrEqualTo(String value) { - addCriterion("environment_id <=", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdLike(String value) { - addCriterion("environment_id like", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdNotLike(String value) { - addCriterion("environment_id not like", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdIn(List values) { - addCriterion("environment_id in", values, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdNotIn(List values) { - addCriterion("environment_id not in", values, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdBetween(String value1, String value2) { - addCriterion("environment_id between", value1, value2, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdNotBetween(String value1, String value2) { - addCriterion("environment_id not between", value1, value2, "environmentId"); + public Criteria andReportIdNotBetween(String value1, String value2) { + addCriterion("report_id not between", value1, value2, "reportId"); return (Criteria) this; } } diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReport.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReport.java index 135f76007b..aa5b737d5f 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReport.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReport.java @@ -82,6 +82,9 @@ public class ApiScenarioReport implements Serializable { @Size(min = 1, max = 50, message = "{api_scenario_report.scenario_id.length_range}", groups = {Created.class, Updated.class}) private String scenarioId; + @Schema(description = "环境") + private String environmentId; + private static final long serialVersionUID = 1L; public enum Column { @@ -102,7 +105,8 @@ public class ApiScenarioReport implements Serializable { versionId("version_id", "versionId", "VARCHAR", false), integrated("integrated", "integrated", "BIT", false), projectId("project_id", "projectId", "VARCHAR", false), - scenarioId("scenario_id", "scenarioId", "VARCHAR", false); + scenarioId("scenario_id", "scenarioId", "VARCHAR", false), + environmentId("environment_id", "environmentId", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportDetail.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportDetail.java index 141f1e9d55..611ba9486a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportDetail.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportDetail.java @@ -46,9 +46,6 @@ public class ApiScenarioReportDetail implements Serializable { @Schema(description = "请求名称") private String requestName; - @Schema(description = "环境fk") - private String environmentId; - @Schema(description = "项目fk") private String projectId; @@ -74,7 +71,6 @@ public class ApiScenarioReportDetail implements Serializable { passAssertionsTotal("pass_assertions_total", "passAssertionsTotal", "BIGINT", false), fakeCode("fake_code", "fakeCode", "VARCHAR", false), requestName("request_name", "requestName", "VARCHAR", false), - environmentId("environment_id", "environmentId", "VARCHAR", false), projectId("project_id", "projectId", "VARCHAR", false), errorTotal("error_total", "errorTotal", "INTEGER", false), code("code", "code", "VARCHAR", false), diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportDetailExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportDetailExample.java index 41b562c2e1..17e8c10bc8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportDetailExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportDetailExample.java @@ -764,76 +764,6 @@ public class ApiScenarioReportDetailExample { return (Criteria) this; } - public Criteria andEnvironmentIdIsNull() { - addCriterion("environment_id is null"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdIsNotNull() { - addCriterion("environment_id is not null"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdEqualTo(String value) { - addCriterion("environment_id =", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdNotEqualTo(String value) { - addCriterion("environment_id <>", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdGreaterThan(String value) { - addCriterion("environment_id >", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdGreaterThanOrEqualTo(String value) { - addCriterion("environment_id >=", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdLessThan(String value) { - addCriterion("environment_id <", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdLessThanOrEqualTo(String value) { - addCriterion("environment_id <=", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdLike(String value) { - addCriterion("environment_id like", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdNotLike(String value) { - addCriterion("environment_id not like", value, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdIn(List values) { - addCriterion("environment_id in", values, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdNotIn(List values) { - addCriterion("environment_id not in", values, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdBetween(String value1, String value2) { - addCriterion("environment_id between", value1, value2, "environmentId"); - return (Criteria) this; - } - - public Criteria andEnvironmentIdNotBetween(String value1, String value2) { - addCriterion("environment_id not between", value1, value2, "environmentId"); - return (Criteria) this; - } - public Criteria andProjectIdIsNull() { addCriterion("project_id is null"); return (Criteria) this; diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportExample.java index 153eae79d7..36481c0b89 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportExample.java @@ -1303,6 +1303,76 @@ public class ApiScenarioReportExample { addCriterion("scenario_id not between", value1, value2, "scenarioId"); return (Criteria) this; } + + public Criteria andEnvironmentIdIsNull() { + addCriterion("environment_id is null"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIsNotNull() { + addCriterion("environment_id is not null"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdEqualTo(String value) { + addCriterion("environment_id =", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotEqualTo(String value) { + addCriterion("environment_id <>", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdGreaterThan(String value) { + addCriterion("environment_id >", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdGreaterThanOrEqualTo(String value) { + addCriterion("environment_id >=", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLessThan(String value) { + addCriterion("environment_id <", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLessThanOrEqualTo(String value) { + addCriterion("environment_id <=", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLike(String value) { + addCriterion("environment_id like", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotLike(String value) { + addCriterion("environment_id not like", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIn(List values) { + addCriterion("environment_id in", values, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotIn(List values) { + addCriterion("environment_id not in", values, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdBetween(String value1, String value2) { + addCriterion("environment_id between", value1, value2, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotBetween(String value1, String value2) { + addCriterion("environment_id not between", value1, value2, "environmentId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportStep.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportStep.java new file mode 100644 index 0000000000..05e2d2ef0e --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportStep.java @@ -0,0 +1,135 @@ +package io.metersphere.api.domain; + +import io.metersphere.validation.groups.*; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.*; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; + +@Data +public class ApiScenarioReportStep implements Serializable { + @Schema(description = "请求资源 id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_scenario_report_step.report_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{api_scenario_report_step.report_id.length_range}", groups = {Created.class, Updated.class}) + private String reportId; + + @Schema(description = "步骤名称") + private String name; + + @Schema(description = "序号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{api_scenario_report_step.sort.not_blank}", groups = {Created.class}) + private Long sort; + + @Schema(description = "启用/禁用") + private Boolean enable; + + @Schema(description = "资源id") + private Long resourceId; + + @Schema(description = "资源编号") + private String resourceNum; + + @Schema(description = "步骤类型/API/CASE等") + private String stepType; + + @Schema(description = "项目fk") + private String projectId; + + @Schema(description = "父级fk") + private String parentId; + + @Schema(description = "版本号") + private String versionId; + + @Schema(description = "引用/复制/自定义") + private String source; + + @Schema(description = "循环等组件基础数据") + private String config; + + private static final long serialVersionUID = 1L; + + public enum Column { + reportId("report_id", "reportId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + sort("sort", "sort", "BIGINT", false), + enable("enable", "enable", "BIT", true), + resourceId("resource_id", "resourceId", "BIGINT", false), + resourceNum("resource_num", "resourceNum", "VARCHAR", false), + stepType("step_type", "stepType", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + parentId("parent_id", "parentId", "VARCHAR", false), + versionId("version_id", "versionId", "VARCHAR", false), + source("source", "source", "VARCHAR", true), + config("config", "config", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportStepExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportStepExample.java new file mode 100644 index 0000000000..4a8e305e6f --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportStepExample.java @@ -0,0 +1,1010 @@ +package io.metersphere.api.domain; + +import java.util.ArrayList; +import java.util.List; + +public class ApiScenarioReportStepExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ApiScenarioReportStepExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andReportIdIsNull() { + addCriterion("report_id is null"); + return (Criteria) this; + } + + public Criteria andReportIdIsNotNull() { + addCriterion("report_id is not null"); + return (Criteria) this; + } + + public Criteria andReportIdEqualTo(String value) { + addCriterion("report_id =", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotEqualTo(String value) { + addCriterion("report_id <>", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThan(String value) { + addCriterion("report_id >", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdGreaterThanOrEqualTo(String value) { + addCriterion("report_id >=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThan(String value) { + addCriterion("report_id <", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLessThanOrEqualTo(String value) { + addCriterion("report_id <=", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdLike(String value) { + addCriterion("report_id like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotLike(String value) { + addCriterion("report_id not like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdIn(List values) { + addCriterion("report_id in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotIn(List values) { + addCriterion("report_id not in", values, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdBetween(String value1, String value2) { + addCriterion("report_id between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotBetween(String value1, String value2) { + addCriterion("report_id not between", value1, value2, "reportId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(Long value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(Long value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(Long value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(Long value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(Long value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(Long value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(Long value1, Long value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(Long value1, Long value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andEnableIsNull() { + addCriterion("`enable` is null"); + return (Criteria) this; + } + + public Criteria andEnableIsNotNull() { + addCriterion("`enable` is not null"); + return (Criteria) this; + } + + public Criteria andEnableEqualTo(Boolean value) { + addCriterion("`enable` =", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotEqualTo(Boolean value) { + addCriterion("`enable` <>", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThan(Boolean value) { + addCriterion("`enable` >", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThanOrEqualTo(Boolean value) { + addCriterion("`enable` >=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThan(Boolean value) { + addCriterion("`enable` <", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThanOrEqualTo(Boolean value) { + addCriterion("`enable` <=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableIn(List values) { + addCriterion("`enable` in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotIn(List values) { + addCriterion("`enable` not in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableBetween(Boolean value1, Boolean value2) { + addCriterion("`enable` between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotBetween(Boolean value1, Boolean value2) { + addCriterion("`enable` not between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andResourceIdIsNull() { + addCriterion("resource_id is null"); + return (Criteria) this; + } + + public Criteria andResourceIdIsNotNull() { + addCriterion("resource_id is not null"); + return (Criteria) this; + } + + public Criteria andResourceIdEqualTo(Long value) { + addCriterion("resource_id =", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotEqualTo(Long value) { + addCriterion("resource_id <>", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThan(Long value) { + addCriterion("resource_id >", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThanOrEqualTo(Long value) { + addCriterion("resource_id >=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThan(Long value) { + addCriterion("resource_id <", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThanOrEqualTo(Long value) { + addCriterion("resource_id <=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdIn(List values) { + addCriterion("resource_id in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotIn(List values) { + addCriterion("resource_id not in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdBetween(Long value1, Long value2) { + addCriterion("resource_id between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotBetween(Long value1, Long value2) { + addCriterion("resource_id not between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceNumIsNull() { + addCriterion("resource_num is null"); + return (Criteria) this; + } + + public Criteria andResourceNumIsNotNull() { + addCriterion("resource_num is not null"); + return (Criteria) this; + } + + public Criteria andResourceNumEqualTo(String value) { + addCriterion("resource_num =", value, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumNotEqualTo(String value) { + addCriterion("resource_num <>", value, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumGreaterThan(String value) { + addCriterion("resource_num >", value, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumGreaterThanOrEqualTo(String value) { + addCriterion("resource_num >=", value, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumLessThan(String value) { + addCriterion("resource_num <", value, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumLessThanOrEqualTo(String value) { + addCriterion("resource_num <=", value, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumLike(String value) { + addCriterion("resource_num like", value, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumNotLike(String value) { + addCriterion("resource_num not like", value, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumIn(List values) { + addCriterion("resource_num in", values, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumNotIn(List values) { + addCriterion("resource_num not in", values, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumBetween(String value1, String value2) { + addCriterion("resource_num between", value1, value2, "resourceNum"); + return (Criteria) this; + } + + public Criteria andResourceNumNotBetween(String value1, String value2) { + addCriterion("resource_num not between", value1, value2, "resourceNum"); + return (Criteria) this; + } + + public Criteria andStepTypeIsNull() { + addCriterion("step_type is null"); + return (Criteria) this; + } + + public Criteria andStepTypeIsNotNull() { + addCriterion("step_type is not null"); + return (Criteria) this; + } + + public Criteria andStepTypeEqualTo(String value) { + addCriterion("step_type =", value, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeNotEqualTo(String value) { + addCriterion("step_type <>", value, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeGreaterThan(String value) { + addCriterion("step_type >", value, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeGreaterThanOrEqualTo(String value) { + addCriterion("step_type >=", value, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeLessThan(String value) { + addCriterion("step_type <", value, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeLessThanOrEqualTo(String value) { + addCriterion("step_type <=", value, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeLike(String value) { + addCriterion("step_type like", value, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeNotLike(String value) { + addCriterion("step_type not like", value, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeIn(List values) { + addCriterion("step_type in", values, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeNotIn(List values) { + addCriterion("step_type not in", values, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeBetween(String value1, String value2) { + addCriterion("step_type between", value1, value2, "stepType"); + return (Criteria) this; + } + + public Criteria andStepTypeNotBetween(String value1, String value2) { + addCriterion("step_type not between", value1, value2, "stepType"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNull() { + addCriterion("project_id is null"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNotNull() { + addCriterion("project_id is not null"); + return (Criteria) this; + } + + public Criteria andProjectIdEqualTo(String value) { + addCriterion("project_id =", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotEqualTo(String value) { + addCriterion("project_id <>", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThan(String value) { + addCriterion("project_id >", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThanOrEqualTo(String value) { + addCriterion("project_id >=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThan(String value) { + addCriterion("project_id <", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThanOrEqualTo(String value) { + addCriterion("project_id <=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLike(String value) { + addCriterion("project_id like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotLike(String value) { + addCriterion("project_id not like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdIn(List values) { + addCriterion("project_id in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotIn(List values) { + addCriterion("project_id not in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdBetween(String value1, String value2) { + addCriterion("project_id between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotBetween(String value1, String value2) { + addCriterion("project_id not between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(String value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(String value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(String value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(String value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(String value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(String value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLike(String value) { + addCriterion("parent_id like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotLike(String value) { + addCriterion("parent_id not like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(String value1, String value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(String value1, String value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andVersionIdIsNull() { + addCriterion("version_id is null"); + return (Criteria) this; + } + + public Criteria andVersionIdIsNotNull() { + addCriterion("version_id is not null"); + return (Criteria) this; + } + + public Criteria andVersionIdEqualTo(String value) { + addCriterion("version_id =", value, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdNotEqualTo(String value) { + addCriterion("version_id <>", value, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdGreaterThan(String value) { + addCriterion("version_id >", value, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdGreaterThanOrEqualTo(String value) { + addCriterion("version_id >=", value, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdLessThan(String value) { + addCriterion("version_id <", value, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdLessThanOrEqualTo(String value) { + addCriterion("version_id <=", value, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdLike(String value) { + addCriterion("version_id like", value, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdNotLike(String value) { + addCriterion("version_id not like", value, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdIn(List values) { + addCriterion("version_id in", values, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdNotIn(List values) { + addCriterion("version_id not in", values, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdBetween(String value1, String value2) { + addCriterion("version_id between", value1, value2, "versionId"); + return (Criteria) this; + } + + public Criteria andVersionIdNotBetween(String value1, String value2) { + addCriterion("version_id not between", value1, value2, "versionId"); + return (Criteria) this; + } + + public Criteria andSourceIsNull() { + addCriterion("`source` is null"); + return (Criteria) this; + } + + public Criteria andSourceIsNotNull() { + addCriterion("`source` is not null"); + return (Criteria) this; + } + + public Criteria andSourceEqualTo(String value) { + addCriterion("`source` =", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotEqualTo(String value) { + addCriterion("`source` <>", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThan(String value) { + addCriterion("`source` >", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThanOrEqualTo(String value) { + addCriterion("`source` >=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThan(String value) { + addCriterion("`source` <", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThanOrEqualTo(String value) { + addCriterion("`source` <=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLike(String value) { + addCriterion("`source` like", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotLike(String value) { + addCriterion("`source` not like", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceIn(List values) { + addCriterion("`source` in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotIn(List values) { + addCriterion("`source` not in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceBetween(String value1, String value2) { + addCriterion("`source` between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotBetween(String value1, String value2) { + addCriterion("`source` not between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andConfigIsNull() { + addCriterion("config is null"); + return (Criteria) this; + } + + public Criteria andConfigIsNotNull() { + addCriterion("config is not null"); + return (Criteria) this; + } + + public Criteria andConfigEqualTo(String value) { + addCriterion("config =", value, "config"); + return (Criteria) this; + } + + public Criteria andConfigNotEqualTo(String value) { + addCriterion("config <>", value, "config"); + return (Criteria) this; + } + + public Criteria andConfigGreaterThan(String value) { + addCriterion("config >", value, "config"); + return (Criteria) this; + } + + public Criteria andConfigGreaterThanOrEqualTo(String value) { + addCriterion("config >=", value, "config"); + return (Criteria) this; + } + + public Criteria andConfigLessThan(String value) { + addCriterion("config <", value, "config"); + return (Criteria) this; + } + + public Criteria andConfigLessThanOrEqualTo(String value) { + addCriterion("config <=", value, "config"); + return (Criteria) this; + } + + public Criteria andConfigLike(String value) { + addCriterion("config like", value, "config"); + return (Criteria) this; + } + + public Criteria andConfigNotLike(String value) { + addCriterion("config not like", value, "config"); + return (Criteria) this; + } + + public Criteria andConfigIn(List values) { + addCriterion("config in", values, "config"); + return (Criteria) this; + } + + public Criteria andConfigNotIn(List values) { + addCriterion("config not in", values, "config"); + return (Criteria) this; + } + + public Criteria andConfigBetween(String value1, String value2) { + addCriterion("config between", value1, value2, "config"); + return (Criteria) this; + } + + public Criteria andConfigNotBetween(String value1, String value2) { + addCriterion("config not between", value1, value2, "config"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportBlobMapper.java deleted file mode 100644 index 210b9389e8..0000000000 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportBlobMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package io.metersphere.api.mapper; - -import io.metersphere.api.domain.ApiReportBlob; -import io.metersphere.api.domain.ApiReportBlobExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface ApiReportBlobMapper { - long countByExample(ApiReportBlobExample example); - - int deleteByExample(ApiReportBlobExample example); - - int deleteByPrimaryKey(String id); - - int insert(ApiReportBlob record); - - int insertSelective(ApiReportBlob record); - - List selectByExampleWithBLOBs(ApiReportBlobExample example); - - List selectByExample(ApiReportBlobExample example); - - ApiReportBlob selectByPrimaryKey(String id); - - int updateByExampleSelective(@Param("record") ApiReportBlob record, @Param("example") ApiReportBlobExample example); - - int updateByExampleWithBLOBs(@Param("record") ApiReportBlob record, @Param("example") ApiReportBlobExample example); - - int updateByExample(@Param("record") ApiReportBlob record, @Param("example") ApiReportBlobExample example); - - int updateByPrimaryKeySelective(ApiReportBlob record); - - int updateByPrimaryKeyWithBLOBs(ApiReportBlob record); - - int updateByPrimaryKey(ApiReportBlob record); - - int batchInsert(@Param("list") List list); - - int batchInsertSelective(@Param("list") List list, @Param("selective") ApiReportBlob.Column ... selective); -} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportDetailMapper.java b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportDetailMapper.java new file mode 100644 index 0000000000..b482c4567d --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportDetailMapper.java @@ -0,0 +1,40 @@ +package io.metersphere.api.mapper; + +import io.metersphere.api.domain.ApiReportDetail; +import io.metersphere.api.domain.ApiReportDetailExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ApiReportDetailMapper { + long countByExample(ApiReportDetailExample example); + + int deleteByExample(ApiReportDetailExample example); + + int deleteByPrimaryKey(String id); + + int insert(ApiReportDetail record); + + int insertSelective(ApiReportDetail record); + + List selectByExampleWithBLOBs(ApiReportDetailExample example); + + List selectByExample(ApiReportDetailExample example); + + ApiReportDetail selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") ApiReportDetail record, @Param("example") ApiReportDetailExample example); + + int updateByExampleWithBLOBs(@Param("record") ApiReportDetail record, @Param("example") ApiReportDetailExample example); + + int updateByExample(@Param("record") ApiReportDetail record, @Param("example") ApiReportDetailExample example); + + int updateByPrimaryKeySelective(ApiReportDetail record); + + int updateByPrimaryKeyWithBLOBs(ApiReportDetail record); + + int updateByPrimaryKey(ApiReportDetail record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ApiReportDetail.Column ... selective); +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportDetailMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportDetailMapper.xml new file mode 100644 index 0000000000..00f8c7e850 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportDetailMapper.xml @@ -0,0 +1,482 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, report_id, resource_id, start_time, `status`, request_time, assertions_total, + pass_assertions_total, fake_code, request_name, project_id, error_total, code + + + content + + + + + + delete from api_report_detail + where id = #{id,jdbcType=VARCHAR} + + + delete from api_report_detail + + + + + + insert into api_report_detail (id, report_id, resource_id, + start_time, `status`, request_time, + assertions_total, pass_assertions_total, fake_code, + request_name, project_id, error_total, + code, content) + values (#{id,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR}, + #{startTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR}, #{requestTime,jdbcType=BIGINT}, + #{assertionsTotal,jdbcType=BIGINT}, #{passAssertionsTotal,jdbcType=BIGINT}, #{fakeCode,jdbcType=VARCHAR}, + #{requestName,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{errorTotal,jdbcType=INTEGER}, + #{code,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARBINARY}) + + + insert into api_report_detail + + + id, + + + report_id, + + + resource_id, + + + start_time, + + + `status`, + + + request_time, + + + assertions_total, + + + pass_assertions_total, + + + fake_code, + + + request_name, + + + project_id, + + + error_total, + + + code, + + + content, + + + + + #{id,jdbcType=VARCHAR}, + + + #{reportId,jdbcType=VARCHAR}, + + + #{resourceId,jdbcType=VARCHAR}, + + + #{startTime,jdbcType=BIGINT}, + + + #{status,jdbcType=VARCHAR}, + + + #{requestTime,jdbcType=BIGINT}, + + + #{assertionsTotal,jdbcType=BIGINT}, + + + #{passAssertionsTotal,jdbcType=BIGINT}, + + + #{fakeCode,jdbcType=VARCHAR}, + + + #{requestName,jdbcType=VARCHAR}, + + + #{projectId,jdbcType=VARCHAR}, + + + #{errorTotal,jdbcType=INTEGER}, + + + #{code,jdbcType=VARCHAR}, + + + #{content,jdbcType=LONGVARBINARY}, + + + + + + update api_report_detail + + + id = #{record.id,jdbcType=VARCHAR}, + + + report_id = #{record.reportId,jdbcType=VARCHAR}, + + + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + + + start_time = #{record.startTime,jdbcType=BIGINT}, + + + `status` = #{record.status,jdbcType=VARCHAR}, + + + request_time = #{record.requestTime,jdbcType=BIGINT}, + + + assertions_total = #{record.assertionsTotal,jdbcType=BIGINT}, + + + pass_assertions_total = #{record.passAssertionsTotal,jdbcType=BIGINT}, + + + fake_code = #{record.fakeCode,jdbcType=VARCHAR}, + + + request_name = #{record.requestName,jdbcType=VARCHAR}, + + + project_id = #{record.projectId,jdbcType=VARCHAR}, + + + error_total = #{record.errorTotal,jdbcType=INTEGER}, + + + code = #{record.code,jdbcType=VARCHAR}, + + + content = #{record.content,jdbcType=LONGVARBINARY}, + + + + + + + + update api_report_detail + set id = #{record.id,jdbcType=VARCHAR}, + report_id = #{record.reportId,jdbcType=VARCHAR}, + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + `status` = #{record.status,jdbcType=VARCHAR}, + request_time = #{record.requestTime,jdbcType=BIGINT}, + assertions_total = #{record.assertionsTotal,jdbcType=BIGINT}, + pass_assertions_total = #{record.passAssertionsTotal,jdbcType=BIGINT}, + fake_code = #{record.fakeCode,jdbcType=VARCHAR}, + request_name = #{record.requestName,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + error_total = #{record.errorTotal,jdbcType=INTEGER}, + code = #{record.code,jdbcType=VARCHAR}, + content = #{record.content,jdbcType=LONGVARBINARY} + + + + + + update api_report_detail + set id = #{record.id,jdbcType=VARCHAR}, + report_id = #{record.reportId,jdbcType=VARCHAR}, + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + `status` = #{record.status,jdbcType=VARCHAR}, + request_time = #{record.requestTime,jdbcType=BIGINT}, + assertions_total = #{record.assertionsTotal,jdbcType=BIGINT}, + pass_assertions_total = #{record.passAssertionsTotal,jdbcType=BIGINT}, + fake_code = #{record.fakeCode,jdbcType=VARCHAR}, + request_name = #{record.requestName,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + error_total = #{record.errorTotal,jdbcType=INTEGER}, + code = #{record.code,jdbcType=VARCHAR} + + + + + + update api_report_detail + + + report_id = #{reportId,jdbcType=VARCHAR}, + + + resource_id = #{resourceId,jdbcType=VARCHAR}, + + + start_time = #{startTime,jdbcType=BIGINT}, + + + `status` = #{status,jdbcType=VARCHAR}, + + + request_time = #{requestTime,jdbcType=BIGINT}, + + + assertions_total = #{assertionsTotal,jdbcType=BIGINT}, + + + pass_assertions_total = #{passAssertionsTotal,jdbcType=BIGINT}, + + + fake_code = #{fakeCode,jdbcType=VARCHAR}, + + + request_name = #{requestName,jdbcType=VARCHAR}, + + + project_id = #{projectId,jdbcType=VARCHAR}, + + + error_total = #{errorTotal,jdbcType=INTEGER}, + + + code = #{code,jdbcType=VARCHAR}, + + + content = #{content,jdbcType=LONGVARBINARY}, + + + where id = #{id,jdbcType=VARCHAR} + + + update api_report_detail + set report_id = #{reportId,jdbcType=VARCHAR}, + resource_id = #{resourceId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + `status` = #{status,jdbcType=VARCHAR}, + request_time = #{requestTime,jdbcType=BIGINT}, + assertions_total = #{assertionsTotal,jdbcType=BIGINT}, + pass_assertions_total = #{passAssertionsTotal,jdbcType=BIGINT}, + fake_code = #{fakeCode,jdbcType=VARCHAR}, + request_name = #{requestName,jdbcType=VARCHAR}, + project_id = #{projectId,jdbcType=VARCHAR}, + error_total = #{errorTotal,jdbcType=INTEGER}, + code = #{code,jdbcType=VARCHAR}, + content = #{content,jdbcType=LONGVARBINARY} + where id = #{id,jdbcType=VARCHAR} + + + update api_report_detail + set report_id = #{reportId,jdbcType=VARCHAR}, + resource_id = #{resourceId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + `status` = #{status,jdbcType=VARCHAR}, + request_time = #{requestTime,jdbcType=BIGINT}, + assertions_total = #{assertionsTotal,jdbcType=BIGINT}, + pass_assertions_total = #{passAssertionsTotal,jdbcType=BIGINT}, + fake_code = #{fakeCode,jdbcType=VARCHAR}, + request_name = #{requestName,jdbcType=VARCHAR}, + project_id = #{projectId,jdbcType=VARCHAR}, + error_total = #{errorTotal,jdbcType=INTEGER}, + code = #{code,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + insert into api_report_detail + (id, report_id, resource_id, start_time, `status`, request_time, assertions_total, + pass_assertions_total, fake_code, request_name, project_id, error_total, code, + content) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.reportId,jdbcType=VARCHAR}, #{item.resourceId,jdbcType=VARCHAR}, + #{item.startTime,jdbcType=BIGINT}, #{item.status,jdbcType=VARCHAR}, #{item.requestTime,jdbcType=BIGINT}, + #{item.assertionsTotal,jdbcType=BIGINT}, #{item.passAssertionsTotal,jdbcType=BIGINT}, + #{item.fakeCode,jdbcType=VARCHAR}, #{item.requestName,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, + #{item.errorTotal,jdbcType=INTEGER}, #{item.code,jdbcType=VARCHAR}, #{item.content,jdbcType=LONGVARBINARY} + ) + + + + insert into api_report_detail ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.resourceId,jdbcType=VARCHAR} + + + #{item.startTime,jdbcType=BIGINT} + + + #{item.status,jdbcType=VARCHAR} + + + #{item.requestTime,jdbcType=BIGINT} + + + #{item.assertionsTotal,jdbcType=BIGINT} + + + #{item.passAssertionsTotal,jdbcType=BIGINT} + + + #{item.fakeCode,jdbcType=VARCHAR} + + + #{item.requestName,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.errorTotal,jdbcType=INTEGER} + + + #{item.code,jdbcType=VARCHAR} + + + #{item.content,jdbcType=LONGVARBINARY} + + + ) + + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportLogMapper.java b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportLogMapper.java new file mode 100644 index 0000000000..ae6c85fbbb --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportLogMapper.java @@ -0,0 +1,38 @@ +package io.metersphere.api.mapper; + +import io.metersphere.api.domain.ApiReportLog; +import io.metersphere.api.domain.ApiReportLogExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ApiReportLogMapper { + long countByExample(ApiReportLogExample example); + + int deleteByExample(ApiReportLogExample example); + + int deleteByPrimaryKey(String reportId); + + int insert(ApiReportLog record); + + int insertSelective(ApiReportLog record); + + List selectByExampleWithBLOBs(ApiReportLogExample example); + + List selectByExample(ApiReportLogExample example); + + ApiReportLog selectByPrimaryKey(String reportId); + + int updateByExampleSelective(@Param("record") ApiReportLog record, @Param("example") ApiReportLogExample example); + + int updateByExampleWithBLOBs(@Param("record") ApiReportLog record, @Param("example") ApiReportLogExample example); + + int updateByExample(@Param("record") ApiReportLog record, @Param("example") ApiReportLogExample example); + + int updateByPrimaryKeySelective(ApiReportLog record); + + int updateByPrimaryKeyWithBLOBs(ApiReportLog record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ApiReportLog.Column ... selective); +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportLogMapper.xml similarity index 62% rename from backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportBlobMapper.xml rename to backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportLogMapper.xml index abb4f4c868..1869f4183a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportBlobMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportLogMapper.xml @@ -1,12 +1,10 @@ - - - - + + + - - + @@ -68,12 +66,12 @@ - id, environment_id + report_id - content, console + console - select distinct @@ -81,7 +79,7 @@ , - from api_report_blob + from api_report_log @@ -89,13 +87,13 @@ order by ${orderByClause} - select distinct - from api_report_blob + from api_report_log @@ -108,73 +106,53 @@ , - from api_report_blob - where id = #{id,jdbcType=VARCHAR} + from api_report_log + where report_id = #{reportId,jdbcType=VARCHAR} - delete from api_report_blob - where id = #{id,jdbcType=VARCHAR} + delete from api_report_log + where report_id = #{reportId,jdbcType=VARCHAR} - - delete from api_report_blob + + delete from api_report_log - - insert into api_report_blob (id, environment_id, content, - console) - values (#{id,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARBINARY}, - #{console,jdbcType=LONGVARBINARY}) + + insert into api_report_log (report_id, console) + values (#{reportId,jdbcType=VARCHAR}, #{console,jdbcType=LONGVARBINARY}) - - insert into api_report_blob + + insert into api_report_log - - id, - - - environment_id, - - - content, + + report_id, console, - - #{id,jdbcType=VARCHAR}, - - - #{environmentId,jdbcType=VARCHAR}, - - - #{content,jdbcType=LONGVARBINARY}, + + #{reportId,jdbcType=VARCHAR}, #{console,jdbcType=LONGVARBINARY}, - + select count(*) from api_report_log - update api_report_blob + update api_report_log - - id = #{record.id,jdbcType=VARCHAR}, - - - environment_id = #{record.environmentId,jdbcType=VARCHAR}, - - - content = #{record.content,jdbcType=LONGVARBINARY}, + + report_id = #{record.reportId,jdbcType=VARCHAR}, console = #{record.console,jdbcType=LONGVARBINARY}, @@ -185,61 +163,44 @@ - update api_report_blob - set id = #{record.id,jdbcType=VARCHAR}, - environment_id = #{record.environmentId,jdbcType=VARCHAR}, - content = #{record.content,jdbcType=LONGVARBINARY}, + update api_report_log + set report_id = #{record.reportId,jdbcType=VARCHAR}, console = #{record.console,jdbcType=LONGVARBINARY} - update api_report_blob - set id = #{record.id,jdbcType=VARCHAR}, - environment_id = #{record.environmentId,jdbcType=VARCHAR} + update api_report_log + set report_id = #{record.reportId,jdbcType=VARCHAR} - - update api_report_blob + + update api_report_log - - environment_id = #{environmentId,jdbcType=VARCHAR}, - - - content = #{content,jdbcType=LONGVARBINARY}, - console = #{console,jdbcType=LONGVARBINARY}, - where id = #{id,jdbcType=VARCHAR} + where report_id = #{reportId,jdbcType=VARCHAR} - - update api_report_blob - set environment_id = #{environmentId,jdbcType=VARCHAR}, - content = #{content,jdbcType=LONGVARBINARY}, - console = #{console,jdbcType=LONGVARBINARY} - where id = #{id,jdbcType=VARCHAR} - - - update api_report_blob - set environment_id = #{environmentId,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} + + update api_report_log + set console = #{console,jdbcType=LONGVARBINARY} + where report_id = #{reportId,jdbcType=VARCHAR} - insert into api_report_blob - (id, environment_id, content, console) + insert into api_report_log + (report_id, console) values - (#{item.id,jdbcType=VARCHAR}, #{item.environmentId,jdbcType=VARCHAR}, #{item.content,jdbcType=LONGVARBINARY}, - #{item.console,jdbcType=LONGVARBINARY}) + (#{item.reportId,jdbcType=VARCHAR}, #{item.console,jdbcType=LONGVARBINARY}) - insert into api_report_blob ( + insert into api_report_log ( ${column.escapedColumnName} @@ -248,14 +209,8 @@ ( - - #{item.id,jdbcType=VARCHAR} - - - #{item.environmentId,jdbcType=VARCHAR} - - - #{item.content,jdbcType=LONGVARBINARY} + + #{item.reportId,jdbcType=VARCHAR} #{item.console,jdbcType=LONGVARBINARY} diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportMapper.xml index 7a92ce1608..7edd68e430 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportMapper.xml @@ -11,15 +11,13 @@ - - - + @@ -81,8 +79,7 @@ id, `name`, resource_id, create_time, update_time, create_user, update_user, deleted, - `status`, start_time, end_time, run_mode, pool_id, trigger_mode, version_id, project_id, - integrated_report_id, integrated + `status`, run_mode, pool_id, trigger_mode, version_id, project_id, integrated, environment_id @@ -281,12 +264,6 @@ `status` = #{record.status,jdbcType=VARCHAR}, - - start_time = #{record.startTime,jdbcType=BIGINT}, - - - end_time = #{record.endTime,jdbcType=BIGINT}, - run_mode = #{record.runMode,jdbcType=VARCHAR}, @@ -302,12 +279,12 @@ project_id = #{record.projectId,jdbcType=VARCHAR}, - - integrated_report_id = #{record.integratedReportId,jdbcType=VARCHAR}, - integrated = #{record.integrated,jdbcType=BIT}, + + environment_id = #{record.environmentId,jdbcType=VARCHAR}, + @@ -324,15 +301,13 @@ update_user = #{record.updateUser,jdbcType=VARCHAR}, deleted = #{record.deleted,jdbcType=BIT}, `status` = #{record.status,jdbcType=VARCHAR}, - start_time = #{record.startTime,jdbcType=BIGINT}, - end_time = #{record.endTime,jdbcType=BIGINT}, run_mode = #{record.runMode,jdbcType=VARCHAR}, pool_id = #{record.poolId,jdbcType=VARCHAR}, trigger_mode = #{record.triggerMode,jdbcType=VARCHAR}, version_id = #{record.versionId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, - integrated_report_id = #{record.integratedReportId,jdbcType=VARCHAR}, - integrated = #{record.integrated,jdbcType=BIT} + integrated = #{record.integrated,jdbcType=BIT}, + environment_id = #{record.environmentId,jdbcType=VARCHAR} @@ -364,12 +339,6 @@ `status` = #{status,jdbcType=VARCHAR}, - - start_time = #{startTime,jdbcType=BIGINT}, - - - end_time = #{endTime,jdbcType=BIGINT}, - run_mode = #{runMode,jdbcType=VARCHAR}, @@ -385,12 +354,12 @@ project_id = #{projectId,jdbcType=VARCHAR}, - - integrated_report_id = #{integratedReportId,jdbcType=VARCHAR}, - integrated = #{integrated,jdbcType=BIT}, + + environment_id = #{environmentId,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} @@ -404,31 +373,28 @@ update_user = #{updateUser,jdbcType=VARCHAR}, deleted = #{deleted,jdbcType=BIT}, `status` = #{status,jdbcType=VARCHAR}, - start_time = #{startTime,jdbcType=BIGINT}, - end_time = #{endTime,jdbcType=BIGINT}, run_mode = #{runMode,jdbcType=VARCHAR}, pool_id = #{poolId,jdbcType=VARCHAR}, trigger_mode = #{triggerMode,jdbcType=VARCHAR}, version_id = #{versionId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR}, - integrated_report_id = #{integratedReportId,jdbcType=VARCHAR}, - integrated = #{integrated,jdbcType=BIT} + integrated = #{integrated,jdbcType=BIT}, + environment_id = #{environmentId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} insert into api_report (id, `name`, resource_id, create_time, update_time, create_user, update_user, deleted, - `status`, start_time, end_time, run_mode, pool_id, trigger_mode, version_id, project_id, - integrated_report_id, integrated) + `status`, run_mode, pool_id, trigger_mode, version_id, project_id, integrated, + environment_id) values (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.resourceId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, #{item.updateUser,jdbcType=VARCHAR}, #{item.deleted,jdbcType=BIT}, #{item.status,jdbcType=VARCHAR}, - #{item.startTime,jdbcType=BIGINT}, #{item.endTime,jdbcType=BIGINT}, #{item.runMode,jdbcType=VARCHAR}, - #{item.poolId,jdbcType=VARCHAR}, #{item.triggerMode,jdbcType=VARCHAR}, #{item.versionId,jdbcType=VARCHAR}, - #{item.projectId,jdbcType=VARCHAR}, #{item.integratedReportId,jdbcType=VARCHAR}, - #{item.integrated,jdbcType=BIT}) + #{item.runMode,jdbcType=VARCHAR}, #{item.poolId,jdbcType=VARCHAR}, #{item.triggerMode,jdbcType=VARCHAR}, + #{item.versionId,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.integrated,jdbcType=BIT}, + #{item.environmentId,jdbcType=VARCHAR}) @@ -468,12 +434,6 @@ #{item.status,jdbcType=VARCHAR} - - #{item.startTime,jdbcType=BIGINT} - - - #{item.endTime,jdbcType=BIGINT} - #{item.runMode,jdbcType=VARCHAR} @@ -489,12 +449,12 @@ #{item.projectId,jdbcType=VARCHAR} - - #{item.integratedReportId,jdbcType=VARCHAR} - #{item.integrated,jdbcType=BIT} + + #{item.environmentId,jdbcType=VARCHAR} + ) diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportDetailMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportDetailMapper.xml index 4c99fa0a28..3de4e4c10b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportDetailMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportDetailMapper.xml @@ -12,7 +12,6 @@ - @@ -80,8 +79,7 @@ id, report_id, resource_id, start_time, `status`, request_time, assertions_total, - pass_assertions_total, fake_code, request_name, environment_id, project_id, error_total, - code + pass_assertions_total, fake_code, request_name, project_id, error_total, code content @@ -138,15 +136,13 @@ insert into api_scenario_report_detail (id, report_id, resource_id, start_time, `status`, request_time, assertions_total, pass_assertions_total, fake_code, - request_name, environment_id, project_id, - error_total, code, content - ) + request_name, project_id, error_total, + code, content) values (#{id,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR}, #{requestTime,jdbcType=BIGINT}, #{assertionsTotal,jdbcType=BIGINT}, #{passAssertionsTotal,jdbcType=BIGINT}, #{fakeCode,jdbcType=VARCHAR}, - #{requestName,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, - #{errorTotal,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARBINARY} - ) + #{requestName,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{errorTotal,jdbcType=INTEGER}, + #{code,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARBINARY}) insert into api_scenario_report_detail @@ -181,9 +177,6 @@ request_name, - - environment_id, - project_id, @@ -228,9 +221,6 @@ #{requestName,jdbcType=VARCHAR}, - - #{environmentId,jdbcType=VARCHAR}, - #{projectId,jdbcType=VARCHAR}, @@ -284,9 +274,6 @@ request_name = #{record.requestName,jdbcType=VARCHAR}, - - environment_id = #{record.environmentId,jdbcType=VARCHAR}, - project_id = #{record.projectId,jdbcType=VARCHAR}, @@ -316,7 +303,6 @@ pass_assertions_total = #{record.passAssertionsTotal,jdbcType=BIGINT}, fake_code = #{record.fakeCode,jdbcType=VARCHAR}, request_name = #{record.requestName,jdbcType=VARCHAR}, - environment_id = #{record.environmentId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, error_total = #{record.errorTotal,jdbcType=INTEGER}, code = #{record.code,jdbcType=VARCHAR}, @@ -337,7 +323,6 @@ pass_assertions_total = #{record.passAssertionsTotal,jdbcType=BIGINT}, fake_code = #{record.fakeCode,jdbcType=VARCHAR}, request_name = #{record.requestName,jdbcType=VARCHAR}, - environment_id = #{record.environmentId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, error_total = #{record.errorTotal,jdbcType=INTEGER}, code = #{record.code,jdbcType=VARCHAR} @@ -375,9 +360,6 @@ request_name = #{requestName,jdbcType=VARCHAR}, - - environment_id = #{environmentId,jdbcType=VARCHAR}, - project_id = #{projectId,jdbcType=VARCHAR}, @@ -404,7 +386,6 @@ pass_assertions_total = #{passAssertionsTotal,jdbcType=BIGINT}, fake_code = #{fakeCode,jdbcType=VARCHAR}, request_name = #{requestName,jdbcType=VARCHAR}, - environment_id = #{environmentId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR}, error_total = #{errorTotal,jdbcType=INTEGER}, code = #{code,jdbcType=VARCHAR}, @@ -422,7 +403,6 @@ pass_assertions_total = #{passAssertionsTotal,jdbcType=BIGINT}, fake_code = #{fakeCode,jdbcType=VARCHAR}, request_name = #{requestName,jdbcType=VARCHAR}, - environment_id = #{environmentId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR}, error_total = #{errorTotal,jdbcType=INTEGER}, code = #{code,jdbcType=VARCHAR} @@ -431,16 +411,16 @@ insert into api_scenario_report_detail (id, report_id, resource_id, start_time, `status`, request_time, assertions_total, - pass_assertions_total, fake_code, request_name, environment_id, project_id, error_total, - code, content) + pass_assertions_total, fake_code, request_name, project_id, error_total, code, + content) values (#{item.id,jdbcType=VARCHAR}, #{item.reportId,jdbcType=VARCHAR}, #{item.resourceId,jdbcType=VARCHAR}, #{item.startTime,jdbcType=BIGINT}, #{item.status,jdbcType=VARCHAR}, #{item.requestTime,jdbcType=BIGINT}, #{item.assertionsTotal,jdbcType=BIGINT}, #{item.passAssertionsTotal,jdbcType=BIGINT}, - #{item.fakeCode,jdbcType=VARCHAR}, #{item.requestName,jdbcType=VARCHAR}, #{item.environmentId,jdbcType=VARCHAR}, - #{item.projectId,jdbcType=VARCHAR}, #{item.errorTotal,jdbcType=INTEGER}, #{item.code,jdbcType=VARCHAR}, - #{item.content,jdbcType=LONGVARBINARY}) + #{item.fakeCode,jdbcType=VARCHAR}, #{item.requestName,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, + #{item.errorTotal,jdbcType=INTEGER}, #{item.code,jdbcType=VARCHAR}, #{item.content,jdbcType=LONGVARBINARY} + ) @@ -483,9 +463,6 @@ #{item.requestName,jdbcType=VARCHAR} - - #{item.environmentId,jdbcType=VARCHAR} - #{item.projectId,jdbcType=VARCHAR} diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportMapper.xml index 239914b81d..19359f8493 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportMapper.xml @@ -20,6 +20,7 @@ + @@ -82,7 +83,7 @@ id, `name`, create_time, create_user, delete_time, delete_user, deleted, update_user, update_time, pass_rate, `status`, trigger_mode, run_mode, pool_id, version_id, integrated, - project_id, scenario_id + project_id, scenario_id, environment_id @@ -308,6 +315,9 @@ scenario_id = #{record.scenarioId,jdbcType=VARCHAR}, + + environment_id = #{record.environmentId,jdbcType=VARCHAR}, + @@ -332,7 +342,8 @@ version_id = #{record.versionId,jdbcType=VARCHAR}, integrated = #{record.integrated,jdbcType=BIT}, project_id = #{record.projectId,jdbcType=VARCHAR}, - scenario_id = #{record.scenarioId,jdbcType=VARCHAR} + scenario_id = #{record.scenarioId,jdbcType=VARCHAR}, + environment_id = #{record.environmentId,jdbcType=VARCHAR} @@ -391,6 +402,9 @@ scenario_id = #{scenarioId,jdbcType=VARCHAR}, + + environment_id = #{environmentId,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} @@ -412,14 +426,15 @@ version_id = #{versionId,jdbcType=VARCHAR}, integrated = #{integrated,jdbcType=BIT}, project_id = #{projectId,jdbcType=VARCHAR}, - scenario_id = #{scenarioId,jdbcType=VARCHAR} + scenario_id = #{scenarioId,jdbcType=VARCHAR}, + environment_id = #{environmentId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} insert into api_scenario_report (id, `name`, create_time, create_user, delete_time, delete_user, deleted, update_user, update_time, pass_rate, `status`, trigger_mode, run_mode, pool_id, version_id, - integrated, project_id, scenario_id) + integrated, project_id, scenario_id, environment_id) values (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, @@ -427,8 +442,8 @@ #{item.deleted,jdbcType=BIT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=BIGINT}, #{item.passRate,jdbcType=BIGINT}, #{item.status,jdbcType=VARCHAR}, #{item.triggerMode,jdbcType=VARCHAR}, #{item.runMode,jdbcType=VARCHAR}, #{item.poolId,jdbcType=VARCHAR}, #{item.versionId,jdbcType=VARCHAR}, - #{item.integrated,jdbcType=BIT}, #{item.projectId,jdbcType=VARCHAR}, #{item.scenarioId,jdbcType=VARCHAR} - ) + #{item.integrated,jdbcType=BIT}, #{item.projectId,jdbcType=VARCHAR}, #{item.scenarioId,jdbcType=VARCHAR}, + #{item.environmentId,jdbcType=VARCHAR}) @@ -495,6 +510,9 @@ #{item.scenarioId,jdbcType=VARCHAR} + + #{item.environmentId,jdbcType=VARCHAR} + ) diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportStepMapper.java b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportStepMapper.java new file mode 100644 index 0000000000..f8a7f8f787 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportStepMapper.java @@ -0,0 +1,34 @@ +package io.metersphere.api.mapper; + +import io.metersphere.api.domain.ApiScenarioReportStep; +import io.metersphere.api.domain.ApiScenarioReportStepExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ApiScenarioReportStepMapper { + long countByExample(ApiScenarioReportStepExample example); + + int deleteByExample(ApiScenarioReportStepExample example); + + int deleteByPrimaryKey(String reportId); + + int insert(ApiScenarioReportStep record); + + int insertSelective(ApiScenarioReportStep record); + + List selectByExample(ApiScenarioReportStepExample example); + + ApiScenarioReportStep selectByPrimaryKey(String reportId); + + int updateByExampleSelective(@Param("record") ApiScenarioReportStep record, @Param("example") ApiScenarioReportStepExample example); + + int updateByExample(@Param("record") ApiScenarioReportStep record, @Param("example") ApiScenarioReportStepExample example); + + int updateByPrimaryKeySelective(ApiScenarioReportStep record); + + int updateByPrimaryKey(ApiScenarioReportStep record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ApiScenarioReportStep.Column ... selective); +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportStepMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportStepMapper.xml new file mode 100644 index 0000000000..35280d1b49 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportStepMapper.xml @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + report_id, `name`, sort, `enable`, resource_id, resource_num, step_type, project_id, + parent_id, version_id, `source`, config + + + + + delete from api_scenario_report_step + where report_id = #{reportId,jdbcType=VARCHAR} + + + delete from api_scenario_report_step + + + + + + insert into api_scenario_report_step (report_id, `name`, sort, + `enable`, resource_id, resource_num, + step_type, project_id, parent_id, + version_id, `source`, config + ) + values (#{reportId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sort,jdbcType=BIGINT}, + #{enable,jdbcType=BIT}, #{resourceId,jdbcType=BIGINT}, #{resourceNum,jdbcType=VARCHAR}, + #{stepType,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, + #{versionId,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{config,jdbcType=VARCHAR} + ) + + + insert into api_scenario_report_step + + + report_id, + + + `name`, + + + sort, + + + `enable`, + + + resource_id, + + + resource_num, + + + step_type, + + + project_id, + + + parent_id, + + + version_id, + + + `source`, + + + config, + + + + + #{reportId,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{sort,jdbcType=BIGINT}, + + + #{enable,jdbcType=BIT}, + + + #{resourceId,jdbcType=BIGINT}, + + + #{resourceNum,jdbcType=VARCHAR}, + + + #{stepType,jdbcType=VARCHAR}, + + + #{projectId,jdbcType=VARCHAR}, + + + #{parentId,jdbcType=VARCHAR}, + + + #{versionId,jdbcType=VARCHAR}, + + + #{source,jdbcType=VARCHAR}, + + + #{config,jdbcType=VARCHAR}, + + + + + + update api_scenario_report_step + + + report_id = #{record.reportId,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + sort = #{record.sort,jdbcType=BIGINT}, + + + `enable` = #{record.enable,jdbcType=BIT}, + + + resource_id = #{record.resourceId,jdbcType=BIGINT}, + + + resource_num = #{record.resourceNum,jdbcType=VARCHAR}, + + + step_type = #{record.stepType,jdbcType=VARCHAR}, + + + project_id = #{record.projectId,jdbcType=VARCHAR}, + + + parent_id = #{record.parentId,jdbcType=VARCHAR}, + + + version_id = #{record.versionId,jdbcType=VARCHAR}, + + + `source` = #{record.source,jdbcType=VARCHAR}, + + + config = #{record.config,jdbcType=VARCHAR}, + + + + + + + + update api_scenario_report_step + set report_id = #{record.reportId,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + sort = #{record.sort,jdbcType=BIGINT}, + `enable` = #{record.enable,jdbcType=BIT}, + resource_id = #{record.resourceId,jdbcType=BIGINT}, + resource_num = #{record.resourceNum,jdbcType=VARCHAR}, + step_type = #{record.stepType,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + parent_id = #{record.parentId,jdbcType=VARCHAR}, + version_id = #{record.versionId,jdbcType=VARCHAR}, + `source` = #{record.source,jdbcType=VARCHAR}, + config = #{record.config,jdbcType=VARCHAR} + + + + + + update api_scenario_report_step + + + `name` = #{name,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=BIGINT}, + + + `enable` = #{enable,jdbcType=BIT}, + + + resource_id = #{resourceId,jdbcType=BIGINT}, + + + resource_num = #{resourceNum,jdbcType=VARCHAR}, + + + step_type = #{stepType,jdbcType=VARCHAR}, + + + project_id = #{projectId,jdbcType=VARCHAR}, + + + parent_id = #{parentId,jdbcType=VARCHAR}, + + + version_id = #{versionId,jdbcType=VARCHAR}, + + + `source` = #{source,jdbcType=VARCHAR}, + + + config = #{config,jdbcType=VARCHAR}, + + + where report_id = #{reportId,jdbcType=VARCHAR} + + + update api_scenario_report_step + set `name` = #{name,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=BIGINT}, + `enable` = #{enable,jdbcType=BIT}, + resource_id = #{resourceId,jdbcType=BIGINT}, + resource_num = #{resourceNum,jdbcType=VARCHAR}, + step_type = #{stepType,jdbcType=VARCHAR}, + project_id = #{projectId,jdbcType=VARCHAR}, + parent_id = #{parentId,jdbcType=VARCHAR}, + version_id = #{versionId,jdbcType=VARCHAR}, + `source` = #{source,jdbcType=VARCHAR}, + config = #{config,jdbcType=VARCHAR} + where report_id = #{reportId,jdbcType=VARCHAR} + + + insert into api_scenario_report_step + (report_id, `name`, sort, `enable`, resource_id, resource_num, step_type, project_id, + parent_id, version_id, `source`, config) + values + + (#{item.reportId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.sort,jdbcType=BIGINT}, + #{item.enable,jdbcType=BIT}, #{item.resourceId,jdbcType=BIGINT}, #{item.resourceNum,jdbcType=VARCHAR}, + #{item.stepType,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.parentId,jdbcType=VARCHAR}, + #{item.versionId,jdbcType=VARCHAR}, #{item.source,jdbcType=VARCHAR}, #{item.config,jdbcType=VARCHAR} + ) + + + + insert into api_scenario_report_step ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.sort,jdbcType=BIGINT} + + + #{item.enable,jdbcType=BIT} + + + #{item.resourceId,jdbcType=BIGINT} + + + #{item.resourceNum,jdbcType=VARCHAR} + + + #{item.stepType,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.parentId,jdbcType=VARCHAR} + + + #{item.versionId,jdbcType=VARCHAR} + + + #{item.source,jdbcType=VARCHAR} + + + #{item.config,jdbcType=VARCHAR} + + + ) + + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql index dc1f41e678..3cb3667c05 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql @@ -99,37 +99,69 @@ CREATE INDEX idx_create_user ON api_definition(create_user); CREATE INDEX idx_name ON api_definition(name); CREATE TABLE IF NOT EXISTS api_report( - `id` VARCHAR(50) NOT NULL COMMENT '接口结果报告pk' , - `name` VARCHAR(200) NOT NULL COMMENT '接口报告名称' , - `resource_id` VARCHAR(50) NOT NULL COMMENT '资源fk/api_definition_id/api_test_case_id' , - `create_time` BIGINT NOT NULL COMMENT '创建时间' , - `update_time` BIGINT NOT NULL COMMENT '修改时间' , - `create_user` VARCHAR(50) NOT NULL COMMENT '创建人fk' , - `update_user` VARCHAR(50) NOT NULL COMMENT '修改人' , - `deleted` BIT(1) NOT NULL DEFAULT 0 COMMENT '删除状态' , - `status` VARCHAR(50) NOT NULL DEFAULT 'Pending' COMMENT '结果状态' , - `start_time` BIGINT COMMENT '接口开始执行时间' , - `end_time` BIGINT COMMENT '接口执行结束时间' , - `run_mode` VARCHAR(20) NOT NULL COMMENT '执行模块/API/CASE/API_PLAN' , - `pool_id` VARCHAR(50) NOT NULL COMMENT '资源池fk' , - `trigger_mode` VARCHAR(50) NOT NULL COMMENT '触发模式/手动/批量/定时任务/JENKINS' , - `version_id` VARCHAR(50) COMMENT '版本fk' , - `project_id` VARCHAR(50) NOT NULL COMMENT '项目fk' , - `integrated_report_id` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '集成报告id/api_scenario_report_id' , - `integrated` BIT(1) NOT NULL DEFAULT 0 COMMENT '是否为集成报告,默认否' , - PRIMARY KEY (id) -) ENGINE = InnoDB + `id` VARCHAR(50) NOT NULL COMMENT '接口结果报告pk' , + `name` VARCHAR(200) NOT NULL COMMENT '接口报告名称' , + `resource_id` VARCHAR(50) NOT NULL COMMENT '资源fk/api_definition_id/api_test_case_id' , + `create_time` BIGINT NOT NULL COMMENT '创建时间' , + `update_time` BIGINT NOT NULL COMMENT '修改时间' , + `create_user` VARCHAR(50) NOT NULL COMMENT '创建人fk' , + `update_user` VARCHAR(50) NOT NULL COMMENT '修改人' , + `deleted` BIT(1) NOT NULL DEFAULT 0 COMMENT '删除状态' , + `status` VARCHAR(50) NOT NULL DEFAULT 'Pending' COMMENT '结果状态' , + `run_mode` VARCHAR(20) NOT NULL COMMENT '执行模块/API/CASE/API_PLAN' , + `pool_id` VARCHAR(50) NOT NULL COMMENT '资源池fk' , + `trigger_mode` VARCHAR(50) NOT NULL COMMENT '触发模式/手动/批量/定时任务/JENKINS' , + `version_id` VARCHAR(50) COMMENT '版本fk' , + `project_id` VARCHAR(50) NOT NULL COMMENT '项目fk' , + `integrated` BIT(1) NOT NULL DEFAULT 0 COMMENT '是否为集成报告,默认否' , + `environment_id` VARCHAR(50) COMMENT '环境id' , + PRIMARY KEY (id) +) + ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'API/CASE执行结果'; - CREATE INDEX idx_integrated ON api_report(integrated); -CREATE INDEX idx_update_time ON api_report(update_time desc); +CREATE INDEX idx_update_time ON api_report(update_time); CREATE INDEX idx_project_id ON api_report(project_id); CREATE INDEX idx_resource_id ON api_report(resource_id); CREATE INDEX idx_status ON api_report(status); CREATE INDEX idx_create_user ON api_report(create_user); +CREATE TABLE IF NOT EXISTS api_report_detail( + `id` VARCHAR(50) NOT NULL COMMENT '报告详情id' , + `report_id` VARCHAR(50) NOT NULL COMMENT '接口报告id' , + `resource_id` VARCHAR(50) NOT NULL COMMENT '场景中各个步骤请求唯一标识' , + `start_time` BIGINT NOT NULL COMMENT '开始时间' , + `status` VARCHAR(20) NOT NULL COMMENT '结果状态' , + `request_time` BIGINT COMMENT '单个请求步骤时间' , + `assertions_total` BIGINT COMMENT '总断言数' , + `pass_assertions_total` BIGINT COMMENT '失败断言数' , + `fake_code` VARCHAR(200) COMMENT '误报编号' , + `request_name` VARCHAR(500) COMMENT '请求名称' , + `project_id` VARCHAR(50) COMMENT '项目fk' , + `error_total` INT COMMENT '失败总数' , + `code` VARCHAR(500) COMMENT '请求响应码' , + `content` LONGBLOB COMMENT '结果内容详情' , + PRIMARY KEY (id) +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = 'API/CASE执行结果详情'; + +CREATE INDEX idx_report ON api_report_detail(report_id); +CREATE INDEX idx_resource_id ON api_report_detail(resource_id); + +CREATE TABLE api_report_log( + `report_id` VARCHAR(50) NOT NULL COMMENT '请求资源 id' , + `console` LONGBLOB COMMENT '执行日志' , + PRIMARY KEY (report_id) +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '接口报告过程日志'; + + CREATE TABLE IF NOT EXISTS api_definition_follower( `api_definition_id` VARCHAR(50) NOT NULL COMMENT '接口fk' , `user_id` VARCHAR(50) NOT NULL COMMENT '关注人/用户fk' , @@ -214,7 +246,7 @@ CREATE TABLE IF NOT EXISTS api_scenario_step( `step_type` VARCHAR(50) COMMENT '步骤类型/API/CASE等' , `project_id` VARCHAR(50) COMMENT '项目fk' , `parent_id` VARCHAR(50) DEFAULT 'NONE' COMMENT '父级fk' , - `version_id` VARCHAR(255) COMMENT '版本号' , + `version_id` VARCHAR(50) COMMENT '版本号' , `source` VARCHAR(10) COMMENT '引用/复制/自定义' , `config` VARCHAR(500) COMMENT '循环等组件基础数据' , PRIMARY KEY (id) @@ -269,73 +301,94 @@ CREATE INDEX idx_pos ON api_scenario_module(pos); CREATE UNIQUE INDEX uq_name_project_parent_type ON api_scenario_module (project_id, name, parent_id); CREATE TABLE IF NOT EXISTS api_scenario_report( - `id` VARCHAR(50) NOT NULL COMMENT '场景报告pk' , - `name` VARCHAR(255) NOT NULL COMMENT '报告名称' , - `create_time` BIGINT NOT NULL COMMENT '创建时间' , - `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , - `delete_time` BIGINT COMMENT '删除时间' , - `delete_user` VARCHAR(50) COMMENT '删除人' , - `deleted` BIT(1) NOT NULL DEFAULT 0 COMMENT '删除标识' , - `update_user` VARCHAR(50) NOT NULL COMMENT '修改人' , - `update_time` BIGINT NOT NULL COMMENT '更新时间' , - `pass_rate` BIGINT COMMENT '通过率' , - `status` VARCHAR(20) NOT NULL DEFAULT 'Pending' COMMENT '报告状态/SUCCESS/ERROR' , - `trigger_mode` VARCHAR(20) NOT NULL COMMENT '触发方式' , - `run_mode` VARCHAR(20) NOT NULL COMMENT '执行模式' , - `pool_id` VARCHAR(50) NOT NULL COMMENT '资源池' , - `version_id` VARCHAR(50) COMMENT '版本fk' , - `integrated` BIT(1) NOT NULL DEFAULT 0 COMMENT '是否是集成报告' , - `project_id` VARCHAR(50) NOT NULL COMMENT '项目fk' , - `scenario_id` VARCHAR(50) NOT NULL COMMENT '场景fk' , - PRIMARY KEY (id) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT = '场景报告'; - + `id` VARCHAR(50) NOT NULL COMMENT '场景报告pk' , + `name` VARCHAR(255) NOT NULL COMMENT '报告名称' , + `create_time` BIGINT NOT NULL COMMENT '创建时间' , + `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , + `delete_time` BIGINT COMMENT '删除时间' , + `delete_user` VARCHAR(50) COMMENT '删除人' , + `deleted` BIT(1) NOT NULL DEFAULT 0 COMMENT '删除标识' , + `update_user` VARCHAR(50) NOT NULL COMMENT '修改人' , + `update_time` BIGINT NOT NULL COMMENT '更新时间' , + `pass_rate` BIGINT COMMENT '通过率' , + `status` VARCHAR(20) NOT NULL DEFAULT 'Pending' COMMENT '报告状态/SUCCESS/ERROR' , + `trigger_mode` VARCHAR(20) NOT NULL COMMENT '触发方式' , + `run_mode` VARCHAR(20) NOT NULL COMMENT '执行模式' , + `pool_id` VARCHAR(50) NOT NULL COMMENT '资源池' , + `version_id` VARCHAR(50) COMMENT '版本fk' , + `integrated` BIT(1) NOT NULL DEFAULT 0 COMMENT '是否是集成报告' , + `project_id` VARCHAR(50) NOT NULL COMMENT '项目fk' , + `scenario_id` VARCHAR(50) NOT NULL COMMENT '场景fk' , + `environment_id` VARCHAR(50) COMMENT '环境' , + PRIMARY KEY (id) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '场景报告'; CREATE INDEX idx_project_id ON api_scenario_report(project_id); CREATE INDEX idx_scenario_id ON api_scenario_report(scenario_id); CREATE INDEX idx_trigger_mode ON api_scenario_report(trigger_mode); CREATE INDEX idx_run_mode ON api_scenario_report(run_mode); CREATE INDEX idx_status ON api_scenario_report(status); -CREATE INDEX idx_update_time ON api_scenario_report(update_time desc); +CREATE INDEX idx_update_time ON api_scenario_report(update_time); CREATE INDEX idx_create_user ON api_scenario_report(create_user); CREATE INDEX idx_name ON api_scenario_report(name); CREATE INDEX idx_pool_id ON api_scenario_report(pool_id); CREATE TABLE IF NOT EXISTS api_scenario_report_detail( - `id` VARCHAR(50) NOT NULL COMMENT 'ID' , - `report_id` VARCHAR(50) NOT NULL COMMENT '报告fk' , - `resource_id` VARCHAR(50) NOT NULL COMMENT '场景中各个步骤请求唯一标识' , - `start_time` BIGINT COMMENT '开始时间' , - `status` VARCHAR(20) COMMENT '结果状态' , - `request_time` BIGINT COMMENT '单个请求步骤时间' , - `assertions_total` BIGINT COMMENT '总断言数' , - `pass_assertions_total` BIGINT COMMENT '失败断言数' , - `fake_code` VARCHAR(200) COMMENT '误报编号' , - `request_name` VARCHAR(500) COMMENT '请求名称' , - `environment_id` VARCHAR(50) COMMENT '环境fk' , - `project_id` VARCHAR(50) COMMENT '项目fk' , - `error_total` INT COMMENT '失败总数' , - `code` VARCHAR(500) COMMENT '请求响应码' , - `content` LONGBLOB COMMENT '执行结果' , - PRIMARY KEY (id) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT = '场景报告步骤结果'; + `id` VARCHAR(50) NOT NULL COMMENT 'ID' , + `report_id` VARCHAR(50) NOT NULL COMMENT '报告fk' , + `resource_id` VARCHAR(50) NOT NULL COMMENT '场景中各个步骤请求唯一标识' , + `start_time` BIGINT COMMENT '开始时间' , + `status` VARCHAR(20) COMMENT '结果状态' , + `request_time` BIGINT COMMENT '单个请求步骤时间' , + `assertions_total` BIGINT COMMENT '总断言数' , + `pass_assertions_total` BIGINT COMMENT '失败断言数' , + `fake_code` VARCHAR(200) COMMENT '误报编号' , + `request_name` VARCHAR(500) COMMENT '请求名称' , + `project_id` VARCHAR(50) COMMENT '项目fk' , + `error_total` INT COMMENT '失败总数' , + `code` VARCHAR(500) COMMENT '请求响应码' , + `content` LONGBLOB COMMENT '执行结果' , + PRIMARY KEY (id) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '场景报告步骤结果'; CREATE INDEX idx_report_id ON api_scenario_report_detail(report_id); CREATE INDEX idx_resource_id ON api_scenario_report_detail(resource_id); CREATE INDEX idx_project_id ON api_scenario_report_detail(project_id); -CREATE TABLE IF NOT EXISTS api_scenario_report_structure( - `report_id` VARCHAR(50) NOT NULL COMMENT '请求资源 id' , - `resource_tree` LONGBLOB COMMENT '资源步骤结构树' , - PRIMARY KEY (report_id) +CREATE TABLE IF NOT EXISTS api_scenario_report_step( + `report_id` VARCHAR(50) NOT NULL COMMENT '请求资源 id' , + `name` VARCHAR(255) COMMENT '步骤名称' , + `sort` BIGINT NOT NULL COMMENT '序号' , + `enable` BIT(1) NOT NULL DEFAULT 1 COMMENT '启用/禁用' , + `resource_id` BIGINT COMMENT '资源id' , + `resource_num` VARCHAR(50) COMMENT '资源编号' , + `step_type` VARCHAR(50) COMMENT '步骤类型/API/CASE等' , + `project_id` VARCHAR(50) COMMENT '项目fk' , + `parent_id` VARCHAR(50) DEFAULT 'NONE' COMMENT '父级fk' , + `version_id` VARCHAR(50) COMMENT '版本号' , + `source` VARCHAR(10) COMMENT '引用/复制/自定义' , + `config` VARCHAR(500) COMMENT '循环等组件基础数据' , + PRIMARY KEY (report_id) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '场景报告步骤'; + +CREATE INDEX idx_sort ON api_scenario_report_step(sort); +CREATE INDEX idx_enable ON api_scenario_report_step(enable); +CREATE INDEX idx_parent_id ON api_scenario_report_step(parent_id); + +CREATE TABLE IF NOT EXISTS api_scenario_report_log( + `report_id` VARCHAR(50) NOT NULL COMMENT '请求资源 id' , + `console` LONGBLOB COMMENT '执行日志' , + PRIMARY KEY (report_id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT = '场景报告结构'; + COLLATE = utf8mb4_general_ci COMMENT = '场景报告过程日志'; CREATE TABLE IF NOT EXISTS api_sync_config( `id` VARCHAR(50) NOT NULL COMMENT '' , @@ -486,14 +539,6 @@ CREATE TABLE IF NOT EXISTS api_test_case_blob( DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '接口用例详情'; -CREATE TABLE IF NOT EXISTS api_scenario_report_log( - `report_id` VARCHAR(50) NOT NULL COMMENT '请求资源 id' , - `console` LONGBLOB COMMENT '执行日志' , - PRIMARY KEY (report_id) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT = '场景报告过程日志'; - CREATE TABLE IF NOT EXISTS api_scenario_environment( `id` VARCHAR(50) NOT NULL COMMENT '场景环境pk' , `api_scenario_id` VARCHAR(50) NOT NULL COMMENT '场景fk' , diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/CollectionReportDTO.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/CollectionReportDTO.java new file mode 100644 index 0000000000..39444de8b8 --- /dev/null +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/CollectionReportDTO.java @@ -0,0 +1,19 @@ +package io.metersphere.sdk.dto.api; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +@Data +public class CollectionReportDTO implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + // 集合报告id + private String reportId; + + // 集合报告名称 + private String reportName; +} diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/notice/ApiNoticeDTO.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/notice/ApiNoticeDTO.java index b401ea4e55..a080678122 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/notice/ApiNoticeDTO.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/notice/ApiNoticeDTO.java @@ -6,7 +6,6 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serial; -import java.util.List; @Data @AllArgsConstructor @@ -20,7 +19,7 @@ public class ApiNoticeDTO implements java.io.Serializable { private String reportStatus; private String userId; private String projectId; - private List environmentIds; + private String environmentId; private String reportId; private String queueId; } diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/RequestResult.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/RequestResult.java index 0a56fee733..74d64e98c7 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/RequestResult.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/RequestResult.java @@ -16,44 +16,61 @@ public class RequestResult { // 步骤请求唯一ID private String resourceId; + // 线程名称 private String threadName; + // 步骤名称 private String name; + // 请求地址 private String url; + // 请求大小 private long requestSize; + // 开始时间 private long startTime; + // 结束时间 private long endTime; + // 失败数量 private int error; - private boolean success; - + // 请求头 private String headers; + // cookies private String cookies; + // 请求体 private String body; + // 响应状态 private String status; + // 请求方法 private String method; - private int totalAssertionCount = 0; + // 断言总数 + private int assertionTotal = 0; - private int passAssertionsCount= 0; + // 断言通过数 + private int passAssertionsTotal = 0; + // 子请求结果 private List subRequestResults = new ArrayList<>(); + // 响应结果 private ResponseResult responseResult = new ResponseResult(); + private Boolean isSuccessful; + public void increasePassAssertionCount() { - this.passAssertionsCount++; + this.passAssertionsTotal++; } + // 误报信息 private String fakeErrorMessage; // 误报编码名称 private String fakeErrorCode; diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/ResponseResult.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/ResponseResult.java index b29add5d25..85534198e7 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/ResponseResult.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/ResponseResult.java @@ -10,29 +10,34 @@ import java.util.List; */ @Data public class ResponseResult { - + // 响应状态 private String responseCode; + // 响应详细信息 private String responseMessage; // 总响应时间 private long responseTime; + // 从客户端向服务器发送请求到收到响应的时间 private long latency; // 总响应内容大小 private long responseSize; + // 响应头 private String headers; + // 响应内容 private String body; - private String vars; - - private String console; - + // 响应类型 private String contentType; + // 过程变量处理信息 + private String vars; + + // 图片内容 private byte[] imageUrl; // Socket Initialization(Socket 初始化时间) @@ -59,6 +64,7 @@ public class ResponseResult { // header size private long headerSize = 0; + // 断言结果 private final List assertions = new ArrayList<>(); } diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/TaskResult.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/TaskResult.java index c0d88463be..a4ed904bf4 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/TaskResult.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/result/TaskResult.java @@ -1,5 +1,6 @@ package io.metersphere.sdk.dto.api.result; +import io.metersphere.sdk.dto.api.CollectionReportDTO; import lombok.Data; import java.io.Serial; @@ -30,10 +31,6 @@ public class TaskResult implements Serializable { * 项目id */ private String projectId; - /** - * 执行环境id - */ - private List environmentIds; /** * 执行过程状态 */ @@ -46,5 +43,10 @@ public class TaskResult implements Serializable { /** * 环境变量处理信息 */ - List environmentList; + String environmentId; + + /** + * 集合报告,空则是单报告 + */ + private CollectionReportDTO collectionReport; } diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/task/TaskRequest.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/task/TaskRequest.java index 7a999aaf03..4598af8c30 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/task/TaskRequest.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/api/task/TaskRequest.java @@ -1,5 +1,6 @@ package io.metersphere.sdk.dto.api.task; +import io.metersphere.sdk.dto.api.CollectionReportDTO; import io.metersphere.sdk.dto.api.result.MsRegexDTO; import lombok.Data; @@ -66,7 +67,12 @@ public class TaskRequest implements Serializable { /** * 执行环境id */ - private List environmentIds; + private String environmentId; + + /** + * 集合报告,空则是单报告 + */ + private CollectionReportDTO collectionReport; // TODO 其它执行参数 } diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/queue/ExecutionQueue.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/queue/ExecutionQueue.java index 6293422da0..09e7e3ecf2 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/queue/ExecutionQueue.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/dto/queue/ExecutionQueue.java @@ -4,7 +4,6 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; -import java.util.Map; @Data public class ExecutionQueue implements Serializable { @@ -49,9 +48,9 @@ public class ExecutionQueue implements Serializable { private Long retryNumber; /** - * 环境,key= projectID,value=envID + * 环境Id */ - private Map envMap; + private String environmentId; @Serial private static final long serialVersionUID = 1L; diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiReportSendNoticeService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiReportSendNoticeService.java index d2d68e341c..d03863ae4b 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiReportSendNoticeService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiReportSendNoticeService.java @@ -23,7 +23,6 @@ import io.metersphere.system.service.NoticeSendService; import io.metersphere.system.service.SystemParameterService; import jakarta.annotation.Resource; import org.apache.commons.beanutils.BeanMap; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -97,8 +96,8 @@ public class ApiReportSendNoticeService { paramMap.put("status", noticeDTO.getReportStatus()); // TODO 暂时取一个环境处理 - if (CollectionUtils.isNotEmpty(noticeDTO.getEnvironmentIds())) { - Environment environment = environmentMapper.selectByPrimaryKey(noticeDTO.getEnvironmentIds().getFirst()); + if (StringUtils.isNotEmpty(noticeDTO.getEnvironmentId())) { + Environment environment = environmentMapper.selectByPrimaryKey(noticeDTO.getEnvironmentId()); if (environment != null) { paramMap.put("environment", environment.getName()); } diff --git a/backend/services/api-test/src/main/resources/apiGeneratorConfig.xml b/backend/services/api-test/src/main/resources/apiGeneratorConfig.xml index a40dfc8c96..6407a452c9 100644 --- a/backend/services/api-test/src/main/resources/apiGeneratorConfig.xml +++ b/backend/services/api-test/src/main/resources/apiGeneratorConfig.xml @@ -81,7 +81,8 @@
-
+
+
@@ -97,7 +98,7 @@
-
+
diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/listener/MessageListenerTest.java b/backend/services/api-test/src/test/java/io/metersphere/api/listener/MessageListenerTest.java index 18c7c9c7fd..c586a171c4 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/listener/MessageListenerTest.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/listener/MessageListenerTest.java @@ -12,8 +12,6 @@ import org.junit.jupiter.api.TestMethodOrder; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; -import java.util.ArrayList; - @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @AutoConfigureMockMvc @@ -33,7 +31,7 @@ public class MessageListenerTest { api.setReportStatus("exampleReportStatus"); api.setUserId("exampleUserId"); api.setProjectId("exampleProjectId"); - api.setEnvironmentIds(new ArrayList<>(){{this.add("exampleEnvironmentId");}}); + api.setEnvironmentId("exampleEnvironmentId"); api.setReportId("exampleReportId"); ConsumerRecord record = new ConsumerRecord<>(KafkaTopicConstants.API_REPORT_TASK_TOPIC, 0, 0, "123", JSON.toJSONString(api)); @@ -49,7 +47,7 @@ public class MessageListenerTest { scenario.setReportStatus("exampleReportStatus"); scenario.setUserId("exampleUserId"); scenario.setProjectId("exampleProjectId"); - api.setEnvironmentIds(new ArrayList<>(){{this.add("exampleEnvironmentId");}}); + api.setEnvironmentId("exampleEnvironmentId"); scenario.setReportId("exampleReportId"); ConsumerRecord scenarioRecord = new ConsumerRecord<>(KafkaTopicConstants.API_REPORT_TASK_TOPIC, 0, 0, "123", JSON.toJSONString(scenario)); @@ -65,7 +63,7 @@ public class MessageListenerTest { testCase.setReportStatus("exampleReportStatus"); testCase.setUserId("exampleUserId"); testCase.setProjectId("exampleProjectId"); - api.setEnvironmentIds(new ArrayList<>(){{this.add("exampleEnvironmentId");}}); + api.setEnvironmentId("exampleEnvironmentId"); testCase.setReportId("exampleReportId"); ConsumerRecord testCaseRecord = new ConsumerRecord<>(KafkaTopicConstants.API_REPORT_TASK_TOPIC, 0, 0, "123", JSON.toJSONString(testCase)); diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/service/ApiExecutionQueueServiceTest.java b/backend/services/api-test/src/test/java/io/metersphere/api/service/ApiExecutionQueueServiceTest.java index e3f99b9cfc..8ec064f156 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/service/ApiExecutionQueueServiceTest.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/service/ApiExecutionQueueServiceTest.java @@ -47,7 +47,6 @@ public class ApiExecutionQueueServiceTest { queue.setFailure(true); queue.setRetryEnable(true); queue.setRetryNumber(3L); - queue.setEnvMap(Map.of("projectID1", "envID1", "projectID2", "envID2")); ExecutionQueueDetail queueDetail1 = new ExecutionQueueDetail(); queueDetail1.setResourceId("resourceId1"); diff --git a/backend/services/api-test/src/test/resources/dml/init_api_definition.sql b/backend/services/api-test/src/test/resources/dml/init_api_definition.sql index 4a3470290f..96f0c0d9bb 100644 --- a/backend/services/api-test/src/test/resources/dml/init_api_definition.sql +++ b/backend/services/api-test/src/test/resources/dml/init_api_definition.sql @@ -23,14 +23,14 @@ INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980545', '查询Linux主机6', 'P0', 100002009, NULL, 'PENDING', NULL, NULL, 10000, '100001100001', '1005', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0'); DELETE FROM `api_report` WHERE `id` in ('10001','10002','10003','10004','10005','10006','10007','10008'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `start_time`, `end_time`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated_report_id`, `integrated`) VALUES ('10001', '报告001', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'SUCCESS', 1680624405386, 1680624405386, 'API', 'pol_id_100001', 'hand', NULL, '100001100001', 'NONE', b'0'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `start_time`, `end_time`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated_report_id`, `integrated`) VALUES ('10002', '报告002', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'ERROR', 1680624405386, 1680624405386, 'API', 'pol_id_100001', 'hand', NULL, '100001100001', 'NONE', b'0'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `start_time`, `end_time`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated_report_id`, `integrated`) VALUES ('10003', '报告003', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'FAKE_ERROR', 1680624405386, 1680624405386, 'API', 'pol_id_100001', 'hand', NULL, '100001100001', 'NONE', b'0'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `start_time`, `end_time`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated_report_id`, `integrated`) VALUES ('10004', '报告004', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'SUCCESS', 1680624405386, 1680624405386, 'API', 'pol_id_100001', 'hand', NULL, '100001100001', 'NONE', b'0'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `start_time`, `end_time`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated_report_id`, `integrated`) VALUES ('10005', '报告005', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'ERROR', 1680624405386, 1680624405386, 'API', 'pol_id_100001', 'hand', NULL, '100001100001', 'NONE', b'0'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `start_time`, `end_time`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated_report_id`, `integrated`) VALUES ('10006', '报告006', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'SUCCESS', 1680624405386, 1680624405386, 'API', 'pol_id_100001', 'hand', NULL, '100001100001', 'NONE', b'0'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `start_time`, `end_time`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated_report_id`, `integrated`) VALUES ('10007', '报告004', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'SUCCESS', 1680624405386, 1680624405386, 'API', 'pol_id_100001', 'hand', NULL, '100001100001', 'NONE', b'0'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `start_time`, `end_time`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated_report_id`, `integrated`) VALUES ('10008', '报告005', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'ERROR', 1680624405386, 1680624405386, 'API', 'pol_id_100001', 'hand', NULL, '100001100001', 'NONE', b'0'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated`) VALUES ('10001', '报告001', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'SUCCESS', 'API', 'pol_id_100001', 'hand', NULL, '100001100001', b'0'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated`) VALUES ('10002', '报告002', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'ERROR', 'API', 'pol_id_100001', 'hand', NULL, '100001100001', b'0'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated`) VALUES ('10003', '报告003', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'FAKE_ERROR', 'API', 'pol_id_100001', 'hand', NULL, '100001100001', b'0'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated`) VALUES ('10004', '报告004', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'SUCCESS', 'API', 'pol_id_100001', 'hand', NULL, '100001100001', b'0'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated`) VALUES ('10005', '报告005', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'ERROR', 'API', 'pol_id_100001', 'hand', NULL, '100001100001', b'0'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated`) VALUES ('10006', '报告006', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'SUCCESS', 'API', 'pol_id_100001', 'hand', NULL, '100001100001', b'0'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated`) VALUES ('10007', '报告004', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'SUCCESS', 'API', 'pol_id_100001', 'hand', NULL, '100001100001', b'0'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `create_time`, `update_time`, `create_user`, `update_user`, `deleted`, `status`, `run_mode`, `pool_id`, `trigger_mode`, `version_id`, `project_id`, `integrated`) VALUES ('10008', '报告005', 'resource_id_10001', 1680624405386, 1680624405386, 'admin', 'admin', b'0', 'ERROR', 'API', 'pol_id_100001', 'hand', NULL, '100001100001', b'0'); DELETE FROM `api_definition_module` WHERE `id` in ('10001', 'case-moduleId'); INSERT INTO `api_definition_module` (`id`, `name`, `parent_id`, `project_id`, `pos`, `create_time`, `update_time`, `update_user`, `create_user`) VALUES ('10001', 'module1', 'NONE', '100001100001', 10, 0, 0, 'admin', 'admin'); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/config/interceptor/ApiTestInterceptor.java b/backend/services/system-setting/src/main/java/io/metersphere/system/config/interceptor/ApiTestInterceptor.java index cbda89bf95..4bfa241b34 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/config/interceptor/ApiTestInterceptor.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/config/interceptor/ApiTestInterceptor.java @@ -24,8 +24,8 @@ public class ApiTestInterceptor { // ApiTestCaseBlob configList.add(new MybatisInterceptorConfig(ApiTestCaseBlob.class, "request", CompressUtils.class, "zip", "unzip")); // ApiReportBlob - configList.add(new MybatisInterceptorConfig(ApiReportBlob.class, "content", CompressUtils.class, "zip", "unzip")); - configList.add(new MybatisInterceptorConfig(ApiReportBlob.class, "console", CompressUtils.class, "zip", "unzip")); + configList.add(new MybatisInterceptorConfig(ApiReportDetail.class, "content", CompressUtils.class, "zip", "unzip")); + configList.add(new MybatisInterceptorConfig(ApiReportLog.class, "console", CompressUtils.class, "zip", "unzip")); // ApiScenarioBlob configList.add(new MybatisInterceptorConfig(ApiScenarioStepBlob.class, "content", CompressUtils.class, "zip", "unzip")); // ApiScenarioReportBlob