diff --git a/backend/src/main/java/io/metersphere/api/parse/ApiImportAbstractParser.java b/backend/src/main/java/io/metersphere/api/parse/ApiImportAbstractParser.java index b725ffb06d..a8c450c6aa 100644 --- a/backend/src/main/java/io/metersphere/api/parse/ApiImportAbstractParser.java +++ b/backend/src/main/java/io/metersphere/api/parse/ApiImportAbstractParser.java @@ -7,9 +7,11 @@ import io.metersphere.api.dto.scenario.request.HttpRequest; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.LogUtil; import org.apache.commons.lang3.StringUtils; -import org.eclipse.jetty.http.HttpHeader; -import java.io.*; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; @@ -19,7 +21,7 @@ public abstract class ApiImportAbstractParser implements ApiImportParser { protected String getApiTestStr(InputStream source) { StringBuilder testStr = null; - try(BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(source, StandardCharsets.UTF_8))) { + try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(source, StandardCharsets.UTF_8))) { testStr = new StringBuilder(); String inputStr; while ((inputStr = bufferedReader.readLine()) != null) { @@ -46,21 +48,21 @@ public abstract class ApiImportAbstractParser implements ApiImportParser { } protected void addContentType(HttpRequest request, String contentType) { - addHeader(request, HttpHeader.CONTENT_TYPE.toString(), contentType); + addHeader(request, "Content-Type", contentType); } protected void addCookie(HttpRequest request, String key, String value) { List headers = Optional.ofNullable(request.getHeaders()).orElse(new ArrayList<>()); boolean hasCookie = false; for (KeyValue header : headers) { - if (StringUtils.equalsIgnoreCase(HttpHeader.COOKIE.name(), header.getName())) { + if (StringUtils.equalsIgnoreCase("Cookie", header.getName())) { hasCookie = true; String cookies = Optional.ofNullable(header.getValue()).orElse(""); header.setValue(cookies + key + "=" + value + ";"); } } if (!hasCookie) { - addHeader(request, HttpHeader.COOKIE.name(), key + "=" + value + ";"); + addHeader(request, "Cookie", key + "=" + value + ";"); } } diff --git a/backend/src/main/java/io/metersphere/api/parse/MsParser.java b/backend/src/main/java/io/metersphere/api/parse/MsParser.java index 065a4e8da1..20de9653d3 100644 --- a/backend/src/main/java/io/metersphere/api/parse/MsParser.java +++ b/backend/src/main/java/io/metersphere/api/parse/MsParser.java @@ -9,7 +9,6 @@ import io.metersphere.api.dto.parse.ApiImport; import io.metersphere.api.dto.scenario.request.RequestType; import io.metersphere.commons.constants.MsRequestBodyType; import org.apache.commons.lang3.StringUtils; -import org.eclipse.jetty.http.HttpMethod; import java.io.InputStream; @@ -62,7 +61,7 @@ public class MsParser extends ApiImportAbstractParser { Object body = requestObject.get("body"); if (body instanceof JSONArray) { JSONArray bodies = requestObject.getJSONArray("body"); - if (StringUtils.equalsIgnoreCase(requestObject.getString("method"), HttpMethod.POST.name()) && bodies != null) { + if (StringUtils.equalsIgnoreCase(requestObject.getString("method"), "POST") && bodies != null) { StringBuilder bodyStr = new StringBuilder(); for (int i = 0; i < bodies.size(); i++) { String tmp = bodies.getString(i); @@ -75,7 +74,7 @@ public class MsParser extends ApiImportAbstractParser { } } else if (body instanceof JSONObject) { JSONObject bodyObj = requestObject.getJSONObject("body"); - if (StringUtils.equalsIgnoreCase(requestObject.getString("method"), HttpMethod.POST.name()) && bodyObj != null) { + if (StringUtils.equalsIgnoreCase(requestObject.getString("method"), "POST") && bodyObj != null) { JSONArray kvs = new JSONArray(); bodyObj.keySet().forEach(key -> { JSONObject kv = new JSONObject(); diff --git a/backend/src/main/java/io/metersphere/base/domain/Notice.java b/backend/src/main/java/io/metersphere/base/domain/Notice.java index 3a66172eec..8f27a7a9ad 100644 --- a/backend/src/main/java/io/metersphere/base/domain/Notice.java +++ b/backend/src/main/java/io/metersphere/base/domain/Notice.java @@ -12,11 +12,11 @@ public class Notice implements Serializable { private String testId; - private String name; - private String enable; private String type; + private String userId; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/NoticeExample.java b/backend/src/main/java/io/metersphere/base/domain/NoticeExample.java index b762ddfbf3..685ba0c3e9 100644 --- a/backend/src/main/java/io/metersphere/base/domain/NoticeExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/NoticeExample.java @@ -314,76 +314,6 @@ public class NoticeExample { 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 values) { - addCriterion("`NAME` in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List 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 andEnableIsNull() { addCriterion("`ENABLE` is null"); return (Criteria) this; @@ -523,6 +453,76 @@ public class NoticeExample { addCriterion("`type` not between", value1, value2, "type"); return (Criteria) this; } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(String value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(String value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(String value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(String value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(String value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(String value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLike(String value) { + addCriterion("user_id like", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotLike(String value) { + addCriterion("user_id not like", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(String value1, String value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(String value1, String value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.xml index 89aba89f3a..b5d0a07b1a 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/NoticeMapper.xml @@ -5,9 +5,9 @@ - + @@ -68,7 +68,7 @@ - id, EVENT, TEST_ID, `NAME`, `ENABLE`, `type` + id, EVENT, TEST_ID, `ENABLE`, `type`, user_id @@ -167,15 +169,15 @@ TEST_ID = #{record.testId,jdbcType=VARCHAR}, - - `NAME` = #{record.name,jdbcType=VARCHAR}, - `ENABLE` = #{record.enable,jdbcType=VARCHAR}, `type` = #{record.type,jdbcType=VARCHAR}, + + user_id = #{record.userId,jdbcType=VARCHAR}, + @@ -186,9 +188,9 @@ set id = #{record.id,jdbcType=VARCHAR}, EVENT = #{record.event,jdbcType=VARCHAR}, TEST_ID = #{record.testId,jdbcType=VARCHAR}, - `NAME` = #{record.name,jdbcType=VARCHAR}, `ENABLE` = #{record.enable,jdbcType=VARCHAR}, - `type` = #{record.type,jdbcType=VARCHAR} + `type` = #{record.type,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=VARCHAR} @@ -202,15 +204,15 @@ TEST_ID = #{testId,jdbcType=VARCHAR}, - - `NAME` = #{name,jdbcType=VARCHAR}, - `ENABLE` = #{enable,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR}, + + user_id = #{userId,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} @@ -218,9 +220,9 @@ UPDATE notice SET EVENT = #{event,jdbcType=VARCHAR}, TEST_ID = #{testId,jdbcType=VARCHAR}, - `NAME` = #{name,jdbcType=VARCHAR}, `ENABLE` = #{enable,jdbcType=VARCHAR}, - `type` = #{type,jdbcType=VARCHAR} + `type` = #{type,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=VARCHAR} WHERE id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java index 9edf815e1b..7dd05c3163 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java @@ -16,8 +16,6 @@ public interface ExtUserMapper { List searchUser(String condition); - List queryEmails(String[] names); - List queryEmailByIds(List userIds); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml index c315725952..4133d3de29 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml @@ -33,18 +33,6 @@ order by u.update_time desc - -