Merge branch 'dev' of https://github.com/fit2cloudrd/metersphere-server into dev
This commit is contained in:
commit
6ae916a191
|
@ -1,7 +1,6 @@
|
|||
package io.metersphere.api.dto;
|
||||
|
||||
import io.metersphere.base.domain.ApiTestReport;
|
||||
import io.metersphere.base.domain.ApiTestWithBLOBs;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
@ -12,4 +11,6 @@ public class APIReportResult extends ApiTestReport {
|
|||
private String testName;
|
||||
|
||||
private String projectName;
|
||||
|
||||
private String userName;
|
||||
}
|
||||
|
|
|
@ -9,4 +9,6 @@ import lombok.Setter;
|
|||
public class APITestResult extends ApiTestWithBLOBs {
|
||||
|
||||
private String projectName;
|
||||
|
||||
private String userName;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.metersphere.base.mapper.ApiTestReportMapper;
|
|||
import io.metersphere.base.mapper.ext.ExtApiTestReportMapper;
|
||||
import io.metersphere.commons.constants.APITestStatus;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.dto.DashboardTestDTO;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -84,6 +86,7 @@ public class APIReportService {
|
|||
report.setCreateTime(System.currentTimeMillis());
|
||||
report.setUpdateTime(System.currentTimeMillis());
|
||||
report.setStatus(APITestStatus.Running.name());
|
||||
report.setUserId(Objects.requireNonNull(SessionUtils.getUser()).getId());
|
||||
apiTestReportMapper.insert(report);
|
||||
|
||||
return report.getId();
|
||||
|
|
|
@ -11,6 +11,7 @@ import io.metersphere.base.mapper.ApiTestMapper;
|
|||
import io.metersphere.base.mapper.ext.ExtApiTestMapper;
|
||||
import io.metersphere.commons.constants.APITestStatus;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.service.FileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -21,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -126,6 +128,7 @@ public class APITestService {
|
|||
test.setCreateTime(System.currentTimeMillis());
|
||||
test.setUpdateTime(System.currentTimeMillis());
|
||||
test.setStatus(APITestStatus.Saved.name());
|
||||
test.setUserId(Objects.requireNonNull(SessionUtils.getUser()).getId());
|
||||
apiTestMapper.insert(test);
|
||||
return test;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiTest implements Serializable {
|
||||
|
@ -16,6 +15,8 @@ public class ApiTest implements Serializable {
|
|||
|
||||
private String status;
|
||||
|
||||
private String userId;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private Long updateTime;
|
||||
|
|
|
@ -454,6 +454,76 @@ public class ApiTestExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNull() {
|
||||
addCriterion("user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNotNull() {
|
||||
addCriterion("user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdEqualTo(String value) {
|
||||
addCriterion("user_id =", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotEqualTo(String value) {
|
||||
addCriterion("user_id <>", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThan(String value) {
|
||||
addCriterion("user_id >", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("user_id >=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThan(String value) {
|
||||
addCriterion("user_id <", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("user_id <=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLike(String value) {
|
||||
addCriterion("user_id like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotLike(String value) {
|
||||
addCriterion("user_id not like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIn(List<String> values) {
|
||||
addCriterion("user_id in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotIn(List<String> values) {
|
||||
addCriterion("user_id not in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdBetween(String value1, String value2) {
|
||||
addCriterion("user_id between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotBetween(String value1, String value2) {
|
||||
addCriterion("user_id not between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiTestReport implements Serializable {
|
||||
|
@ -20,6 +19,8 @@ public class ApiTestReport implements Serializable {
|
|||
|
||||
private String status;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String content;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -573,6 +573,76 @@ public class ApiTestReportExample {
|
|||
addCriterion("status not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNull() {
|
||||
addCriterion("user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNotNull() {
|
||||
addCriterion("user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdEqualTo(String value) {
|
||||
addCriterion("user_id =", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotEqualTo(String value) {
|
||||
addCriterion("user_id <>", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThan(String value) {
|
||||
addCriterion("user_id >", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("user_id >=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThan(String value) {
|
||||
addCriterion("user_id <", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("user_id <=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLike(String value) {
|
||||
addCriterion("user_id like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotLike(String value) {
|
||||
addCriterion("user_id not like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIn(List<String> values) {
|
||||
addCriterion("user_id in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotIn(List<String> values) {
|
||||
addCriterion("user_id not in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdBetween(String value1, String value2) {
|
||||
addCriterion("user_id between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotBetween(String value1, String value2) {
|
||||
addCriterion("user_id not between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LoadTest implements Serializable {
|
||||
|
@ -22,5 +21,7 @@ public class LoadTest implements Serializable {
|
|||
|
||||
private String testResourcePoolId;
|
||||
|
||||
private String userId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -643,6 +643,76 @@ public class LoadTestExample {
|
|||
addCriterion("test_resource_pool_id not between", value1, value2, "testResourcePoolId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNull() {
|
||||
addCriterion("user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNotNull() {
|
||||
addCriterion("user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdEqualTo(String value) {
|
||||
addCriterion("user_id =", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotEqualTo(String value) {
|
||||
addCriterion("user_id <>", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThan(String value) {
|
||||
addCriterion("user_id >", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("user_id >=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThan(String value) {
|
||||
addCriterion("user_id <", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("user_id <=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLike(String value) {
|
||||
addCriterion("user_id like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotLike(String value) {
|
||||
addCriterion("user_id not like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIn(List<String> values) {
|
||||
addCriterion("user_id in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotIn(List<String> values) {
|
||||
addCriterion("user_id not in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdBetween(String value1, String value2) {
|
||||
addCriterion("user_id between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotBetween(String value1, String value2) {
|
||||
addCriterion("user_id not between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LoadTestReport implements Serializable {
|
||||
|
@ -18,6 +17,8 @@ public class LoadTestReport implements Serializable {
|
|||
|
||||
private String status;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String description;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -503,6 +503,76 @@ public class LoadTestReportExample {
|
|||
addCriterion("status not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNull() {
|
||||
addCriterion("user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNotNull() {
|
||||
addCriterion("user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdEqualTo(String value) {
|
||||
addCriterion("user_id =", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotEqualTo(String value) {
|
||||
addCriterion("user_id <>", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThan(String value) {
|
||||
addCriterion("user_id >", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("user_id >=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThan(String value) {
|
||||
addCriterion("user_id <", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("user_id <=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLike(String value) {
|
||||
addCriterion("user_id like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotLike(String value) {
|
||||
addCriterion("user_id not like", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIn(List<String> values) {
|
||||
addCriterion("user_id in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotIn(List<String> values) {
|
||||
addCriterion("user_id not in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdBetween(String value1, String value2) {
|
||||
addCriterion("user_id between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotBetween(String value1, String value2) {
|
||||
addCriterion("user_id not between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package io.metersphere.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
</resultMap>
|
||||
|
@ -73,7 +74,7 @@
|
|||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, project_id, name, description, status, create_time, update_time
|
||||
id, project_id, name, description, status, user_id, create_time, update_time
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
scenario_definition, schedule
|
||||
|
@ -128,13 +129,13 @@
|
|||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.ApiTestWithBLOBs">
|
||||
insert into api_test (id, project_id, name,
|
||||
description, status, create_time,
|
||||
update_time, scenario_definition, schedule
|
||||
)
|
||||
description, status, user_id,
|
||||
create_time, update_time, scenario_definition,
|
||||
schedule)
|
||||
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
|
||||
#{updateTime,jdbcType=BIGINT}, #{scenarioDefinition,jdbcType=LONGVARCHAR}, #{schedule,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
#{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{scenarioDefinition,jdbcType=LONGVARCHAR},
|
||||
#{schedule,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiTestWithBLOBs">
|
||||
insert into api_test
|
||||
|
@ -154,6 +155,9 @@
|
|||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
|
@ -183,6 +187,9 @@
|
|||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -221,6 +228,9 @@
|
|||
<if test="record.status != null">
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -245,6 +255,7 @@
|
|||
name = #{record.name,jdbcType=VARCHAR},
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
scenario_definition = #{record.scenarioDefinition,jdbcType=LONGVARCHAR},
|
||||
|
@ -260,6 +271,7 @@
|
|||
name = #{record.name,jdbcType=VARCHAR},
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
|
@ -281,6 +293,9 @@
|
|||
<if test="status != null">
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -302,6 +317,7 @@
|
|||
name = #{name,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
scenario_definition = #{scenarioDefinition,jdbcType=LONGVARCHAR},
|
||||
|
@ -314,6 +330,7 @@
|
|||
name = #{name,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiTestReport">
|
||||
<result column="content" jdbcType="LONGVARCHAR" property="content" />
|
||||
|
@ -72,7 +73,7 @@
|
|||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, test_id, name, description, create_time, update_time, status
|
||||
id, test_id, name, description, create_time, update_time, status, user_id
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
content
|
||||
|
@ -128,10 +129,12 @@
|
|||
<insert id="insert" parameterType="io.metersphere.base.domain.ApiTestReport">
|
||||
insert into api_test_report (id, test_id, name,
|
||||
description, create_time, update_time,
|
||||
status, content)
|
||||
status, user_id, content
|
||||
)
|
||||
values (#{id,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||
#{status,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR})
|
||||
#{status,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiTestReport">
|
||||
insert into api_test_report
|
||||
|
@ -157,6 +160,9 @@
|
|||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content,
|
||||
</if>
|
||||
|
@ -183,6 +189,9 @@
|
|||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
#{content,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -218,6 +227,9 @@
|
|||
<if test="record.status != null">
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.content != null">
|
||||
content = #{record.content,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -235,6 +247,7 @@
|
|||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
content = #{record.content,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
|
@ -248,7 +261,8 @@
|
|||
description = #{record.description,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
status = #{record.status,jdbcType=VARCHAR}
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
@ -274,6 +288,9 @@
|
|||
<if test="status != null">
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -288,6 +305,7 @@
|
|||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
content = #{content,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
@ -298,7 +316,8 @@
|
|||
description = #{description,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=VARCHAR}
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -10,6 +10,7 @@
|
|||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="test_resource_pool_id" jdbcType="VARCHAR" property="testResourcePoolId" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.LoadTestWithBLOBs">
|
||||
<result column="load_configuration" jdbcType="LONGVARCHAR" property="loadConfiguration" />
|
||||
|
@ -75,7 +76,8 @@
|
|||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, project_id, name, description, create_time, update_time, status, test_resource_pool_id
|
||||
id, project_id, name, description, create_time, update_time, status, test_resource_pool_id,
|
||||
user_id
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
load_configuration, advanced_configuration, schedule
|
||||
|
@ -131,14 +133,14 @@
|
|||
<insert id="insert" parameterType="io.metersphere.base.domain.LoadTestWithBLOBs">
|
||||
insert into load_test (id, project_id, name,
|
||||
description, create_time, update_time,
|
||||
status, test_resource_pool_id, load_configuration,
|
||||
advanced_configuration, schedule
|
||||
)
|
||||
status, test_resource_pool_id, user_id,
|
||||
load_configuration, advanced_configuration,
|
||||
schedule)
|
||||
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||
#{status,jdbcType=VARCHAR}, #{testResourcePoolId,jdbcType=VARCHAR}, #{loadConfiguration,jdbcType=LONGVARCHAR},
|
||||
#{advancedConfiguration,jdbcType=LONGVARCHAR}, #{schedule,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
#{status,jdbcType=VARCHAR}, #{testResourcePoolId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
|
||||
#{loadConfiguration,jdbcType=LONGVARCHAR}, #{advancedConfiguration,jdbcType=LONGVARCHAR},
|
||||
#{schedule,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.LoadTestWithBLOBs">
|
||||
insert into load_test
|
||||
|
@ -167,6 +169,9 @@
|
|||
<if test="testResourcePoolId != null">
|
||||
test_resource_pool_id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="loadConfiguration != null">
|
||||
load_configuration,
|
||||
</if>
|
||||
|
@ -202,6 +207,9 @@
|
|||
<if test="testResourcePoolId != null">
|
||||
#{testResourcePoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="loadConfiguration != null">
|
||||
#{loadConfiguration,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -246,6 +254,9 @@
|
|||
<if test="record.testResourcePoolId != null">
|
||||
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.loadConfiguration != null">
|
||||
load_configuration = #{record.loadConfiguration,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -270,6 +281,7 @@
|
|||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
load_configuration = #{record.loadConfiguration,jdbcType=LONGVARCHAR},
|
||||
advanced_configuration = #{record.advancedConfiguration,jdbcType=LONGVARCHAR},
|
||||
schedule = #{record.schedule,jdbcType=LONGVARCHAR}
|
||||
|
@ -286,7 +298,8 @@
|
|||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR}
|
||||
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
@ -315,6 +328,9 @@
|
|||
<if test="testResourcePoolId != null">
|
||||
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="loadConfiguration != null">
|
||||
load_configuration = #{loadConfiguration,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -336,6 +352,7 @@
|
|||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
load_configuration = #{loadConfiguration,jdbcType=LONGVARCHAR},
|
||||
advanced_configuration = #{advancedConfiguration,jdbcType=LONGVARCHAR},
|
||||
schedule = #{schedule,jdbcType=LONGVARCHAR}
|
||||
|
@ -349,7 +366,8 @@
|
|||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR}
|
||||
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -2,9 +2,8 @@ package io.metersphere.base.mapper;
|
|||
|
||||
import io.metersphere.base.domain.LoadTestReport;
|
||||
import io.metersphere.base.domain.LoadTestReportExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface LoadTestReportMapper {
|
||||
long countByExample(LoadTestReportExample example);
|
||||
|
|
|
@ -8,9 +8,10 @@
|
|||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.LoadTestReport">
|
||||
<result column="description" jdbcType="LONGVARCHAR" property="description"/>
|
||||
<result column="description" jdbcType="LONGVARCHAR" property="description" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
|
@ -71,10 +72,10 @@
|
|||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, test_id, name, create_time, update_time, status
|
||||
id, test_id, name, create_time, update_time, status, user_id
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
description
|
||||
description
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.LoadTestReportExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
|
@ -124,25 +125,25 @@
|
|||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.LoadTestReport">
|
||||
INSERT INTO load_test_report (id, test_id, name,
|
||||
create_time, update_time, status,
|
||||
description)
|
||||
VALUES (#{id,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.LoadTestReport">
|
||||
insert into load_test_report
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="testId != null">
|
||||
test_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.LoadTestReport">
|
||||
insert into load_test_report (id, test_id, name,
|
||||
create_time, update_time, status,
|
||||
user_id, description)
|
||||
values (#{id,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR},
|
||||
#{userId,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.LoadTestReport">
|
||||
insert into load_test_report
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="testId != null">
|
||||
test_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
|
@ -153,6 +154,9 @@
|
|||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
|
@ -176,6 +180,9 @@
|
|||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -208,6 +215,9 @@
|
|||
<if test="record.status != null">
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
|
@ -217,15 +227,16 @@
|
|||
</if>
|
||||
</update>
|
||||
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||
update load_test_report
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
update load_test_report
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
test_id = #{record.testId,jdbcType=VARCHAR},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
description = #{record.description,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
|
@ -236,22 +247,23 @@
|
|||
name = #{record.name,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
status = #{record.status,jdbcType=VARCHAR}
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.LoadTestReport">
|
||||
update load_test_report
|
||||
<set>
|
||||
<if test="testId != null">
|
||||
test_id = #{testId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.LoadTestReport">
|
||||
update load_test_report
|
||||
<set>
|
||||
<if test="testId != null">
|
||||
test_id = #{testId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
|
@ -259,29 +271,34 @@
|
|||
<if test="status != null">
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.LoadTestReport">
|
||||
UPDATE load_test_report
|
||||
SET test_id = #{testId,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=LONGVARCHAR}
|
||||
WHERE id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.LoadTestReport">
|
||||
update load_test_report
|
||||
set test_id = #{testId,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.LoadTestReport">
|
||||
update load_test_report
|
||||
set test_id = #{testId,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=VARCHAR}
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
|
@ -5,12 +5,14 @@
|
|||
<resultMap id="BaseResultMap" type="io.metersphere.api.dto.APITestResult"
|
||||
extends="io.metersphere.base.mapper.ApiTestMapper.BaseResultMap">
|
||||
<result column="project_name" property="projectName"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="list" resultMap="BaseResultMap" parameterType="io.metersphere.api.dto.APITestResult">
|
||||
select api_test.*, project.name as project_name
|
||||
select api_test.*, project.name as project_name, user.name as user_name
|
||||
from api_test
|
||||
left join project on api_test.project_id = project.id
|
||||
left join user on api_test.user_id = user.id
|
||||
<where>
|
||||
<if test="request.name != null">
|
||||
and api_test.name like CONCAT('%', #{request.name},'%')
|
||||
|
|
|
@ -6,14 +6,16 @@
|
|||
extends="io.metersphere.base.mapper.ApiTestReportMapper.BaseResultMap">
|
||||
<result column="test_name" property="testName"/>
|
||||
<result column="project_name" property="projectName"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
SELECT t.name AS test_name,
|
||||
r.name, r.description, r.id, r.test_id, r.create_time, r.update_time, r.status,
|
||||
project.name AS project_name
|
||||
project.name AS project_name, user.name AS user_name
|
||||
FROM api_test_report r JOIN api_test t ON r.test_id = t.id
|
||||
JOIN project ON project.id = t.project_id
|
||||
LEFT JOIN project ON project.id = t.project_id
|
||||
LEFT JOIN user ON user.id = r.user_id
|
||||
<where>
|
||||
<if test="request.name != null">
|
||||
AND r.name like CONCAT('%', #{request.name},'%')
|
||||
|
@ -31,9 +33,10 @@
|
|||
<select id="listByTestId" resultMap="BaseResultMap">
|
||||
SELECT t.name AS test_name,
|
||||
r.name, r.description, r.id, r.test_id, r.create_time, r.update_time, r.status,
|
||||
project.name AS project_name
|
||||
project.name AS project_name, user.name AS user_name
|
||||
FROM api_test_report r JOIN api_test t ON r.test_id = t.id
|
||||
JOIN project ON project.id = t.project_id
|
||||
LEFT JOIN project ON project.id = t.project_id
|
||||
LEFT JOIN user ON user.id = r.user_id
|
||||
<where>
|
||||
r.test_id = #{testId}
|
||||
</where>
|
||||
|
@ -41,9 +44,10 @@
|
|||
</select>
|
||||
|
||||
<select id="get" resultMap="BaseResultMap">
|
||||
SELECT r.*, t.name AS test_name, project.name AS project_name
|
||||
SELECT r.*, t.name AS test_name, project.name AS project_name, user.name AS user_name
|
||||
FROM api_test_report r JOIN api_test t ON r.test_id = t.id
|
||||
JOIN project ON project.id = t.project_id
|
||||
LEFT JOIN user ON user.id = r.user_id
|
||||
<where>
|
||||
r.id = #{id}
|
||||
</where>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
package io.metersphere.commons.constants;
|
||||
|
||||
public class UserStatus {
|
||||
public static final String NORMAL = "1";
|
||||
public static final String DISABLED = "0";
|
||||
}
|
|
@ -45,8 +45,8 @@ public class WorkspaceController {
|
|||
|
||||
@PostMapping("special/add")
|
||||
@RequiresRoles(RoleConstants.ADMIN)
|
||||
public void addWorkspaceByAdmin(@RequestBody Workspace workspace) {
|
||||
workspaceService.addWorkspaceByAdmin(workspace);
|
||||
public Workspace addWorkspaceByAdmin(@RequestBody Workspace workspace) {
|
||||
return workspaceService.addWorkspaceByAdmin(workspace);
|
||||
}
|
||||
|
||||
@PostMapping("update")
|
||||
|
|
|
@ -48,6 +48,7 @@ public class OrganizationService {
|
|||
private UserService userService;
|
||||
|
||||
public Organization addOrganization(Organization organization) {
|
||||
checkOrgNameRepeat(organization);
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
organization.setId(UUID.randomUUID().toString());
|
||||
organization.setCreateTime(currentTimeMillis);
|
||||
|
@ -65,6 +66,17 @@ public class OrganizationService {
|
|||
return organizationMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
private void checkOrgNameRepeat(Organization organization) {
|
||||
if (StringUtils.isBlank(organization.getName())) {
|
||||
MSException.throwException(Translator.get("organization_name_is_null"));
|
||||
}
|
||||
OrganizationExample organizationExample = new OrganizationExample();
|
||||
organizationExample.createCriteria().andNameEqualTo(organization.getName());
|
||||
if (organizationMapper.countByExample(organizationExample) > 0) {
|
||||
MSException.throwException(Translator.get("organization_name_already_exists"));
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteOrganization(String organizationId) {
|
||||
WorkspaceExample example = new WorkspaceExample();
|
||||
WorkspaceExample.Criteria criteria = example.createCriteria();
|
||||
|
@ -87,6 +99,7 @@ public class OrganizationService {
|
|||
}
|
||||
|
||||
public void updateOrganization(Organization organization) {
|
||||
checkOrgNameRepeat(organization);
|
||||
organization.setCreateTime(null);
|
||||
organization.setUpdateTime(System.currentTimeMillis());
|
||||
organizationMapper.updateByPrimaryKeySelective(organization);
|
||||
|
|
|
@ -5,6 +5,7 @@ import io.metersphere.base.mapper.*;
|
|||
import io.metersphere.base.mapper.ext.ExtUserMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtUserRoleMapper;
|
||||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.commons.constants.UserStatus;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.user.SessionUser;
|
||||
import io.metersphere.commons.utils.CodingUtil;
|
||||
|
@ -19,6 +20,7 @@ import io.metersphere.dto.UserDTO;
|
|||
import io.metersphere.dto.UserRoleDTO;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authc.DisabledAccountException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -115,7 +117,7 @@ public class UserService {
|
|||
user.setCreateTime(System.currentTimeMillis());
|
||||
user.setUpdateTime(System.currentTimeMillis());
|
||||
// 默认1:启用状态
|
||||
user.setStatus("1");
|
||||
user.setStatus(UserStatus.NORMAL);
|
||||
// 密码使用 MD5
|
||||
user.setPassword(CodingUtil.md5(user.getPassword()));
|
||||
UserExample userExample = new UserExample();
|
||||
|
@ -134,6 +136,9 @@ public class UserService {
|
|||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
if (StringUtils.equals(user.getStatus(), UserStatus.DISABLED)) {
|
||||
throw new DisabledAccountException();
|
||||
}
|
||||
UserDTO userDTO = new UserDTO();
|
||||
BeanUtils.copyProperties(user, userDTO);
|
||||
UserRoleDTO userRole = getUserRole(userId);
|
||||
|
|
|
@ -58,14 +58,16 @@ public class WorkspaceService {
|
|||
workspace.setOrganizationId(SessionUtils.getCurrentOrganizationId());
|
||||
|
||||
long currentTime = System.currentTimeMillis();
|
||||
|
||||
WorkspaceExample example = new WorkspaceExample();
|
||||
example.createCriteria()
|
||||
.andOrganizationIdEqualTo(SessionUtils.getCurrentOrganizationId())
|
||||
.andNameEqualTo(workspace.getName());
|
||||
if (workspaceMapper.countByExample(example) > 0) {
|
||||
MSException.throwException(Translator.get("workspace_name_already_exists"));
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(workspace.getId())) {
|
||||
WorkspaceExample example = new WorkspaceExample();
|
||||
example.createCriteria()
|
||||
.andOrganizationIdEqualTo(SessionUtils.getCurrentOrganizationId())
|
||||
.andNameEqualTo(workspace.getName());
|
||||
if (workspaceMapper.countByExample(example) > 0) {
|
||||
MSException.throwException(Translator.get("workspace_name_already_exists"));
|
||||
}
|
||||
workspace.setId(UUID.randomUUID().toString());
|
||||
workspace.setCreateTime(currentTime);
|
||||
workspace.setUpdateTime(currentTime);
|
||||
|
@ -235,12 +237,22 @@ public class WorkspaceService {
|
|||
}
|
||||
|
||||
public void updateWorkspaceByAdmin(Workspace workspace) {
|
||||
checkWorkspace(workspace);
|
||||
workspace.setCreateTime(null);
|
||||
workspace.setUpdateTime(System.currentTimeMillis());
|
||||
workspaceMapper.updateByPrimaryKeySelective(workspace);
|
||||
}
|
||||
|
||||
public void addWorkspaceByAdmin(Workspace workspace) {
|
||||
public Workspace addWorkspaceByAdmin(Workspace workspace) {
|
||||
checkWorkspace(workspace);
|
||||
workspace.setId(UUID.randomUUID().toString());
|
||||
workspace.setCreateTime(System.currentTimeMillis());
|
||||
workspace.setUpdateTime(System.currentTimeMillis());
|
||||
workspaceMapper.insertSelective(workspace);
|
||||
return workspace;
|
||||
}
|
||||
|
||||
private void checkWorkspace(Workspace workspace) {
|
||||
if (StringUtils.isBlank(workspace.getName())) {
|
||||
MSException.throwException(Translator.get("workspace_name_is_null"));
|
||||
}
|
||||
|
@ -254,9 +266,5 @@ public class WorkspaceService {
|
|||
if (workspaceMapper.countByExample(example) > 0) {
|
||||
MSException.throwException(Translator.get("workspace_name_already_exists"));
|
||||
}
|
||||
workspace.setId(UUID.randomUUID().toString());
|
||||
workspace.setCreateTime(System.currentTimeMillis());
|
||||
workspace.setUpdateTime(System.currentTimeMillis());
|
||||
workspaceMapper.insertSelective(workspace);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,23 +20,21 @@ CREATE TABLE IF NOT EXISTS `file_metadata` (
|
|||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `load_test` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'Test ID',
|
||||
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to',
|
||||
`name` varchar(64) NOT NULL COMMENT 'Test name',
|
||||
`description` varchar(255) DEFAULT NULL COMMENT 'Test description',
|
||||
`load_configuration` longtext COMMENT 'Load configuration (JSON format)',
|
||||
`advanced_configuration` longtext COMMENT 'Load configuration (JSON format)',
|
||||
`schedule` longtext COMMENT 'Test schedule (cron list)',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
`status` varchar(64) DEFAULT NULL COMMENT 'Test Status Running, Completed, Error, etc.',
|
||||
`test_resource_pool_id` varchar(50) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
)
|
||||
ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci;
|
||||
CREATE TABLE `load_test` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'Test ID',
|
||||
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to',
|
||||
`name` varchar(64) NOT NULL COMMENT 'Test name',
|
||||
`description` varchar(255) DEFAULT NULL COMMENT 'Test description',
|
||||
`load_configuration` longtext COMMENT 'Load configuration (JSON format)',
|
||||
`advanced_configuration` longtext COMMENT 'Load configuration (JSON format)',
|
||||
`schedule` longtext COMMENT 'Test schedule (cron list)',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
`status` varchar(64) DEFAULT NULL COMMENT 'Test Status Running, Completed, Error, etc.',
|
||||
`test_resource_pool_id` varchar(50) DEFAULT NULL,
|
||||
`user_id` varchar(64) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `load_test_file` (
|
||||
`test_id` varchar(64) DEFAULT NULL,
|
||||
|
@ -46,19 +44,17 @@ CREATE TABLE IF NOT EXISTS `load_test_file` (
|
|||
ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='测试和文件的关联表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `load_test_report` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'Test report ID',
|
||||
`test_id` varchar(50) NOT NULL COMMENT 'Test ID this test report belongs to',
|
||||
`name` varchar(64) NOT NULL COMMENT 'Test report name',
|
||||
`description` varchar(255) DEFAULT NULL COMMENT 'Test report name',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
`status` varchar(64) NOT NULL COMMENT 'Status of this test run',
|
||||
PRIMARY KEY (`id`)
|
||||
)
|
||||
ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci;
|
||||
CREATE TABLE `load_test_report` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'Test report ID',
|
||||
`test_id` varchar(50) NOT NULL COMMENT 'Test ID this test report belongs to',
|
||||
`name` varchar(64) NOT NULL COMMENT 'Test report name',
|
||||
`description` text COMMENT 'Test report message',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
`status` varchar(64) NOT NULL COMMENT 'Status of this test run',
|
||||
`user_id` varchar(64) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `load_test_report_detail` (
|
||||
`report_id` varchar(50) NOT NULL,
|
||||
|
@ -216,7 +212,8 @@ CREATE TABLE IF NOT EXISTS `api_test` (
|
|||
`description` varchar(255) DEFAULT NULL COMMENT 'Test description',
|
||||
`scenario_definition` longtext COMMENT 'Scenario definition (JSON format)',
|
||||
`schedule` longtext COMMENT 'Test schedule (cron list)',
|
||||
`status` varchar(64) DEFAULT NULL,
|
||||
`status` varchar(64) DEFAULT NULL COMMENT 'Status of this test',
|
||||
`user_id` varchar(64) DEFAULT NULL COMMENT 'User ID',
|
||||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
PRIMARY KEY (`id`)
|
||||
|
@ -239,6 +236,7 @@ CREATE TABLE IF NOT EXISTS `api_test_report` (
|
|||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
`status` varchar(64) NOT NULL COMMENT 'Status of this test run',
|
||||
`user_id` varchar(64) DEFAULT NULL COMMENT 'User ID',
|
||||
PRIMARY KEY (`id`)
|
||||
)
|
||||
ENGINE = InnoDB
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
<!--要生成的数据库表 -->
|
||||
|
||||
<table tableName="load_test_report"/>
|
||||
<table tableName="load_test"/>
|
||||
|
||||
</context>
|
||||
</generatorConfiguration>
|
|
@ -37,6 +37,8 @@ workspace_not_exists=Workspace is not exists
|
|||
project_name_is_null=Project name cannot be null
|
||||
project_name_already_exists=The project name already exists
|
||||
#organization
|
||||
organization_name_is_null=organization name cannot be null
|
||||
organization_name_already_exists=The organization name already exists
|
||||
organization_does_not_belong_to_user=The current organization does not belong to the current user
|
||||
organization_id_is_null=Organization ID cannot be null
|
||||
#api
|
||||
|
|
|
@ -37,6 +37,8 @@ workspace_not_exists=工作空间不存在
|
|||
project_name_is_null=项目名称不能为空
|
||||
project_name_already_exists=项目名称已存在
|
||||
#organization
|
||||
organization_name_is_null=组织名不能为空
|
||||
organization_name_already_exists=组织名已存在
|
||||
organization_does_not_belong_to_user=当前组织不属于当前用户
|
||||
organization_id_is_null=组织 ID 不能为空
|
||||
#api
|
||||
|
|
|
@ -37,6 +37,8 @@ workspace_not_exists=工作空間不存在
|
|||
project_name_is_null=項目名稱不能為空
|
||||
project_name_already_exists=項目名稱已存在
|
||||
#organization
|
||||
organization_name_is_null=組織名不能為空
|
||||
organization_name_already_exists=組織名已存在
|
||||
organization_does_not_belong_to_user=當前組織不屬於當前用戶
|
||||
organization_id_is_null=組織 ID 不能為空
|
||||
#api
|
||||
|
|
|
@ -13,16 +13,13 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="testName" :label="$t('api_report.test_name')" width="200" show-overflow-tooltip/>
|
||||
<el-table-column prop="projectName" :label="$t('load_test.project_name')" width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="userName" :label="$t('api_test.creator')" width="150" show-overflow-tooltip/>
|
||||
<el-table-column width="250" :label="$t('commons.create_time')">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="250" :label="$t('commons.update_time')">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" :label="$t('commons.status')">
|
||||
<template v-slot:default="{row}">
|
||||
<ms-api-report-status :row="row"/>
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<el-link type="info" @click="handleEdit(scope.row)">{{ scope.row.name }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="projectName" :label="$t('load_test.project_name')" width="150" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column prop="projectName" :label="$t('load_test.project_name')" width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="userName" :label="$t('api_test.creator')" width="150" show-overflow-tooltip/>
|
||||
<el-table-column width="250" :label="$t('commons.create_time')">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||
|
|
|
@ -384,7 +384,13 @@
|
|||
rules: {
|
||||
name: [
|
||||
{required: true, message: this.$t('workspace.input_name'), trigger: 'blur'},
|
||||
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'}
|
||||
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'},
|
||||
{
|
||||
required: true,
|
||||
pattern: /^(?!-)(?!.*?-$)[a-zA-Z0-9\u4e00-\u9fa5-]+$/,
|
||||
message: this.$t('workspace.special_characters_are_not_supported'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
wsMemberRule: {
|
||||
|
|
|
@ -438,7 +438,13 @@
|
|||
rules: {
|
||||
name: [
|
||||
{required: true, message: this.$t('workspace.input_name'), trigger: 'blur'},
|
||||
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'}
|
||||
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'},
|
||||
{
|
||||
required: true,
|
||||
pattern: /^(?!-)(?!.*?-$)[a-zA-Z0-9\u4e00-\u9fa5-]+$/,
|
||||
message: this.$t('workspace.special_characters_are_not_supported'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
organizationId: [
|
||||
{required: true, message: this.$t('organization.select_organization'), trigger: ['blur']}
|
||||
|
|
|
@ -102,6 +102,7 @@ export default {
|
|||
'please_select_a_workspace_first': 'Please select a workspace first!',
|
||||
'none': 'None Workspace',
|
||||
'select': 'Select Workspace',
|
||||
'special_characters_are_not_supported': 'Incorrect format (special characters are not supported and cannot end with \'-\')',
|
||||
},
|
||||
organization: {
|
||||
'create': 'Create Organization',
|
||||
|
@ -241,6 +242,7 @@ export default {
|
|||
'download_log_file': 'Download',
|
||||
},
|
||||
api_test: {
|
||||
creator: "Creator",
|
||||
title: "Test",
|
||||
save_and_run: "Save and Run",
|
||||
run: "Run",
|
||||
|
|
|
@ -101,6 +101,7 @@ export default {
|
|||
'please_select_a_workspace_first': '请先选择工作空间!',
|
||||
'none': '无工作空间',
|
||||
'select': '选择工作空间',
|
||||
'special_characters_are_not_supported': '格式错误(不支持特殊字符,且不能以\'-\'开头结尾)',
|
||||
},
|
||||
organization: {
|
||||
'create': '创建组织',
|
||||
|
@ -239,6 +240,7 @@ export default {
|
|||
'pressure_prediction_chart': '压力预估图',
|
||||
},
|
||||
api_test: {
|
||||
creator: "创建人",
|
||||
save_and_run: "保存并执行",
|
||||
run: "执行",
|
||||
running: "正在执行",
|
||||
|
|
|
@ -93,6 +93,7 @@ export default {
|
|||
'please_select_a_workspace_first': '請先選擇工作空間! ',
|
||||
'none': '無工作空間',
|
||||
'select': '選擇工作空間',
|
||||
'special_characters_are_not_supported': '格式錯誤(不支持特殊字符,且不能以\'-\'開頭結尾)',
|
||||
},
|
||||
organization: {
|
||||
'create': '創建組織',
|
||||
|
@ -244,6 +245,7 @@ export default {
|
|||
key: "鍵",
|
||||
value: "值",
|
||||
scenario: {
|
||||
creator: "創建人",
|
||||
config: "場景配寘",
|
||||
input_name: "請輸入場景名稱",
|
||||
name: "場景名稱",
|
||||
|
|
Loading…
Reference in New Issue