Merge remote-tracking branch 'origin/master'

This commit is contained in:
song.tianyang 2020-12-22 20:08:41 +08:00
commit ae647f79c3
9 changed files with 276 additions and 173 deletions

View File

@ -20,5 +20,7 @@ public class TestResourcePool implements Serializable {
private Long updateTime;
private String image;
private static final long serialVersionUID = 1L;
}

View File

@ -175,142 +175,142 @@ public class TestResourcePoolExample {
}
public Criteria andNameIsNull() {
addCriterion("name is null");
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(String value) {
addCriterion("type =", value, "type");
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(String value) {
addCriterion("type <>", value, "type");
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(String value) {
addCriterion("type >", value, "type");
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(String value) {
addCriterion("type >=", value, "type");
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(String value) {
addCriterion("type <", value, "type");
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(String value) {
addCriterion("type <=", value, "type");
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLike(String value) {
addCriterion("type like", value, "type");
addCriterion("`type` like", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotLike(String value) {
addCriterion("type not like", value, "type");
addCriterion("`type` not like", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<String> values) {
addCriterion("type in", values, "type");
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<String> values) {
addCriterion("type not in", values, "type");
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(String value1, String value2) {
addCriterion("type between", value1, value2, "type");
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(String value1, String value2) {
addCriterion("type not between", value1, value2, "type");
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
@ -385,72 +385,72 @@ public class TestResourcePoolExample {
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status");
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status");
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status");
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status");
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status");
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status");
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status");
addCriterion("`status` like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status");
addCriterion("`status` not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status");
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status");
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status");
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status");
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
@ -573,6 +573,76 @@ public class TestResourcePoolExample {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andImageIsNull() {
addCriterion("image is null");
return (Criteria) this;
}
public Criteria andImageIsNotNull() {
addCriterion("image is not null");
return (Criteria) this;
}
public Criteria andImageEqualTo(String value) {
addCriterion("image =", value, "image");
return (Criteria) this;
}
public Criteria andImageNotEqualTo(String value) {
addCriterion("image <>", value, "image");
return (Criteria) this;
}
public Criteria andImageGreaterThan(String value) {
addCriterion("image >", value, "image");
return (Criteria) this;
}
public Criteria andImageGreaterThanOrEqualTo(String value) {
addCriterion("image >=", value, "image");
return (Criteria) this;
}
public Criteria andImageLessThan(String value) {
addCriterion("image <", value, "image");
return (Criteria) this;
}
public Criteria andImageLessThanOrEqualTo(String value) {
addCriterion("image <=", value, "image");
return (Criteria) this;
}
public Criteria andImageLike(String value) {
addCriterion("image like", value, "image");
return (Criteria) this;
}
public Criteria andImageNotLike(String value) {
addCriterion("image not like", value, "image");
return (Criteria) this;
}
public Criteria andImageIn(List<String> values) {
addCriterion("image in", values, "image");
return (Criteria) this;
}
public Criteria andImageNotIn(List<String> values) {
addCriterion("image not in", values, "image");
return (Criteria) this;
}
public Criteria andImageBetween(String value1, String value2) {
addCriterion("image between", value1, value2, "image");
return (Criteria) this;
}
public Criteria andImageNotBetween(String value1, String value2) {
addCriterion("image not between", value1, value2, "image");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -9,6 +9,7 @@
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="image" jdbcType="VARCHAR" property="image" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -69,7 +70,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, type, description, status, create_time, update_time
id, `name`, `type`, description, `status`, create_time, update_time, image
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestResourcePoolExample" resultMap="BaseResultMap">
select
@ -102,12 +103,12 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestResourcePool">
insert into test_resource_pool (id, name, type,
description, status, create_time,
update_time)
insert into test_resource_pool (id, `name`, `type`,
description, `status`, create_time,
update_time, image)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
#{updateTime,jdbcType=BIGINT}, #{image,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestResourcePool">
insert into test_resource_pool
@ -116,16 +117,16 @@
id,
</if>
<if test="name != null">
name,
`name`,
</if>
<if test="type != null">
type,
`type`,
</if>
<if test="description != null">
description,
</if>
<if test="status != null">
status,
`status`,
</if>
<if test="createTime != null">
create_time,
@ -133,6 +134,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="image != null">
image,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -156,6 +160,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="image != null">
#{image,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestResourcePoolExample" resultType="java.lang.Long">
@ -171,16 +178,16 @@
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
@ -188,6 +195,9 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.image != null">
image = #{record.image,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -196,12 +206,13 @@
<update id="updateByExample" parameterType="map">
update test_resource_pool
set id = #{record.id,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
update_time = #{record.updateTime,jdbcType=BIGINT},
image = #{record.image,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -210,16 +221,16 @@
update test_resource_pool
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
@ -227,17 +238,21 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="image != null">
image = #{image,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestResourcePool">
update test_resource_pool
set name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
set `name` = #{name,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
update_time = #{updateTime,jdbcType=BIGINT},
image = #{image,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -30,8 +30,8 @@ public abstract class AbstractEngine implements Engine {
protected Integer threadNum;
protected List<TestResource> resourceList;
private TestResourcePoolService testResourcePoolService;
private TestResourceService testResourceService;
private final TestResourcePoolService testResourcePoolService;
private final TestResourceService testResourceService;
public AbstractEngine() {
testResourcePoolService = CommonBeanFactory.getBean(TestResourcePoolService.class);
@ -62,6 +62,11 @@ public abstract class AbstractEngine implements Engine {
&& !ResourcePoolTypeEnum.NODE.name().equals(resourcePool.getType())) {
MSException.throwException("Invalid Resource Pool type.");
}
// image
String image = resourcePool.getImage();
if (StringUtils.isNotEmpty(image)) {
JMETER_IMAGE = image;
}
this.resourceList = testResourceService.getResourcesByPoolId(resourcePool.getId());
if (CollectionUtils.isEmpty(this.resourceList)) {
MSException.throwException("Test Resource is empty");

View File

@ -0,0 +1,2 @@
ALTER TABLE test_resource_pool
ADD image VARCHAR(100) NULL;

View File

@ -61,6 +61,9 @@
<el-form-item :label="$t('commons.description')" prop="description">
<el-input v-model="form.description" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('commons.image')" prop="image">
<el-input v-model="form.image" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('test_resource_pool.type')" prop="type">
<el-select v-model="form.type" :placeholder="$t('test_resource_pool.select_pool_type')"
@change="changeResourceType()">
@ -148,6 +151,9 @@
<el-form-item :label="$t('commons.description')" prop="description">
<el-input v-model="form.description" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('commons.image')" prop="image">
<el-input v-model="form.image" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('test_resource_pool.type')" prop="type">
<el-select v-model="form.type" :placeholder="$t('test_resource_pool.select_pool_type')"
@change="changeResourceType()">

View File

@ -171,7 +171,8 @@ export default {
all_label: {
case: "all",
review: "all"
}
},
image: 'Image'
},
license: {
title: 'Authorization management',

View File

@ -171,7 +171,8 @@ export default {
all_label: {
case: "全部用例",
review: "全部评审"
}
},
image: '镜像'
},
license: {
title: '授权管理',

View File

@ -171,7 +171,8 @@ export default {
all_label: {
case: "全部用例",
review: "全部評審"
}
},
image: '鏡像'
},
license: {
title: '授權管理',