feat(项目管理): 新增项目增加默认全部资源池
This commit is contained in:
parent
feb1751d22
commit
b1aa3eacc5
|
@ -1,16 +1,12 @@
|
||||||
package io.metersphere.project.domain;
|
package io.metersphere.project.domain;
|
||||||
|
|
||||||
import io.metersphere.validation.groups.Created;
|
import io.metersphere.validation.groups.*;
|
||||||
import io.metersphere.validation.groups.Updated;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import jakarta.validation.constraints.Size;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class Project implements Serializable {
|
public class Project implements Serializable {
|
||||||
|
@ -63,6 +59,10 @@ public class Project implements Serializable {
|
||||||
@Schema(description = "模块设置")
|
@Schema(description = "模块设置")
|
||||||
private String moduleSetting;
|
private String moduleSetting;
|
||||||
|
|
||||||
|
@Schema(description = "全部资源池", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "{project.all_resource_pool.not_blank}", groups = {Created.class})
|
||||||
|
private Boolean allResourcePool;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public enum Column {
|
public enum Column {
|
||||||
|
@ -79,7 +79,8 @@ public class Project implements Serializable {
|
||||||
deleted("deleted", "deleted", "BIT", false),
|
deleted("deleted", "deleted", "BIT", false),
|
||||||
deleteUser("delete_user", "deleteUser", "VARCHAR", false),
|
deleteUser("delete_user", "deleteUser", "VARCHAR", false),
|
||||||
enable("enable", "enable", "BIT", true),
|
enable("enable", "enable", "BIT", true),
|
||||||
moduleSetting("module_setting", "moduleSetting", "VARCHAR", false);
|
moduleSetting("module_setting", "moduleSetting", "VARCHAR", false),
|
||||||
|
allResourcePool("all_resource_pool", "allResourcePool", "BIT", false);
|
||||||
|
|
||||||
private static final String BEGINNING_DELIMITER = "`";
|
private static final String BEGINNING_DELIMITER = "`";
|
||||||
|
|
||||||
|
|
|
@ -1023,6 +1023,66 @@ public class ProjectExample {
|
||||||
addCriterion("module_setting not between", value1, value2, "moduleSetting");
|
addCriterion("module_setting not between", value1, value2, "moduleSetting");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolIsNull() {
|
||||||
|
addCriterion("all_resource_pool is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolIsNotNull() {
|
||||||
|
addCriterion("all_resource_pool is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolEqualTo(Boolean value) {
|
||||||
|
addCriterion("all_resource_pool =", value, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolNotEqualTo(Boolean value) {
|
||||||
|
addCriterion("all_resource_pool <>", value, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolGreaterThan(Boolean value) {
|
||||||
|
addCriterion("all_resource_pool >", value, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolGreaterThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("all_resource_pool >=", value, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolLessThan(Boolean value) {
|
||||||
|
addCriterion("all_resource_pool <", value, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolLessThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("all_resource_pool <=", value, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolIn(List<Boolean> values) {
|
||||||
|
addCriterion("all_resource_pool in", values, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolNotIn(List<Boolean> values) {
|
||||||
|
addCriterion("all_resource_pool not in", values, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("all_resource_pool between", value1, value2, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andAllResourcePoolNotBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("all_resource_pool not between", value1, value2, "allResourcePool");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Criteria extends GeneratedCriteria {
|
public static class Criteria extends GeneratedCriteria {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<result column="delete_user" jdbcType="VARCHAR" property="deleteUser" />
|
<result column="delete_user" jdbcType="VARCHAR" property="deleteUser" />
|
||||||
<result column="enable" jdbcType="BIT" property="enable" />
|
<result column="enable" jdbcType="BIT" property="enable" />
|
||||||
<result column="module_setting" jdbcType="VARCHAR" property="moduleSetting" />
|
<result column="module_setting" jdbcType="VARCHAR" property="moduleSetting" />
|
||||||
|
<result column="all_resource_pool" jdbcType="BIT" property="allResourcePool" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Example_Where_Clause">
|
<sql id="Example_Where_Clause">
|
||||||
<where>
|
<where>
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, num, organization_id, `name`, description, create_time, update_time, update_user,
|
id, num, organization_id, `name`, description, create_time, update_time, update_user,
|
||||||
create_user, delete_time, deleted, delete_user, `enable`, module_setting
|
create_user, delete_time, deleted, delete_user, `enable`, module_setting, all_resource_pool
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByExample" parameterType="io.metersphere.project.domain.ProjectExample" resultMap="BaseResultMap">
|
<select id="selectByExample" parameterType="io.metersphere.project.domain.ProjectExample" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
|
@ -114,12 +115,14 @@
|
||||||
`name`, description, create_time,
|
`name`, description, create_time,
|
||||||
update_time, update_user, create_user,
|
update_time, update_user, create_user,
|
||||||
delete_time, deleted, delete_user,
|
delete_time, deleted, delete_user,
|
||||||
`enable`, module_setting)
|
`enable`, module_setting, all_resource_pool
|
||||||
|
)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR},
|
||||||
#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
|
#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
|
||||||
#{updateTime,jdbcType=BIGINT}, #{updateUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
|
#{updateTime,jdbcType=BIGINT}, #{updateUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
|
||||||
#{deleteTime,jdbcType=BIGINT}, #{deleted,jdbcType=BIT}, #{deleteUser,jdbcType=VARCHAR},
|
#{deleteTime,jdbcType=BIGINT}, #{deleted,jdbcType=BIT}, #{deleteUser,jdbcType=VARCHAR},
|
||||||
#{enable,jdbcType=BIT}, #{moduleSetting,jdbcType=VARCHAR})
|
#{enable,jdbcType=BIT}, #{moduleSetting,jdbcType=VARCHAR}, #{allResourcePool,jdbcType=BIT}
|
||||||
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="io.metersphere.project.domain.Project">
|
<insert id="insertSelective" parameterType="io.metersphere.project.domain.Project">
|
||||||
insert into project
|
insert into project
|
||||||
|
@ -166,6 +169,9 @@
|
||||||
<if test="moduleSetting != null">
|
<if test="moduleSetting != null">
|
||||||
module_setting,
|
module_setting,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="allResourcePool != null">
|
||||||
|
all_resource_pool,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
|
@ -210,6 +216,9 @@
|
||||||
<if test="moduleSetting != null">
|
<if test="moduleSetting != null">
|
||||||
#{moduleSetting,jdbcType=VARCHAR},
|
#{moduleSetting,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="allResourcePool != null">
|
||||||
|
#{allResourcePool,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<select id="countByExample" parameterType="io.metersphere.project.domain.ProjectExample" resultType="java.lang.Long">
|
<select id="countByExample" parameterType="io.metersphere.project.domain.ProjectExample" resultType="java.lang.Long">
|
||||||
|
@ -263,6 +272,9 @@
|
||||||
<if test="record.moduleSetting != null">
|
<if test="record.moduleSetting != null">
|
||||||
module_setting = #{record.moduleSetting,jdbcType=VARCHAR},
|
module_setting = #{record.moduleSetting,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.allResourcePool != null">
|
||||||
|
all_resource_pool = #{record.allResourcePool,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
@ -283,7 +295,8 @@
|
||||||
deleted = #{record.deleted,jdbcType=BIT},
|
deleted = #{record.deleted,jdbcType=BIT},
|
||||||
delete_user = #{record.deleteUser,jdbcType=VARCHAR},
|
delete_user = #{record.deleteUser,jdbcType=VARCHAR},
|
||||||
`enable` = #{record.enable,jdbcType=BIT},
|
`enable` = #{record.enable,jdbcType=BIT},
|
||||||
module_setting = #{record.moduleSetting,jdbcType=VARCHAR}
|
module_setting = #{record.moduleSetting,jdbcType=VARCHAR},
|
||||||
|
all_resource_pool = #{record.allResourcePool,jdbcType=BIT}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
|
@ -330,6 +343,9 @@
|
||||||
<if test="moduleSetting != null">
|
<if test="moduleSetting != null">
|
||||||
module_setting = #{moduleSetting,jdbcType=VARCHAR},
|
module_setting = #{moduleSetting,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="allResourcePool != null">
|
||||||
|
all_resource_pool = #{allResourcePool,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
|
@ -347,20 +363,23 @@
|
||||||
deleted = #{deleted,jdbcType=BIT},
|
deleted = #{deleted,jdbcType=BIT},
|
||||||
delete_user = #{deleteUser,jdbcType=VARCHAR},
|
delete_user = #{deleteUser,jdbcType=VARCHAR},
|
||||||
`enable` = #{enable,jdbcType=BIT},
|
`enable` = #{enable,jdbcType=BIT},
|
||||||
module_setting = #{moduleSetting,jdbcType=VARCHAR}
|
module_setting = #{moduleSetting,jdbcType=VARCHAR},
|
||||||
|
all_resource_pool = #{allResourcePool,jdbcType=BIT}
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
<insert id="batchInsert" parameterType="map">
|
<insert id="batchInsert" parameterType="map">
|
||||||
insert into project
|
insert into project
|
||||||
(id, num, organization_id, `name`, description, create_time, update_time, update_user,
|
(id, num, organization_id, `name`, description, create_time, update_time, update_user,
|
||||||
create_user, delete_time, deleted, delete_user, `enable`, module_setting)
|
create_user, delete_time, deleted, delete_user, `enable`, module_setting, all_resource_pool
|
||||||
|
)
|
||||||
values
|
values
|
||||||
<foreach collection="list" item="item" separator=",">
|
<foreach collection="list" item="item" separator=",">
|
||||||
(#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=BIGINT}, #{item.organizationId,jdbcType=VARCHAR},
|
(#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=BIGINT}, #{item.organizationId,jdbcType=VARCHAR},
|
||||||
#{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT},
|
#{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT},
|
||||||
#{item.updateTime,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR},
|
#{item.updateTime,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR},
|
||||||
#{item.deleteTime,jdbcType=BIGINT}, #{item.deleted,jdbcType=BIT}, #{item.deleteUser,jdbcType=VARCHAR},
|
#{item.deleteTime,jdbcType=BIGINT}, #{item.deleted,jdbcType=BIT}, #{item.deleteUser,jdbcType=VARCHAR},
|
||||||
#{item.enable,jdbcType=BIT}, #{item.moduleSetting,jdbcType=VARCHAR})
|
#{item.enable,jdbcType=BIT}, #{item.moduleSetting,jdbcType=VARCHAR}, #{item.allResourcePool,jdbcType=BIT}
|
||||||
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="batchInsertSelective" parameterType="map">
|
<insert id="batchInsertSelective" parameterType="map">
|
||||||
|
@ -415,6 +434,9 @@
|
||||||
<if test="'module_setting'.toString() == column.value">
|
<if test="'module_setting'.toString() == column.value">
|
||||||
#{item.moduleSetting,jdbcType=VARCHAR}
|
#{item.moduleSetting,jdbcType=VARCHAR}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="'all_resource_pool'.toString() == column.value">
|
||||||
|
#{item.allResourcePool,jdbcType=BIT}
|
||||||
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
@ -70,5 +70,11 @@ CREATE INDEX idx_start_time ON exec_task_item(start_time desc);
|
||||||
CREATE INDEX idx_end_time ON exec_task_item(end_time desc);
|
CREATE INDEX idx_end_time ON exec_task_item(end_time desc);
|
||||||
CREATE INDEX idx_executor ON exec_task_item(executor);
|
CREATE INDEX idx_executor ON exec_task_item(executor);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE project
|
||||||
|
ADD all_resource_pool BIT DEFAULT b'0' NOT NULL COMMENT '全部资源池';
|
||||||
|
|
||||||
|
CREATE INDEX idx_all_resource_pool ON project(all_resource_pool);
|
||||||
|
|
||||||
-- set innodb lock wait timeout to default
|
-- set innodb lock wait timeout to default
|
||||||
SET SESSION innodb_lock_wait_timeout = DEFAULT;
|
SET SESSION innodb_lock_wait_timeout = DEFAULT;
|
|
@ -18,10 +18,7 @@ public class ApiCaseBatchEditRequest extends ApiTestCaseBatchRequest implements
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "标签")
|
@Schema(description = "标签")
|
||||||
private LinkedHashSet<
|
private LinkedHashSet<String> tags;
|
||||||
@NotBlank
|
|
||||||
@Size(min = 1, max = 64, message = "{api_test_case.tag.length_range}")
|
|
||||||
String> tags;
|
|
||||||
@Schema(description = "批量编辑的类型 用例等级: Priority,状态 :Status,标签: Tags,用例环境: Environment")
|
@Schema(description = "批量编辑的类型 用例等级: Priority,状态 :Status,标签: Tags,用例环境: Environment")
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String type;
|
private String type;
|
||||||
|
|
|
@ -2,7 +2,6 @@ package io.metersphere.api.dto.definition;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@ -18,10 +17,7 @@ public class ApiMockBatchEditRequest extends ApiTestCaseBatchRequest implements
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "标签")
|
@Schema(description = "标签")
|
||||||
private LinkedHashSet<
|
private LinkedHashSet<String> tags;
|
||||||
@NotBlank
|
|
||||||
@Size(min = 1, max = 64, message = "{api_test_case.tag.length_range}")
|
|
||||||
String> tags;
|
|
||||||
@Schema(description = "批量编辑的类型 状态 :Status,标签: Tags")
|
@Schema(description = "批量编辑的类型 状态 :Status,标签: Tags")
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String type;
|
private String type;
|
||||||
|
|
|
@ -18,10 +18,7 @@ public class ApiScenarioBatchEditRequest extends ApiScenarioBatchRequest impleme
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "标签")
|
@Schema(description = "标签")
|
||||||
private LinkedHashSet<
|
private LinkedHashSet<String> tags;
|
||||||
@NotBlank
|
|
||||||
@Size(min = 1, max = 64, message = "{api_test_case.tag.length_range}")
|
|
||||||
String> tags;
|
|
||||||
@Schema(description = "批量编辑的类型 用例等级: Priority,状态 :Status,标签: Tags,用例环境: Environment")
|
@Schema(description = "批量编辑的类型 用例等级: Priority,状态 :Status,标签: Tags,用例环境: Environment")
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String type;
|
private String type;
|
||||||
|
|
|
@ -1033,8 +1033,16 @@ public class FunctionalCaseService {
|
||||||
functionalCase.setUpdateUser(userId);
|
functionalCase.setUpdateUser(userId);
|
||||||
extFunctionalCaseMapper.batchUpdate(functionalCase, ids);
|
extFunctionalCaseMapper.batchUpdate(functionalCase, ids);
|
||||||
}
|
}
|
||||||
|
} else if (request.isClear()){
|
||||||
|
FunctionalCase functionalCase = new FunctionalCase();
|
||||||
|
functionalCase.setTags(new ArrayList<>());
|
||||||
|
functionalCase.setProjectId(request.getProjectId());
|
||||||
|
functionalCase.setUpdateTime(System.currentTimeMillis());
|
||||||
|
functionalCase.setUpdateUser(userId);
|
||||||
|
extFunctionalCaseMapper.batchUpdate(functionalCase, ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Long> moduleCount(FunctionalCasePageRequest request, boolean delete) {
|
public Map<String, Long> moduleCount(FunctionalCasePageRequest request, boolean delete) {
|
||||||
|
|
|
@ -691,6 +691,34 @@ public class FunctionalCaseControllerTests extends BaseTest {
|
||||||
this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_BATCH_EDIT_URL, request);
|
this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_BATCH_EDIT_URL, request);
|
||||||
functionalCase = functionalCaseMapper.selectByPrimaryKey("TEST_FUNCTIONAL_CASE_ID_1");
|
functionalCase = functionalCaseMapper.selectByPrimaryKey("TEST_FUNCTIONAL_CASE_ID_1");
|
||||||
Assertions.assertTrue(CollectionUtils.isEmpty(functionalCase.getTags()));
|
Assertions.assertTrue(CollectionUtils.isEmpty(functionalCase.getTags()));
|
||||||
|
request.setAppend(false);
|
||||||
|
request.setClear(false);
|
||||||
|
request.setTags(Arrays.asList("覆盖标签1", "覆盖标签2"));
|
||||||
|
request.setSelectAll(true);
|
||||||
|
this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_BATCH_EDIT_URL, request);
|
||||||
|
functionalCase = functionalCaseMapper.selectByPrimaryKey("TEST_FUNCTIONAL_CASE_ID_1");
|
||||||
|
Assertions.assertTrue(CollectionUtils.isNotEmpty(functionalCase.getTags()));
|
||||||
|
request.setAppend(false);
|
||||||
|
request.setClear(false);
|
||||||
|
request.setTags(new ArrayList<>());
|
||||||
|
request.setSelectAll(true);
|
||||||
|
this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_BATCH_EDIT_URL, request);
|
||||||
|
functionalCase = functionalCaseMapper.selectByPrimaryKey("TEST_FUNCTIONAL_CASE_ID_1");
|
||||||
|
Assertions.assertTrue(CollectionUtils.isNotEmpty(functionalCase.getTags()));
|
||||||
|
request.setAppend(false);
|
||||||
|
request.setClear(true);
|
||||||
|
request.setTags(new ArrayList<>());
|
||||||
|
request.setSelectAll(true);
|
||||||
|
this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_BATCH_EDIT_URL, request);
|
||||||
|
functionalCase = functionalCaseMapper.selectByPrimaryKey("TEST_FUNCTIONAL_CASE_ID_1");
|
||||||
|
Assertions.assertTrue(CollectionUtils.isEmpty(functionalCase.getTags()));
|
||||||
|
request.setAppend(false);
|
||||||
|
request.setClear(false);
|
||||||
|
request.setTags(new ArrayList<>());
|
||||||
|
request.setSelectAll(true);
|
||||||
|
this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_BATCH_EDIT_URL, request);
|
||||||
|
functionalCase = functionalCaseMapper.selectByPrimaryKey("TEST_FUNCTIONAL_CASE_ID_1");
|
||||||
|
Assertions.assertTrue(CollectionUtils.isEmpty(functionalCase.getTags()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,9 @@ public class ProjectBaseRequest {
|
||||||
@Schema(description = "是否启用")
|
@Schema(description = "是否启用")
|
||||||
private Boolean enable;
|
private Boolean enable;
|
||||||
|
|
||||||
|
@Schema(description = "全部资源池")
|
||||||
|
private boolean allResourcePool = false;
|
||||||
|
|
||||||
@Schema(description = "模块设置", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
@Schema(description = "模块设置", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
private List<String> moduleIds;
|
private List<String> moduleIds;
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,7 @@ public class CommonProjectService {
|
||||||
project.setUpdateUser(createUser);
|
project.setUpdateUser(createUser);
|
||||||
project.setCreateUser(createUser);
|
project.setCreateUser(createUser);
|
||||||
project.setEnable(addProjectDTO.getEnable());
|
project.setEnable(addProjectDTO.getEnable());
|
||||||
|
project.setAllResourcePool(addProjectDTO.isAllResourcePool());
|
||||||
project.setDescription(addProjectDTO.getDescription());
|
project.setDescription(addProjectDTO.getDescription());
|
||||||
addProjectDTO.setId(project.getId());
|
addProjectDTO.setId(project.getId());
|
||||||
BeanUtils.copyBean(projectDTO, project);
|
BeanUtils.copyBean(projectDTO, project);
|
||||||
|
|
|
@ -800,6 +800,14 @@ public class TestPlanService extends TestPlanBaseUtilsService {
|
||||||
testPlan.setUpdateUser(userId);
|
testPlan.setUpdateUser(userId);
|
||||||
extTestPlanMapper.batchUpdate(testPlan, ids);
|
extTestPlanMapper.batchUpdate(testPlan, ids);
|
||||||
}
|
}
|
||||||
|
} else if (request.isClear()){
|
||||||
|
//替换标签
|
||||||
|
TestPlan testPlan = new TestPlan();
|
||||||
|
testPlan.setTags(new ArrayList<>());
|
||||||
|
testPlan.setProjectId(request.getProjectId());
|
||||||
|
testPlan.setUpdateTime(System.currentTimeMillis());
|
||||||
|
testPlan.setUpdateUser(userId);
|
||||||
|
extTestPlanMapper.batchUpdate(testPlan, ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2425,6 +2425,28 @@ public class TestPlanTests extends BaseTest {
|
||||||
this.requestPostWithOkAndReturn(URL_TEST_PLAN_BATCH_EDIT, request);
|
this.requestPostWithOkAndReturn(URL_TEST_PLAN_BATCH_EDIT, request);
|
||||||
testPlan = testPlanMapper.selectByPrimaryKey("wx_test_plan_id_1");
|
testPlan = testPlanMapper.selectByPrimaryKey("wx_test_plan_id_1");
|
||||||
Assertions.assertTrue(CollectionUtils.isEmpty(testPlan.getTags()));
|
Assertions.assertTrue(CollectionUtils.isEmpty(testPlan.getTags()));
|
||||||
|
request.setTags(List.of("tag1"));
|
||||||
|
request.setAppend(false);
|
||||||
|
request.setClear(false);
|
||||||
|
request.setSelectAll(true);
|
||||||
|
this.requestPostWithOkAndReturn(URL_TEST_PLAN_BATCH_EDIT, request);
|
||||||
|
testPlan = testPlanMapper.selectByPrimaryKey("wx_test_plan_id_1");
|
||||||
|
Assertions.assertTrue(CollectionUtils.isNotEmpty(testPlan.getTags()));
|
||||||
|
request.setTags(new ArrayList<>());
|
||||||
|
request.setAppend(false);
|
||||||
|
request.setClear(false);
|
||||||
|
request.setSelectAll(true);
|
||||||
|
this.requestPostWithOkAndReturn(URL_TEST_PLAN_BATCH_EDIT, request);
|
||||||
|
testPlan = testPlanMapper.selectByPrimaryKey("wx_test_plan_id_1");
|
||||||
|
Assertions.assertTrue(CollectionUtils.isNotEmpty(testPlan.getTags()));
|
||||||
|
request.setTags(new ArrayList<>());
|
||||||
|
request.setAppend(false);
|
||||||
|
request.setClear(true);
|
||||||
|
request.setSelectAll(true);
|
||||||
|
this.requestPostWithOkAndReturn(URL_TEST_PLAN_BATCH_EDIT, request);
|
||||||
|
testPlan = testPlanMapper.selectByPrimaryKey("wx_test_plan_id_1");
|
||||||
|
Assertions.assertTrue(CollectionUtils.isEmpty(testPlan.getTags()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue