节点信息 存进 test_resource 表
This commit is contained in:
parent
172688f3e1
commit
0329313845
|
@ -7,10 +7,6 @@ public class TestResource implements Serializable {
|
||||||
|
|
||||||
private String testResourcePoolId;
|
private String testResourcePoolId;
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
private Long createTime;
|
private Long createTime;
|
||||||
|
@ -37,22 +33,6 @@ public class TestResource implements Serializable {
|
||||||
this.testResourcePoolId = testResourcePoolId == null ? null : testResourcePoolId.trim();
|
this.testResourcePoolId = testResourcePoolId == null ? null : testResourcePoolId.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name == null ? null : name.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description == null ? null : description.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -244,146 +244,6 @@ public class TestResourceExample {
|
||||||
return (Criteria) this;
|
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<String> values) {
|
|
||||||
addCriterion("name in", values, "name");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andNameNotIn(List<String> 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 andDescriptionIsNull() {
|
|
||||||
addCriterion("description is null");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionIsNotNull() {
|
|
||||||
addCriterion("description is not null");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionEqualTo(String value) {
|
|
||||||
addCriterion("description =", value, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionNotEqualTo(String value) {
|
|
||||||
addCriterion("description <>", value, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionGreaterThan(String value) {
|
|
||||||
addCriterion("description >", value, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
|
|
||||||
addCriterion("description >=", value, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionLessThan(String value) {
|
|
||||||
addCriterion("description <", value, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionLessThanOrEqualTo(String value) {
|
|
||||||
addCriterion("description <=", value, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionLike(String value) {
|
|
||||||
addCriterion("description like", value, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionNotLike(String value) {
|
|
||||||
addCriterion("description not like", value, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionIn(List<String> values) {
|
|
||||||
addCriterion("description in", values, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionNotIn(List<String> values) {
|
|
||||||
addCriterion("description not in", values, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionBetween(String value1, String value2) {
|
|
||||||
addCriterion("description between", value1, value2, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andDescriptionNotBetween(String value1, String value2) {
|
|
||||||
addCriterion("description not between", value1, value2, "description");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andStatusIsNull() {
|
public Criteria andStatusIsNull() {
|
||||||
addCriterion("status is null");
|
addCriterion("status is null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
|
|
|
@ -13,8 +13,6 @@ public class TestResourcePool implements Serializable {
|
||||||
|
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
private String info;
|
|
||||||
|
|
||||||
private Long createTime;
|
private Long createTime;
|
||||||
|
|
||||||
private Long updateTime;
|
private Long updateTime;
|
||||||
|
@ -61,14 +59,6 @@ public class TestResourcePool implements Serializable {
|
||||||
this.status = status == null ? null : status.trim();
|
this.status = status == null ? null : status.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInfo() {
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInfo(String info) {
|
|
||||||
this.info = info == null ? null : info.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCreateTime() {
|
public Long getCreateTime() {
|
||||||
return createTime;
|
return createTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -454,76 +454,6 @@ public class TestResourcePoolExample {
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Criteria andInfoIsNull() {
|
|
||||||
addCriterion("info is null");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoIsNotNull() {
|
|
||||||
addCriterion("info is not null");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoEqualTo(String value) {
|
|
||||||
addCriterion("info =", value, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoNotEqualTo(String value) {
|
|
||||||
addCriterion("info <>", value, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoGreaterThan(String value) {
|
|
||||||
addCriterion("info >", value, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoGreaterThanOrEqualTo(String value) {
|
|
||||||
addCriterion("info >=", value, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoLessThan(String value) {
|
|
||||||
addCriterion("info <", value, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoLessThanOrEqualTo(String value) {
|
|
||||||
addCriterion("info <=", value, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoLike(String value) {
|
|
||||||
addCriterion("info like", value, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoNotLike(String value) {
|
|
||||||
addCriterion("info not like", value, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoIn(List<String> values) {
|
|
||||||
addCriterion("info in", values, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoNotIn(List<String> values) {
|
|
||||||
addCriterion("info not in", values, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoBetween(String value1, String value2) {
|
|
||||||
addCriterion("info between", value1, value2, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andInfoNotBetween(String value1, String value2) {
|
|
||||||
addCriterion("info not between", value1, value2, "info");
|
|
||||||
return (Criteria) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Criteria andCreateTimeIsNull() {
|
public Criteria andCreateTimeIsNull() {
|
||||||
addCriterion("create_time is null");
|
addCriterion("create_time is null");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestResource">
|
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestResource">
|
||||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
<result column="test_resource_pool_id" jdbcType="VARCHAR" property="testResourcePoolId" />
|
<result column="test_resource_pool_id" jdbcType="VARCHAR" property="testResourcePoolId" />
|
||||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
||||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
|
||||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||||
|
@ -72,7 +70,7 @@
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, test_resource_pool_id, name, description, status, create_time, update_time
|
id, test_resource_pool_id, status, create_time, update_time
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Blob_Column_List">
|
<sql id="Blob_Column_List">
|
||||||
configuration
|
configuration
|
||||||
|
@ -126,12 +124,12 @@
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="io.metersphere.base.domain.TestResource">
|
<insert id="insert" parameterType="io.metersphere.base.domain.TestResource">
|
||||||
insert into test_resource (id, test_resource_pool_id, name,
|
insert into test_resource (id, test_resource_pool_id, status,
|
||||||
description, status, create_time,
|
create_time, update_time, configuration
|
||||||
update_time, configuration)
|
)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{testResourcePoolId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{testResourcePoolId,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
|
||||||
#{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
|
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{configuration,jdbcType=LONGVARCHAR}
|
||||||
#{updateTime,jdbcType=BIGINT}, #{configuration,jdbcType=LONGVARCHAR})
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestResource">
|
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestResource">
|
||||||
insert into test_resource
|
insert into test_resource
|
||||||
|
@ -142,12 +140,6 @@
|
||||||
<if test="testResourcePoolId != null">
|
<if test="testResourcePoolId != null">
|
||||||
test_resource_pool_id,
|
test_resource_pool_id,
|
||||||
</if>
|
</if>
|
||||||
<if test="name != null">
|
|
||||||
name,
|
|
||||||
</if>
|
|
||||||
<if test="description != null">
|
|
||||||
description,
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
status,
|
status,
|
||||||
</if>
|
</if>
|
||||||
|
@ -168,12 +160,6 @@
|
||||||
<if test="testResourcePoolId != null">
|
<if test="testResourcePoolId != null">
|
||||||
#{testResourcePoolId,jdbcType=VARCHAR},
|
#{testResourcePoolId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="name != null">
|
|
||||||
#{name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="description != null">
|
|
||||||
#{description,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
#{status,jdbcType=VARCHAR},
|
#{status,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -203,12 +189,6 @@
|
||||||
<if test="record.testResourcePoolId != null">
|
<if test="record.testResourcePoolId != null">
|
||||||
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
|
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.name != null">
|
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="record.description != null">
|
|
||||||
description = #{record.description,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="record.status != null">
|
<if test="record.status != null">
|
||||||
status = #{record.status,jdbcType=VARCHAR},
|
status = #{record.status,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -230,8 +210,6 @@
|
||||||
update test_resource
|
update test_resource
|
||||||
set id = #{record.id,jdbcType=VARCHAR},
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
|
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
|
||||||
description = #{record.description,jdbcType=VARCHAR},
|
|
||||||
status = #{record.status,jdbcType=VARCHAR},
|
status = #{record.status,jdbcType=VARCHAR},
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||||
|
@ -244,8 +222,6 @@
|
||||||
update test_resource
|
update test_resource
|
||||||
set id = #{record.id,jdbcType=VARCHAR},
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
|
test_resource_pool_id = #{record.testResourcePoolId,jdbcType=VARCHAR},
|
||||||
name = #{record.name,jdbcType=VARCHAR},
|
|
||||||
description = #{record.description,jdbcType=VARCHAR},
|
|
||||||
status = #{record.status,jdbcType=VARCHAR},
|
status = #{record.status,jdbcType=VARCHAR},
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
update_time = #{record.updateTime,jdbcType=BIGINT}
|
update_time = #{record.updateTime,jdbcType=BIGINT}
|
||||||
|
@ -259,12 +235,6 @@
|
||||||
<if test="testResourcePoolId != null">
|
<if test="testResourcePoolId != null">
|
||||||
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
|
test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="name != null">
|
|
||||||
name = #{name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="description != null">
|
|
||||||
description = #{description,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
status = #{status,jdbcType=VARCHAR},
|
status = #{status,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
@ -283,8 +253,6 @@
|
||||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestResource">
|
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestResource">
|
||||||
update test_resource
|
update test_resource
|
||||||
set test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
|
set test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
|
||||||
name = #{name,jdbcType=VARCHAR},
|
|
||||||
description = #{description,jdbcType=VARCHAR},
|
|
||||||
status = #{status,jdbcType=VARCHAR},
|
status = #{status,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
update_time = #{updateTime,jdbcType=BIGINT},
|
update_time = #{updateTime,jdbcType=BIGINT},
|
||||||
|
@ -294,8 +262,6 @@
|
||||||
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestResource">
|
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestResource">
|
||||||
update test_resource
|
update test_resource
|
||||||
set test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
|
set test_resource_pool_id = #{testResourcePoolId,jdbcType=VARCHAR},
|
||||||
name = #{name,jdbcType=VARCHAR},
|
|
||||||
description = #{description,jdbcType=VARCHAR},
|
|
||||||
status = #{status,jdbcType=VARCHAR},
|
status = #{status,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
update_time = #{updateTime,jdbcType=BIGINT}
|
update_time = #{updateTime,jdbcType=BIGINT}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||||
<result column="info" jdbcType="VARCHAR" property="info" />
|
|
||||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
@ -70,7 +69,7 @@
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, name, type, description, status, info, create_time, update_time
|
id, name, type, description, status, create_time, update_time
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestResourcePoolExample" resultMap="BaseResultMap">
|
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestResourcePoolExample" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
|
@ -104,11 +103,11 @@
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="io.metersphere.base.domain.TestResourcePool">
|
<insert id="insert" parameterType="io.metersphere.base.domain.TestResourcePool">
|
||||||
insert into test_resource_pool (id, name, type,
|
insert into test_resource_pool (id, name, type,
|
||||||
description, status, info,
|
description, status, create_time,
|
||||||
create_time, update_time)
|
update_time)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||||
#{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{info,jdbcType=VARCHAR},
|
#{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
|
||||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT})
|
#{updateTime,jdbcType=BIGINT})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestResourcePool">
|
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestResourcePool">
|
||||||
insert into test_resource_pool
|
insert into test_resource_pool
|
||||||
|
@ -128,9 +127,6 @@
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
status,
|
status,
|
||||||
</if>
|
</if>
|
||||||
<if test="info != null">
|
|
||||||
info,
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
create_time,
|
create_time,
|
||||||
</if>
|
</if>
|
||||||
|
@ -154,9 +150,6 @@
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
#{status,jdbcType=VARCHAR},
|
#{status,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="info != null">
|
|
||||||
#{info,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
#{createTime,jdbcType=BIGINT},
|
#{createTime,jdbcType=BIGINT},
|
||||||
</if>
|
</if>
|
||||||
|
@ -189,9 +182,6 @@
|
||||||
<if test="record.status != null">
|
<if test="record.status != null">
|
||||||
status = #{record.status,jdbcType=VARCHAR},
|
status = #{record.status,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.info != null">
|
|
||||||
info = #{record.info,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="record.createTime != null">
|
<if test="record.createTime != null">
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
</if>
|
</if>
|
||||||
|
@ -210,7 +200,6 @@
|
||||||
type = #{record.type,jdbcType=VARCHAR},
|
type = #{record.type,jdbcType=VARCHAR},
|
||||||
description = #{record.description,jdbcType=VARCHAR},
|
description = #{record.description,jdbcType=VARCHAR},
|
||||||
status = #{record.status,jdbcType=VARCHAR},
|
status = #{record.status,jdbcType=VARCHAR},
|
||||||
info = #{record.info,jdbcType=VARCHAR},
|
|
||||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
update_time = #{record.updateTime,jdbcType=BIGINT}
|
update_time = #{record.updateTime,jdbcType=BIGINT}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
|
@ -232,9 +221,6 @@
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
status = #{status,jdbcType=VARCHAR},
|
status = #{status,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="info != null">
|
|
||||||
info = #{info,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
create_time = #{createTime,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
</if>
|
</if>
|
||||||
|
@ -250,7 +236,6 @@
|
||||||
type = #{type,jdbcType=VARCHAR},
|
type = #{type,jdbcType=VARCHAR},
|
||||||
description = #{description,jdbcType=VARCHAR},
|
description = #{description,jdbcType=VARCHAR},
|
||||||
status = #{status,jdbcType=VARCHAR},
|
status = #{status,jdbcType=VARCHAR},
|
||||||
info = #{info,jdbcType=VARCHAR},
|
|
||||||
create_time = #{createTime,jdbcType=BIGINT},
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
update_time = #{updateTime,jdbcType=BIGINT}
|
update_time = #{updateTime,jdbcType=BIGINT}
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package io.metersphere.base.mapper.ext;
|
||||||
|
|
||||||
|
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
|
||||||
|
import io.metersphere.dto.TestResourcePoolDTO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ExtTestReourcePoolMapper {
|
||||||
|
List<TestResourcePoolDTO> listResourcePools(@Param("request") QueryResourcePoolRequest request);
|
||||||
|
|
||||||
|
// List<TestResource> listResourcesByPoolId(@Param("poolId") String poolId);
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="io.metersphere.base.mapper.ext.ExtTestReourcePoolMapper">
|
||||||
|
|
||||||
|
<resultMap id="TestReourcePoolResultMap" type="io.metersphere.dto.TestResourcePoolDTO">
|
||||||
|
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||||
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||||
|
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||||
|
<result column="description" jdbcType="VARCHAR" property="description"/>
|
||||||
|
<result column="status" jdbcType="VARCHAR" property="status"/>
|
||||||
|
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
|
||||||
|
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
|
||||||
|
|
||||||
|
<collection property="resources" column="id" ofType="io.metersphere.base.domain.TestResource"
|
||||||
|
select="io.metersphere.base.mapper.ext.ExtTestReourcePoolMapper.listResourcesByPoolId">
|
||||||
|
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="listResourcePools" resultMap="TestReourcePoolResultMap">
|
||||||
|
SELECT * FROM test_resource_pool
|
||||||
|
<where>
|
||||||
|
<if test="request.name != null">
|
||||||
|
and test_resource_pool.name like CONCAT('%', #{request.name},'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="listResourcesByPoolId" resultType="io.metersphere.base.domain.TestResource">
|
||||||
|
SELECT * FROM test_resource WHERE test_resource_pool_id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -6,6 +6,7 @@ import io.metersphere.base.domain.TestResourcePool;
|
||||||
import io.metersphere.commons.utils.PageUtils;
|
import io.metersphere.commons.utils.PageUtils;
|
||||||
import io.metersphere.commons.utils.Pager;
|
import io.metersphere.commons.utils.Pager;
|
||||||
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
|
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
|
||||||
|
import io.metersphere.dto.TestResourcePoolDTO;
|
||||||
import io.metersphere.service.TestResourcePoolService;
|
import io.metersphere.service.TestResourcePoolService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -20,8 +21,8 @@ public class TestResourcePoolController {
|
||||||
private TestResourcePoolService testResourcePoolService;
|
private TestResourcePoolService testResourcePoolService;
|
||||||
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public TestResourcePool addTestResourcePool(@RequestBody TestResourcePool testResourcePool) {
|
public TestResourcePoolDTO addTestResourcePool(@RequestBody TestResourcePoolDTO testResourcePoolDTO) {
|
||||||
return testResourcePoolService.addTestResourcePool(testResourcePool);
|
return testResourcePoolService.addTestResourcePool(testResourcePoolDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/delete/{testResourcePoolId}")
|
@GetMapping("/delete/{testResourcePoolId}")
|
||||||
|
@ -30,12 +31,12 @@ public class TestResourcePoolController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public void updateTestResourcePool(@RequestBody TestResourcePool testResourcePool) {
|
public void updateTestResourcePool(@RequestBody TestResourcePoolDTO testResourcePoolDTO) {
|
||||||
testResourcePoolService.updateTestResourcePool(testResourcePool);
|
testResourcePoolService.updateTestResourcePool(testResourcePoolDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("list/{goPage}/{pageSize}")
|
@PostMapping("list/{goPage}/{pageSize}")
|
||||||
public Pager<List<TestResourcePool>> listResourcePools(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryResourcePoolRequest request) {
|
public Pager<List<TestResourcePoolDTO>> listResourcePools(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryResourcePoolRequest request) {
|
||||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
return PageUtils.setPageInfo(page, testResourcePoolService.listResourcePools(request));
|
return PageUtils.setPageInfo(page, testResourcePoolService.listResourcePools(request));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ public class NodeDTO {
|
||||||
private String ip;
|
private String ip;
|
||||||
private Integer port;
|
private Integer port;
|
||||||
private Integer maxConcurrency;
|
private Integer maxConcurrency;
|
||||||
private Boolean validate;
|
|
||||||
|
|
||||||
public String getIp() {
|
public String getIp() {
|
||||||
return ip;
|
return ip;
|
||||||
|
@ -29,12 +28,4 @@ public class NodeDTO {
|
||||||
public void setMaxConcurrency(Integer maxConcurrency) {
|
public void setMaxConcurrency(Integer maxConcurrency) {
|
||||||
this.maxConcurrency = maxConcurrency;
|
this.maxConcurrency = maxConcurrency;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getValidate() {
|
|
||||||
return validate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValidate(Boolean validate) {
|
|
||||||
this.validate = validate;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package io.metersphere.dto;
|
||||||
|
|
||||||
|
import io.metersphere.base.domain.TestResource;
|
||||||
|
import io.metersphere.base.domain.TestResourcePool;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class TestResourcePoolDTO extends TestResourcePool {
|
||||||
|
|
||||||
|
private List<TestResource> resources;
|
||||||
|
|
||||||
|
public List<TestResource> getResources() {
|
||||||
|
return resources;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResources(List<TestResource> resources) {
|
||||||
|
this.resources = resources;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +1,15 @@
|
||||||
package io.metersphere.service;
|
package io.metersphere.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import io.metersphere.base.domain.TestResourcePool;
|
import io.metersphere.base.domain.TestResource;
|
||||||
import io.metersphere.base.domain.TestResourcePoolExample;
|
import io.metersphere.base.domain.TestResourceExample;
|
||||||
|
import io.metersphere.base.mapper.TestResourceMapper;
|
||||||
import io.metersphere.base.mapper.TestResourcePoolMapper;
|
import io.metersphere.base.mapper.TestResourcePoolMapper;
|
||||||
|
import io.metersphere.base.mapper.ext.ExtTestReourcePoolMapper;
|
||||||
import io.metersphere.commons.constants.ResourcePoolTypeEnum;
|
import io.metersphere.commons.constants.ResourcePoolTypeEnum;
|
||||||
import io.metersphere.commons.utils.BeanUtils;
|
|
||||||
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
|
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
|
||||||
import io.metersphere.dto.KubernetesDTO;
|
|
||||||
import io.metersphere.dto.NodeDTO;
|
import io.metersphere.dto.NodeDTO;
|
||||||
import io.metersphere.engine.kubernetes.provider.ClientCredential;
|
import io.metersphere.dto.TestResourcePoolDTO;
|
||||||
import io.metersphere.engine.kubernetes.provider.KubernetesProvider;
|
import io.metersphere.engine.kubernetes.provider.KubernetesProvider;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -30,12 +30,16 @@ import java.util.UUID;
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public class TestResourcePoolService {
|
public class TestResourcePoolService {
|
||||||
|
|
||||||
private final static String nodeControllerUrl = "%s:%s/status";
|
private final static String nodeControllerUrl = "http://%s:%s/status";
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TestResourcePoolMapper testResourcePoolMapper;
|
private TestResourcePoolMapper testResourcePoolMapper;
|
||||||
|
@Resource
|
||||||
|
private TestResourceMapper testResourceMapper;
|
||||||
|
@Resource
|
||||||
|
private ExtTestReourcePoolMapper extTestReourcePoolMapper;
|
||||||
|
|
||||||
public TestResourcePool addTestResourcePool(TestResourcePool testResourcePool) {
|
public TestResourcePoolDTO addTestResourcePool(TestResourcePoolDTO testResourcePool) {
|
||||||
testResourcePool.setId(UUID.randomUUID().toString());
|
testResourcePool.setId(UUID.randomUUID().toString());
|
||||||
testResourcePool.setCreateTime(System.currentTimeMillis());
|
testResourcePool.setCreateTime(System.currentTimeMillis());
|
||||||
testResourcePool.setUpdateTime(System.currentTimeMillis());
|
testResourcePool.setUpdateTime(System.currentTimeMillis());
|
||||||
|
@ -46,24 +50,21 @@ public class TestResourcePoolService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteTestResourcePool(String testResourcePoolId) {
|
public void deleteTestResourcePool(String testResourcePoolId) {
|
||||||
|
deleteTestResource(testResourcePoolId);
|
||||||
testResourcePoolMapper.deleteByPrimaryKey(testResourcePoolId);
|
testResourcePoolMapper.deleteByPrimaryKey(testResourcePoolId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateTestResourcePool(TestResourcePool testResourcePool) {
|
public void updateTestResourcePool(TestResourcePoolDTO testResourcePool) {
|
||||||
testResourcePool.setUpdateTime(System.currentTimeMillis());
|
testResourcePool.setUpdateTime(System.currentTimeMillis());
|
||||||
validateTestResourcePool(testResourcePool);
|
validateTestResourcePool(testResourcePool);
|
||||||
testResourcePoolMapper.updateByPrimaryKeySelective(testResourcePool);
|
testResourcePoolMapper.updateByPrimaryKeySelective(testResourcePool);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestResourcePool> listResourcePools(QueryResourcePoolRequest request) {
|
public List<TestResourcePoolDTO> listResourcePools(QueryResourcePoolRequest request) {
|
||||||
TestResourcePoolExample example = new TestResourcePoolExample();
|
return extTestReourcePoolMapper.listResourcePools(request);
|
||||||
if (!StringUtils.isEmpty(request.getName())) {
|
|
||||||
example.createCriteria().andNameLike("%" + request.getName() + "%");
|
|
||||||
}
|
|
||||||
return testResourcePoolMapper.selectByExample(example);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateTestResourcePool(TestResourcePool testResourcePool) {
|
private void validateTestResourcePool(TestResourcePoolDTO testResourcePool) {
|
||||||
if (StringUtils.equalsIgnoreCase(testResourcePool.getType(), ResourcePoolTypeEnum.K8S.name())) {
|
if (StringUtils.equalsIgnoreCase(testResourcePool.getType(), ResourcePoolTypeEnum.K8S.name())) {
|
||||||
validateK8s(testResourcePool);
|
validateK8s(testResourcePool);
|
||||||
return;
|
return;
|
||||||
|
@ -71,46 +72,67 @@ public class TestResourcePoolService {
|
||||||
validateNodes(testResourcePool);
|
validateNodes(testResourcePool);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateNodes(TestResourcePool testResourcePool) {
|
private void validateNodes(TestResourcePoolDTO testResourcePool) {
|
||||||
List<NodeDTO> nodes = JSON.parseArray(testResourcePool.getInfo(), NodeDTO.class);
|
if (CollectionUtils.isEmpty(testResourcePool.getResources())) {
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(nodes)) {
|
|
||||||
throw new RuntimeException("没有节点信息");
|
throw new RuntimeException("没有节点信息");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (NodeDTO node : nodes) {
|
deleteTestResource(testResourcePool.getId());
|
||||||
boolean isValidate = validateNode(node);
|
for (TestResource resource : testResourcePool.getResources()) {
|
||||||
|
NodeDTO nodeDTO = JSON.parseObject(resource.getConfiguration(), NodeDTO.class);
|
||||||
|
boolean isValidate = validateNode(nodeDTO);
|
||||||
if (!isValidate) {
|
if (!isValidate) {
|
||||||
testResourcePool.setStatus("0");
|
testResourcePool.setStatus("0");
|
||||||
|
resource.setStatus("0");
|
||||||
}
|
}
|
||||||
node.setValidate(isValidate);
|
resource.setStatus("1");
|
||||||
|
resource.setTestResourcePoolId(testResourcePool.getId());
|
||||||
|
updateTestResource(resource);
|
||||||
|
|
||||||
}
|
}
|
||||||
testResourcePool.setInfo(JSON.toJSONString(nodes));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean validateNode(NodeDTO dto) {
|
private boolean validateNode(NodeDTO node) {
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
try {
|
||||||
ResponseEntity<String> entity = restTemplate.getForEntity(String.format(nodeControllerUrl, dto.getIp(), dto.getPort()), String.class);
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
return entity.getStatusCode().value() == HttpStatus.SC_OK;
|
ResponseEntity<String> entity = restTemplate.getForEntity(String.format(nodeControllerUrl, node.getIp(), node.getPort()), String.class);
|
||||||
|
return entity.getStatusCode().value() == HttpStatus.SC_OK;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateK8s(TestResourcePool testResourcePool) {
|
private void validateK8s(TestResourcePoolDTO testResourcePool) {
|
||||||
List<KubernetesDTO> dtos = JSON.parseArray(testResourcePool.getInfo(), KubernetesDTO.class);
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(dtos) || dtos.size() != 1) {
|
if (CollectionUtils.isEmpty(testResourcePool.getResources()) || testResourcePool.getResources().size() != 1) {
|
||||||
throw new RuntimeException("只能添加一个 K8s");
|
throw new RuntimeException("只能添加一个 K8s");
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientCredential clientCredential = new ClientCredential();
|
TestResource testResource = testResourcePool.getResources().get(0);
|
||||||
BeanUtils.copyBean(clientCredential, dtos.get(0));
|
testResource.setTestResourcePoolId(testResourcePool.getId());
|
||||||
try {
|
try {
|
||||||
KubernetesProvider provider = new KubernetesProvider(JSON.toJSONString(clientCredential));
|
KubernetesProvider provider = new KubernetesProvider(testResource.getConfiguration());
|
||||||
provider.validateCredential();
|
provider.validateCredential();
|
||||||
dtos.get(0).setValidate(true);
|
testResource.setStatus("1");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
dtos.get(0).setValidate(false);
|
testResource.setStatus("0");
|
||||||
testResourcePool.setStatus("0");
|
testResourcePool.setStatus("0");
|
||||||
}
|
}
|
||||||
testResourcePool.setInfo(JSON.toJSONString(dtos));
|
deleteTestResource(testResourcePool.getId());
|
||||||
|
updateTestResource(testResource);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateTestResource(TestResource testResource) {
|
||||||
|
testResource.setUpdateTime(System.currentTimeMillis());
|
||||||
|
testResource.setCreateTime(System.currentTimeMillis());
|
||||||
|
testResource.setId(UUID.randomUUID().toString());
|
||||||
|
testResourceMapper.insertSelective(testResource);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteTestResource(String testResourcePoolId) {
|
||||||
|
TestResourceExample testResourceExample = new TestResourceExample();
|
||||||
|
testResourceExample.createCriteria().andTestResourcePoolIdEqualTo(testResourcePoolId);
|
||||||
|
testResourceMapper.deleteByExample(testResourceExample);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
<!-- <table tableName="user_role"/>-->
|
<!-- <table tableName="user_role"/>-->
|
||||||
<!-- <table tableName="workspace"/>-->
|
<!-- <table tableName="workspace"/>-->
|
||||||
<table tableName="test_resource_pool"/>
|
<table tableName="test_resource_pool"/>
|
||||||
<!-- <table tableName="test_resource"/>-->
|
<table tableName="test_resource"/>
|
||||||
<!-- <table tableName="system_parameter"/>-->
|
<!-- <table tableName="system_parameter"/>-->
|
||||||
<!-- <table tableName="role"/>-->
|
<!-- <table tableName="role"/>-->
|
||||||
<!-- <table tableName="project"/>-->
|
<!-- <table tableName="project"/>-->
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package io.metersphere.service;
|
||||||
|
|
||||||
|
import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest;
|
||||||
|
import io.metersphere.dto.TestResourcePoolDTO;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||||
|
public class TestResourcePoolServiceTest {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TestResourcePoolService testResourcePoolService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void listResourcePools() {
|
||||||
|
List<TestResourcePoolDTO> list = testResourcePoolService.listResourcePools(new QueryResourcePoolRequest());
|
||||||
|
System.out.println(list.size());
|
||||||
|
}
|
||||||
|
}
|
|
@ -69,7 +69,7 @@
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-dialog v-loading="testLoading" title="创建资源池" :visible.sync="createVisible" width="70%" @closed="closeFunc"
|
<el-dialog title="创建资源池" :visible.sync="createVisible" width="70%" @closed="closeFunc"
|
||||||
:destroy-on-close="true">
|
:destroy-on-close="true">
|
||||||
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
|
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
|
||||||
ref="createTestResourcePoolForm">
|
ref="createTestResourcePoolForm">
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog v-loading="testLoading" title="修改资源池" :visible.sync="updateVisible" width="70%" :destroy-on-close="true"
|
<el-dialog title="修改资源池" :visible.sync="updateVisible" width="70%" :destroy-on-close="true"
|
||||||
@close="closeFunc">
|
@close="closeFunc">
|
||||||
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
|
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
|
||||||
ref="updateTestResourcePoolForm">
|
ref="updateTestResourcePoolForm">
|
||||||
|
@ -244,7 +244,7 @@
|
||||||
rule: {
|
rule: {
|
||||||
name: [
|
name: [
|
||||||
{required: true, message: '请输入资源池名称', trigger: 'blur'},
|
{required: true, message: '请输入资源池名称', trigger: 'blur'},
|
||||||
{min: 2, max: 10, message: this.$t('commons.input_limit', [2, 10]), trigger: 'blur'},
|
{min: 2, max: 64, message: this.$t('commons.input_limit', [2, 64]), trigger: 'blur'},
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
|
pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
|
||||||
|
@ -338,7 +338,16 @@
|
||||||
// this.loading = true;
|
// this.loading = true;
|
||||||
this.updateVisible = true;
|
this.updateVisible = true;
|
||||||
this.form = JSON.parse(JSON.stringify(row));
|
this.form = JSON.parse(JSON.stringify(row));
|
||||||
this.infoList = JSON.parse(this.form.info);
|
this.convertResources();
|
||||||
|
},
|
||||||
|
convertResources() {
|
||||||
|
let resources = [];
|
||||||
|
if (this.form.resources) {
|
||||||
|
this.form.resources.forEach(function (resource) {
|
||||||
|
resources.push(JSON.parse(resource.configuration));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.infoList = resources;
|
||||||
},
|
},
|
||||||
del(row) {
|
del(row) {
|
||||||
window.console.log(row);
|
window.console.log(row);
|
||||||
|
@ -367,7 +376,7 @@
|
||||||
let vri = this.validateResourceInfo();
|
let vri = this.validateResourceInfo();
|
||||||
if (vri.validate) {
|
if (vri.validate) {
|
||||||
this.testLoading = true;
|
this.testLoading = true;
|
||||||
this.form.info = JSON.stringify(this.infoList);
|
this.convertSubmitResources();
|
||||||
this.$post("/testresourcepool/add", this.form)
|
this.$post("/testresourcepool/add", this.form)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -392,13 +401,25 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
convertSubmitResources() {
|
||||||
|
let resources = [];
|
||||||
|
let poolId = this.form.id;
|
||||||
|
this.infoList.forEach(function (info) {
|
||||||
|
let resource = {"configuration": JSON.stringify(info)};
|
||||||
|
if (poolId) {
|
||||||
|
resource.testResourcePoolId = poolId;
|
||||||
|
}
|
||||||
|
resources.push(resource);
|
||||||
|
});
|
||||||
|
this.form.resources = resources;
|
||||||
|
},
|
||||||
updateTestResourcePool(updateTestResourcePoolForm) {
|
updateTestResourcePool(updateTestResourcePoolForm) {
|
||||||
this.$refs[updateTestResourcePoolForm].validate(valide => {
|
this.$refs[updateTestResourcePoolForm].validate(valide => {
|
||||||
if (valide) {
|
if (valide) {
|
||||||
this.testLoading = true;
|
this.testLoading = true;
|
||||||
let vri = this.validateResourceInfo();
|
let vri = this.validateResourceInfo();
|
||||||
if (vri.validate) {
|
if (vri.validate) {
|
||||||
this.form.info = JSON.stringify(this.infoList);
|
this.convertSubmitResources();
|
||||||
this.$post("/testresourcepool/update", this.form)
|
this.$post("/testresourcepool/update", this.form)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|
Loading…
Reference in New Issue