From 7284c653edabfb5ca66926b948ef284ed10924e9 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Wed, 23 Feb 2022 15:56:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BF=AE=E5=A4=8D=E6=BC=8F=E6=B4=9E):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E4=BD=99=E8=B0=83=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=BC=8F=E6=B4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复多余调试代码漏洞 --- .../dto/automation/parse/EsbDataParser.java | 18 ------------------ .../api/dto/definition/parse/har/HarUtils.java | 9 --------- .../websocket/c/to/c/MsWebSocketClient.java | 14 -------------- 3 files changed, 41 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/EsbDataParser.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/EsbDataParser.java index 602b079264..577aea787e 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/EsbDataParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/EsbDataParser.java @@ -101,22 +101,4 @@ public class EsbDataParser { } return returnData; } - - public static void main(String[] args) { - String str = "[{\"systemName\":\"\",\"children\":[{\"systemName\":\"\",\"children\":[{\"systemName\":\"\",\"children\":[],\"name\":\"CardNo\",\"description\":\"\",\"type\":\"string\",\"contentType\":\"30\",\"uuid\":\"295f4\",\"value\":\"627713288321\",\"required\":true,\"status\":\"\"},{\"name\":\"AccoutNo\",\"systemName\":\"\",\"status\":\"\",\"type\":\"string\",\"contentType\":\"6\",\"required\":false,\"description\":\"\",\"uuid\":\"3e8ef\",\"children\":[],\"value\":\"371421321\"}],\"name\":\"HEAD\",\"description\":\"\",\"type\":\"[object]\",\"contentType\":\"\",\"uuid\":\"55483\",\"required\":false,\"status\":\"\"},{\"name\":\"Body\",\"systemName\":\"\",\"status\":\"\",\"type\":\"[object]\",\"contentType\":\"\",\"required\":false,\"description\":\"\",\"uuid\":\"a088b\",\"children\":[{\"name\":\"returnFlag\",\"systemName\":\"\",\"status\":\"\",\"type\":\"string\",\"contentType\":\"2\",\"required\":false,\"description\":\"\",\"uuid\":\"76d75\",\"children\":[],\"value\":\"1\"}]}],\"name\":\"SERVICE\",\"description\":\"\",\"type\":\"[object]\",\"contentType\":\"\",\"uuid\":\"faf95\",\"required\":false,\"status\":\"\"}]"; - List list = JSONArray.parseArray(str, EsbDataStruct.class); - String[] paramArr = new String[]{"HEAD"}; - System.out.println(esbData2XmlByParamStruct(list, paramArr)); - - paramArr = new String[]{"SERVICE"}; - System.out.println(esbData2XmlByParamStruct(list, paramArr)); - - paramArr = new String[]{"Body"}; - System.out.println(esbData2XmlByParamStruct(list, paramArr)); - - paramArr = new String[]{"SERVICE","Body"}; - System.out.println(esbData2XmlByParamStruct(list, paramArr)); - - } - } diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/har/HarUtils.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/har/HarUtils.java index e7fed00d19..4c1113fc9f 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/har/HarUtils.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/har/HarUtils.java @@ -54,13 +54,4 @@ public class HarUtils { Har har = JSONObject.parseObject(harJson, Har.class); return har; } - - public static void main(String[] args) throws UnsupportedEncodingException { -// String str = "%E6%B5%8B%AF"; - String str = "测试"; - str = URLEncoder.encode(str,"UTF-8"); - System.out.println(str); - str = URLDecoder.decode(str,"UTF-8"); - System.out.println(str); - } } diff --git a/backend/src/main/java/io/metersphere/websocket/c/to/c/MsWebSocketClient.java b/backend/src/main/java/io/metersphere/websocket/c/to/c/MsWebSocketClient.java index 4f6403c00f..b7f31a57d0 100644 --- a/backend/src/main/java/io/metersphere/websocket/c/to/c/MsWebSocketClient.java +++ b/backend/src/main/java/io/metersphere/websocket/c/to/c/MsWebSocketClient.java @@ -38,18 +38,4 @@ public class MsWebSocketClient extends WebSocketClient{ public void onError(Exception e) { System.out.println("异常"+e); } - public static void main(String[] args) { - try { - MsWebSocketClient client = new MsWebSocketClient("ws://127.0.0.1:8081/ws/22222"); - client.connect(); - System.out.println("建立websocket连接"); - MsgDto dto = new MsgDto(); - dto.setContent("099991023123123"); - dto.setReportId("123123123"); - dto.setToReport("3933abd9"); - client.send(JSON.toJSONString(dto)); - } catch (URISyntaxException e) { - LogUtil.error(e); - } - } }