refactor: 接口定义关注人多选
This commit is contained in:
parent
219ccc7c4b
commit
4e5807687a
|
@ -324,4 +324,9 @@ public class ApiDefinitionController {
|
|||
public Pager< List<ApiDefinitionResult>> getRelationshipRelateList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiDefinitionRequest request) {
|
||||
return apiDefinitionService.getRelationshipRelateList(request, goPage, pageSize);
|
||||
}
|
||||
|
||||
@GetMapping("/follow/{definitionId}")
|
||||
public List<String> getFollows(@PathVariable String definitionId) {
|
||||
return apiDefinitionService.getFollows(definitionId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class SaveApiDefinitionRequest {
|
|||
|
||||
private String userId;
|
||||
|
||||
private String followPeople;
|
||||
private List<String> follows;
|
||||
|
||||
private String remark;
|
||||
|
||||
|
|
|
@ -123,6 +123,8 @@ public class ApiDefinitionService {
|
|||
private ExtApiTestCaseMapper extApiTestCaseMapper;
|
||||
@Resource
|
||||
private RelationshipEdgeService relationshipEdgeService;
|
||||
@Resource
|
||||
private ApiDefinitionFollowMapper apiDefinitionFollowMapper;
|
||||
|
||||
private static Cache cache = Cache.newHardMemoryCache(0, 3600);
|
||||
|
||||
|
@ -476,7 +478,6 @@ public class ApiDefinitionService {
|
|||
test.setEnvironmentId(request.getEnvironmentId());
|
||||
test.setUserId(request.getUserId());
|
||||
test.setRemark(request.getRemark());
|
||||
test.setFollowPeople(request.getFollowPeople());
|
||||
if (StringUtils.isNotEmpty(request.getTags()) && !StringUtils.equals(request.getTags(), "[]")) {
|
||||
test.setTags(request.getTags());
|
||||
} else {
|
||||
|
@ -488,10 +489,24 @@ public class ApiDefinitionService {
|
|||
List<String> ids = new ArrayList<>();
|
||||
ids.add(request.getId());
|
||||
apiTestCaseService.updateByApiDefinitionId(ids, test.getPath(), test.getMethod(), test.getProtocol());
|
||||
|
||||
saveFollows(test.getId(), request.getFollows());
|
||||
return test;
|
||||
}
|
||||
|
||||
private void saveFollows(String definitionId, List<String> follows) {
|
||||
ApiDefinitionFollowExample example = new ApiDefinitionFollowExample();
|
||||
example.createCriteria().andDefinitionIdEqualTo(definitionId);
|
||||
apiDefinitionFollowMapper.deleteByExample(example);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(follows)) {
|
||||
for (String follow : follows) {
|
||||
ApiDefinitionFollow item = new ApiDefinitionFollow();
|
||||
item.setDefinitionId(definitionId);
|
||||
item.setFollowId(follow);
|
||||
apiDefinitionFollowMapper.insert(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ApiDefinitionWithBLOBs createTest(SaveApiDefinitionRequest request) {
|
||||
checkNameExist(request);
|
||||
if (StringUtils.equals(request.getMethod(), "ESB")) {
|
||||
|
@ -513,7 +528,6 @@ public class ApiDefinitionService {
|
|||
test.setStatus(APITestStatus.Underway.name());
|
||||
test.setModulePath(request.getModulePath());
|
||||
test.setModuleId(request.getModuleId());
|
||||
test.setFollowPeople(request.getFollowPeople());
|
||||
test.setRemark(request.getRemark());
|
||||
test.setOrder(ServiceUtils.getNextOrder(request.getProjectId(), extApiDefinitionMapper::getLastOrder));
|
||||
if (StringUtils.isEmpty(request.getModuleId()) || "default-module".equals(request.getModuleId())) {
|
||||
|
@ -540,6 +554,7 @@ public class ApiDefinitionService {
|
|||
test.setTags("");
|
||||
}
|
||||
apiDefinitionMapper.insert(test);
|
||||
saveFollows(test.getId(), request.getFollows());
|
||||
return test;
|
||||
}
|
||||
|
||||
|
@ -870,8 +885,8 @@ public class ApiDefinitionService {
|
|||
public void addResult(TestResult res) {
|
||||
if (res != null && CollectionUtils.isNotEmpty(res.getScenarios()) && res.getScenarios().get(0) != null && CollectionUtils.isNotEmpty(res.getScenarios().get(0).getRequestResults())) {
|
||||
RequestResult result = null;
|
||||
for(RequestResult itemResult : res.getScenarios().get(0).getRequestResults()){
|
||||
if(!StringUtils.equalsIgnoreCase(itemResult.getMethod(),"Request") && !StringUtils.startsWithAny(itemResult.getName(),"PRE_PROCESSOR_ENV_","POST_PROCESSOR_ENV_")){
|
||||
for (RequestResult itemResult : res.getScenarios().get(0).getRequestResults()) {
|
||||
if (!StringUtils.equalsIgnoreCase(itemResult.getMethod(), "Request") && !StringUtils.startsWithAny(itemResult.getName(), "PRE_PROCESSOR_ENV_", "POST_PROCESSOR_ENV_")) {
|
||||
result = itemResult;
|
||||
break;
|
||||
}
|
||||
|
@ -1675,4 +1690,15 @@ public class ApiDefinitionService {
|
|||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
return PageUtils.setPageInfo(page, extApiDefinitionMapper.list(request));
|
||||
}
|
||||
|
||||
public List<String> getFollows(String definitionId) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if (StringUtils.isBlank(definitionId)) {
|
||||
return result;
|
||||
}
|
||||
ApiDefinitionFollowExample example = new ApiDefinitionFollowExample();
|
||||
example.createCriteria().andDefinitionIdEqualTo(definitionId);
|
||||
List<ApiDefinitionFollow> follows = apiDefinitionFollowMapper.selectByExample(example);
|
||||
return follows.stream().map(ApiDefinitionFollow::getFollowId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,10 +13,6 @@ public class ApiDefinition implements Serializable {
|
|||
|
||||
private String method;
|
||||
|
||||
private String protocol;
|
||||
|
||||
private String path;
|
||||
|
||||
private String modulePath;
|
||||
|
||||
private String environmentId;
|
||||
|
@ -33,6 +29,10 @@ public class ApiDefinition implements Serializable {
|
|||
|
||||
private Long updateTime;
|
||||
|
||||
private String protocol;
|
||||
|
||||
private String path;
|
||||
|
||||
private Integer num;
|
||||
|
||||
private String tags;
|
||||
|
@ -51,8 +51,6 @@ public class ApiDefinition implements Serializable {
|
|||
|
||||
private String deleteUserId;
|
||||
|
||||
private String followPeople;
|
||||
|
||||
private Long order;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -384,146 +384,6 @@ public class ApiDefinitionExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolIsNull() {
|
||||
addCriterion("protocol is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolIsNotNull() {
|
||||
addCriterion("protocol is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolEqualTo(String value) {
|
||||
addCriterion("protocol =", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolNotEqualTo(String value) {
|
||||
addCriterion("protocol <>", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolGreaterThan(String value) {
|
||||
addCriterion("protocol >", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("protocol >=", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolLessThan(String value) {
|
||||
addCriterion("protocol <", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolLessThanOrEqualTo(String value) {
|
||||
addCriterion("protocol <=", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolLike(String value) {
|
||||
addCriterion("protocol like", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolNotLike(String value) {
|
||||
addCriterion("protocol not like", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolIn(List<String> values) {
|
||||
addCriterion("protocol in", values, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolNotIn(List<String> values) {
|
||||
addCriterion("protocol not in", values, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolBetween(String value1, String value2) {
|
||||
addCriterion("protocol between", value1, value2, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolNotBetween(String value1, String value2) {
|
||||
addCriterion("protocol not between", value1, value2, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathIsNull() {
|
||||
addCriterion("`path` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathIsNotNull() {
|
||||
addCriterion("`path` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathEqualTo(String value) {
|
||||
addCriterion("`path` =", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathNotEqualTo(String value) {
|
||||
addCriterion("`path` <>", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathGreaterThan(String value) {
|
||||
addCriterion("`path` >", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`path` >=", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathLessThan(String value) {
|
||||
addCriterion("`path` <", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathLessThanOrEqualTo(String value) {
|
||||
addCriterion("`path` <=", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathLike(String value) {
|
||||
addCriterion("`path` like", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathNotLike(String value) {
|
||||
addCriterion("`path` not like", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathIn(List<String> values) {
|
||||
addCriterion("`path` in", values, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathNotIn(List<String> values) {
|
||||
addCriterion("`path` not in", values, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathBetween(String value1, String value2) {
|
||||
addCriterion("`path` between", value1, value2, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathNotBetween(String value1, String value2) {
|
||||
addCriterion("`path` not between", value1, value2, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andModulePathIsNull() {
|
||||
addCriterion("module_path is null");
|
||||
return (Criteria) this;
|
||||
|
@ -1064,6 +924,146 @@ public class ApiDefinitionExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolIsNull() {
|
||||
addCriterion("protocol is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolIsNotNull() {
|
||||
addCriterion("protocol is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolEqualTo(String value) {
|
||||
addCriterion("protocol =", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolNotEqualTo(String value) {
|
||||
addCriterion("protocol <>", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolGreaterThan(String value) {
|
||||
addCriterion("protocol >", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("protocol >=", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolLessThan(String value) {
|
||||
addCriterion("protocol <", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolLessThanOrEqualTo(String value) {
|
||||
addCriterion("protocol <=", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolLike(String value) {
|
||||
addCriterion("protocol like", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolNotLike(String value) {
|
||||
addCriterion("protocol not like", value, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolIn(List<String> values) {
|
||||
addCriterion("protocol in", values, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolNotIn(List<String> values) {
|
||||
addCriterion("protocol not in", values, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolBetween(String value1, String value2) {
|
||||
addCriterion("protocol between", value1, value2, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProtocolNotBetween(String value1, String value2) {
|
||||
addCriterion("protocol not between", value1, value2, "protocol");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathIsNull() {
|
||||
addCriterion("`path` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathIsNotNull() {
|
||||
addCriterion("`path` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathEqualTo(String value) {
|
||||
addCriterion("`path` =", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathNotEqualTo(String value) {
|
||||
addCriterion("`path` <>", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathGreaterThan(String value) {
|
||||
addCriterion("`path` >", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`path` >=", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathLessThan(String value) {
|
||||
addCriterion("`path` <", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathLessThanOrEqualTo(String value) {
|
||||
addCriterion("`path` <=", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathLike(String value) {
|
||||
addCriterion("`path` like", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathNotLike(String value) {
|
||||
addCriterion("`path` not like", value, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathIn(List<String> values) {
|
||||
addCriterion("`path` in", values, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathNotIn(List<String> values) {
|
||||
addCriterion("`path` not in", values, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathBetween(String value1, String value2) {
|
||||
addCriterion("`path` between", value1, value2, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPathNotBetween(String value1, String value2) {
|
||||
addCriterion("`path` not between", value1, value2, "path");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumIsNull() {
|
||||
addCriterion("num is null");
|
||||
return (Criteria) this;
|
||||
|
@ -1674,76 +1674,6 @@ public class ApiDefinitionExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleIsNull() {
|
||||
addCriterion("follow_people is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleIsNotNull() {
|
||||
addCriterion("follow_people is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleEqualTo(String value) {
|
||||
addCriterion("follow_people =", value, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleNotEqualTo(String value) {
|
||||
addCriterion("follow_people <>", value, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleGreaterThan(String value) {
|
||||
addCriterion("follow_people >", value, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("follow_people >=", value, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleLessThan(String value) {
|
||||
addCriterion("follow_people <", value, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleLessThanOrEqualTo(String value) {
|
||||
addCriterion("follow_people <=", value, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleLike(String value) {
|
||||
addCriterion("follow_people like", value, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleNotLike(String value) {
|
||||
addCriterion("follow_people not like", value, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleIn(List<String> values) {
|
||||
addCriterion("follow_people in", values, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleNotIn(List<String> values) {
|
||||
addCriterion("follow_people not in", values, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleBetween(String value1, String value2) {
|
||||
addCriterion("follow_people between", value1, value2, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFollowPeopleNotBetween(String value1, String value2) {
|
||||
addCriterion("follow_people not between", value1, value2, "followPeople");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIsNull() {
|
||||
addCriterion("`order` is null");
|
||||
return (Criteria) this;
|
||||
|
|
|
@ -18,4 +18,4 @@ public class ApiDefinitionWithBLOBs extends ApiDefinition implements Serializabl
|
|||
private String remark;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
|
@ -6,8 +6,6 @@
|
|||
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="method" jdbcType="VARCHAR" property="method" />
|
||||
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
|
||||
<result column="path" jdbcType="VARCHAR" property="path" />
|
||||
<result column="module_path" jdbcType="VARCHAR" property="modulePath" />
|
||||
<result column="environment_id" jdbcType="VARCHAR" property="environmentId" />
|
||||
<result column="schedule" jdbcType="VARCHAR" property="schedule" />
|
||||
|
@ -16,6 +14,8 @@
|
|||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
|
||||
<result column="path" jdbcType="VARCHAR" property="path" />
|
||||
<result column="num" jdbcType="INTEGER" property="num" />
|
||||
<result column="tags" jdbcType="VARCHAR" property="tags" />
|
||||
<result column="original_state" jdbcType="VARCHAR" property="originalState" />
|
||||
|
@ -25,7 +25,6 @@
|
|||
<result column="case_passing_rate" jdbcType="VARCHAR" property="casePassingRate" />
|
||||
<result column="delete_time" jdbcType="BIGINT" property="deleteTime" />
|
||||
<result column="delete_user_id" jdbcType="VARCHAR" property="deleteUserId" />
|
||||
<result column="follow_people" jdbcType="VARCHAR" property="followPeople" />
|
||||
<result column="order" jdbcType="BIGINT" property="order" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
|
||||
|
@ -93,10 +92,10 @@
|
|||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, project_id, `name`, `method`, protocol, `path`, module_path, environment_id,
|
||||
schedule, `status`, module_id, user_id, create_time, update_time, num, tags, original_state,
|
||||
create_user, case_total, case_status, case_passing_rate, delete_time, delete_user_id,
|
||||
follow_people, `order`
|
||||
id, project_id, `name`, `method`, module_path, environment_id, schedule, `status`,
|
||||
module_id, user_id, create_time, update_time, protocol, `path`, num, tags, original_state,
|
||||
create_user, case_total, case_status, case_passing_rate, delete_time, delete_user_id,
|
||||
`order`
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
description, request, response, remark
|
||||
|
@ -132,7 +131,7 @@
|
|||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
|
@ -150,26 +149,26 @@
|
|||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
|
||||
insert into api_definition (id, project_id, `name`,
|
||||
`method`, protocol, `path`,
|
||||
module_path, environment_id, schedule,
|
||||
`status`, module_id, user_id,
|
||||
create_time, update_time, num,
|
||||
tags, original_state, create_user,
|
||||
case_total, case_status, case_passing_rate,
|
||||
delete_time, delete_user_id, follow_people,
|
||||
`order`, description, request,
|
||||
response, remark)
|
||||
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{method,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR},
|
||||
#{modulePath,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{schedule,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{num,jdbcType=INTEGER},
|
||||
#{tags,jdbcType=VARCHAR}, #{originalState,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
|
||||
#{caseTotal,jdbcType=VARCHAR}, #{caseStatus,jdbcType=VARCHAR}, #{casePassingRate,jdbcType=VARCHAR},
|
||||
#{deleteTime,jdbcType=BIGINT}, #{deleteUserId,jdbcType=VARCHAR}, #{followPeople,jdbcType=VARCHAR},
|
||||
#{order,jdbcType=BIGINT}, #{description,jdbcType=LONGVARCHAR}, #{request,jdbcType=LONGVARCHAR},
|
||||
#{response,jdbcType=LONGVARCHAR}, #{remark,jdbcType=LONGVARCHAR})
|
||||
insert into api_definition (id, project_id, `name`,
|
||||
`method`, module_path, environment_id,
|
||||
schedule, `status`, module_id,
|
||||
user_id, create_time, update_time,
|
||||
protocol, `path`, num,
|
||||
tags, original_state, create_user,
|
||||
case_total, case_status, case_passing_rate,
|
||||
delete_time, delete_user_id, `order`,
|
||||
description, request, response,
|
||||
remark)
|
||||
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{method,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR},
|
||||
#{schedule,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{moduleId,jdbcType=VARCHAR},
|
||||
#{userId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||
#{protocol,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER},
|
||||
#{tags,jdbcType=VARCHAR}, #{originalState,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
|
||||
#{caseTotal,jdbcType=VARCHAR}, #{caseStatus,jdbcType=VARCHAR}, #{casePassingRate,jdbcType=VARCHAR},
|
||||
#{deleteTime,jdbcType=BIGINT}, #{deleteUserId,jdbcType=VARCHAR}, #{order,jdbcType=BIGINT},
|
||||
#{description,jdbcType=LONGVARCHAR}, #{request,jdbcType=LONGVARCHAR}, #{response,jdbcType=LONGVARCHAR},
|
||||
#{remark,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiDefinitionWithBLOBs">
|
||||
insert into api_definition
|
||||
|
@ -186,12 +185,6 @@
|
|||
<if test="method != null">
|
||||
`method`,
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
protocol,
|
||||
</if>
|
||||
<if test="path != null">
|
||||
`path`,
|
||||
</if>
|
||||
<if test="modulePath != null">
|
||||
module_path,
|
||||
</if>
|
||||
|
@ -216,6 +209,12 @@
|
|||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
protocol,
|
||||
</if>
|
||||
<if test="path != null">
|
||||
`path`,
|
||||
</if>
|
||||
<if test="num != null">
|
||||
num,
|
||||
</if>
|
||||
|
@ -243,9 +242,6 @@
|
|||
<if test="deleteUserId != null">
|
||||
delete_user_id,
|
||||
</if>
|
||||
<if test="followPeople != null">
|
||||
follow_people,
|
||||
</if>
|
||||
<if test="order != null">
|
||||
`order`,
|
||||
</if>
|
||||
|
@ -275,12 +271,6 @@
|
|||
<if test="method != null">
|
||||
#{method,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
#{protocol,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="path != null">
|
||||
#{path,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="modulePath != null">
|
||||
#{modulePath,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -305,6 +295,12 @@
|
|||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
#{protocol,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="path != null">
|
||||
#{path,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="num != null">
|
||||
#{num,jdbcType=INTEGER},
|
||||
</if>
|
||||
|
@ -332,9 +328,6 @@
|
|||
<if test="deleteUserId != null">
|
||||
#{deleteUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="followPeople != null">
|
||||
#{followPeople,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="order != null">
|
||||
#{order,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -373,12 +366,6 @@
|
|||
<if test="record.method != null">
|
||||
`method` = #{record.method,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.protocol != null">
|
||||
protocol = #{record.protocol,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.path != null">
|
||||
`path` = #{record.path,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.modulePath != null">
|
||||
module_path = #{record.modulePath,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -403,6 +390,12 @@
|
|||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.protocol != null">
|
||||
protocol = #{record.protocol,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.path != null">
|
||||
`path` = #{record.path,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.num != null">
|
||||
num = #{record.num,jdbcType=INTEGER},
|
||||
</if>
|
||||
|
@ -430,9 +423,6 @@
|
|||
<if test="record.deleteUserId != null">
|
||||
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.followPeople != null">
|
||||
follow_people = #{record.followPeople,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.order != null">
|
||||
`order` = #{record.order,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -459,8 +449,6 @@
|
|||
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||
`name` = #{record.name,jdbcType=VARCHAR},
|
||||
`method` = #{record.method,jdbcType=VARCHAR},
|
||||
protocol = #{record.protocol,jdbcType=VARCHAR},
|
||||
`path` = #{record.path,jdbcType=VARCHAR},
|
||||
module_path = #{record.modulePath,jdbcType=VARCHAR},
|
||||
environment_id = #{record.environmentId,jdbcType=VARCHAR},
|
||||
schedule = #{record.schedule,jdbcType=VARCHAR},
|
||||
|
@ -469,6 +457,8 @@
|
|||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
protocol = #{record.protocol,jdbcType=VARCHAR},
|
||||
`path` = #{record.path,jdbcType=VARCHAR},
|
||||
num = #{record.num,jdbcType=INTEGER},
|
||||
tags = #{record.tags,jdbcType=VARCHAR},
|
||||
original_state = #{record.originalState,jdbcType=VARCHAR},
|
||||
|
@ -478,7 +468,6 @@
|
|||
case_passing_rate = #{record.casePassingRate,jdbcType=VARCHAR},
|
||||
delete_time = #{record.deleteTime,jdbcType=BIGINT},
|
||||
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
|
||||
follow_people = #{record.followPeople,jdbcType=VARCHAR},
|
||||
`order` = #{record.order,jdbcType=BIGINT},
|
||||
description = #{record.description,jdbcType=LONGVARCHAR},
|
||||
request = #{record.request,jdbcType=LONGVARCHAR},
|
||||
|
@ -494,8 +483,6 @@
|
|||
project_id = #{record.projectId,jdbcType=VARCHAR},
|
||||
`name` = #{record.name,jdbcType=VARCHAR},
|
||||
`method` = #{record.method,jdbcType=VARCHAR},
|
||||
protocol = #{record.protocol,jdbcType=VARCHAR},
|
||||
`path` = #{record.path,jdbcType=VARCHAR},
|
||||
module_path = #{record.modulePath,jdbcType=VARCHAR},
|
||||
environment_id = #{record.environmentId,jdbcType=VARCHAR},
|
||||
schedule = #{record.schedule,jdbcType=VARCHAR},
|
||||
|
@ -504,6 +491,8 @@
|
|||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
protocol = #{record.protocol,jdbcType=VARCHAR},
|
||||
`path` = #{record.path,jdbcType=VARCHAR},
|
||||
num = #{record.num,jdbcType=INTEGER},
|
||||
tags = #{record.tags,jdbcType=VARCHAR},
|
||||
original_state = #{record.originalState,jdbcType=VARCHAR},
|
||||
|
@ -513,7 +502,6 @@
|
|||
case_passing_rate = #{record.casePassingRate,jdbcType=VARCHAR},
|
||||
delete_time = #{record.deleteTime,jdbcType=BIGINT},
|
||||
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
|
||||
follow_people = #{record.followPeople,jdbcType=VARCHAR},
|
||||
`order` = #{record.order,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
|
@ -531,12 +519,6 @@
|
|||
<if test="method != null">
|
||||
`method` = #{method,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
protocol = #{protocol,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="path != null">
|
||||
`path` = #{path,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="modulePath != null">
|
||||
module_path = #{modulePath,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
@ -561,6 +543,12 @@
|
|||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
protocol = #{protocol,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="path != null">
|
||||
`path` = #{path,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="num != null">
|
||||
num = #{num,jdbcType=INTEGER},
|
||||
</if>
|
||||
|
@ -588,9 +576,6 @@
|
|||
<if test="deleteUserId != null">
|
||||
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="followPeople != null">
|
||||
follow_people = #{followPeople,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="order != null">
|
||||
`order` = #{order,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
@ -614,8 +599,6 @@
|
|||
set project_id = #{projectId,jdbcType=VARCHAR},
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
`method` = #{method,jdbcType=VARCHAR},
|
||||
protocol = #{protocol,jdbcType=VARCHAR},
|
||||
`path` = #{path,jdbcType=VARCHAR},
|
||||
module_path = #{modulePath,jdbcType=VARCHAR},
|
||||
environment_id = #{environmentId,jdbcType=VARCHAR},
|
||||
schedule = #{schedule,jdbcType=VARCHAR},
|
||||
|
@ -624,6 +607,8 @@
|
|||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
protocol = #{protocol,jdbcType=VARCHAR},
|
||||
`path` = #{path,jdbcType=VARCHAR},
|
||||
num = #{num,jdbcType=INTEGER},
|
||||
tags = #{tags,jdbcType=VARCHAR},
|
||||
original_state = #{originalState,jdbcType=VARCHAR},
|
||||
|
@ -633,7 +618,6 @@
|
|||
case_passing_rate = #{casePassingRate,jdbcType=VARCHAR},
|
||||
delete_time = #{deleteTime,jdbcType=BIGINT},
|
||||
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
|
||||
follow_people = #{followPeople,jdbcType=VARCHAR},
|
||||
`order` = #{order,jdbcType=BIGINT},
|
||||
description = #{description,jdbcType=LONGVARCHAR},
|
||||
request = #{request,jdbcType=LONGVARCHAR},
|
||||
|
@ -646,8 +630,6 @@
|
|||
set project_id = #{projectId,jdbcType=VARCHAR},
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
`method` = #{method,jdbcType=VARCHAR},
|
||||
protocol = #{protocol,jdbcType=VARCHAR},
|
||||
`path` = #{path,jdbcType=VARCHAR},
|
||||
module_path = #{modulePath,jdbcType=VARCHAR},
|
||||
environment_id = #{environmentId,jdbcType=VARCHAR},
|
||||
schedule = #{schedule,jdbcType=VARCHAR},
|
||||
|
@ -656,6 +638,8 @@
|
|||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
protocol = #{protocol,jdbcType=VARCHAR},
|
||||
`path` = #{path,jdbcType=VARCHAR},
|
||||
num = #{num,jdbcType=INTEGER},
|
||||
tags = #{tags,jdbcType=VARCHAR},
|
||||
original_state = #{originalState,jdbcType=VARCHAR},
|
||||
|
@ -665,8 +649,7 @@
|
|||
case_passing_rate = #{casePassingRate,jdbcType=VARCHAR},
|
||||
delete_time = #{deleteTime,jdbcType=BIGINT},
|
||||
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
|
||||
follow_people = #{followPeople,jdbcType=VARCHAR},
|
||||
`order` = #{order,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
||||
</mapper>
|
|
@ -367,4 +367,18 @@ INSERT INTO api_scenario_follow
|
|||
SELECT id, follow_people
|
||||
FROM api_scenario
|
||||
WHERE follow_people IS NOT NULL;
|
||||
ALTER TABLE api_scenario DROP COLUMN follow_people;
|
||||
ALTER TABLE api_scenario DROP COLUMN follow_people;
|
||||
|
||||
-- 接口定义关注人
|
||||
CREATE TABLE IF NOT EXISTS `api_definition_follow` (
|
||||
`definition_id` VARCHAR(50) DEFAULT NULL,
|
||||
`follow_id` VARCHAR(50) DEFAULT NULL,
|
||||
UNIQUE KEY `api_definition_follow_scenario_id_follow_id_pk` (`definition_id`, `follow_id`),
|
||||
KEY `api_definition_follow_id_index` (`follow_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
|
||||
-- 接口定义数据迁移
|
||||
INSERT INTO api_definition_follow
|
||||
SELECT id, follow_people
|
||||
FROM api_definition
|
||||
WHERE follow_people IS NOT NULL;
|
||||
ALTER TABLE api_definition DROP COLUMN follow_people;
|
|
@ -47,8 +47,8 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('api_test.automation.follow_people')" prop="followPeople">
|
||||
<el-select v-model="basicForm.followPeople"
|
||||
clearable
|
||||
<el-select v-model="basicForm.follows"
|
||||
clearable multiple
|
||||
:placeholder="$t('api_test.automation.follow_people')" filterable size="small"
|
||||
class="ms-http-textarea">
|
||||
<el-option
|
||||
|
@ -95,6 +95,9 @@
|
|||
created() {
|
||||
this.getMaintainerOptions();
|
||||
this.basicForm = this.basisData;
|
||||
this.$get('/api/definition/follow/' + this.basisData.id, response => {
|
||||
this.basicForm.follows = response.data;
|
||||
});
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -71,8 +71,8 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('api_test.automation.follow_people')" prop="followPeople">
|
||||
<el-select v-model="httpForm.followPeople"
|
||||
clearable
|
||||
<el-select v-model="httpForm.follows"
|
||||
clearable multiple
|
||||
:placeholder="$t('api_test.automation.follow_people')" filterable size="small"
|
||||
class="ms-http-textarea">
|
||||
<el-option
|
||||
|
@ -359,7 +359,9 @@
|
|||
this.basisData.environmentId = "";
|
||||
}
|
||||
this.httpForm = JSON.parse(JSON.stringify(this.basisData));
|
||||
|
||||
this.$get('/api/definition/follow/' + this.basisData.id, response => {
|
||||
this.httpForm.follows = response.data;
|
||||
});
|
||||
this.initMockEnvironment();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,8 +54,9 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('api_test.automation.follow_people')" prop="followPeople">
|
||||
<el-select v-model="basicForm.followPeople"
|
||||
<el-select v-model="basicForm.follows"
|
||||
clearable
|
||||
multiple
|
||||
:placeholder="$t('api_test.automation.follow_people')" filterable size="small"
|
||||
class="ms-http-textarea">
|
||||
<el-option
|
||||
|
@ -106,6 +107,9 @@
|
|||
if (this.basicForm.protocol == null) {
|
||||
this.basicForm.protocol = "TCP";
|
||||
}
|
||||
this.$get('/api/definition/follow/' + this.basisData.id, response => {
|
||||
this.basicForm.follows = response.data;
|
||||
});
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue