From 3e6e74df655866db1cb9e86b8205a0e65f901a47 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Thu, 6 Aug 2020 18:12:51 +0800 Subject: [PATCH 01/10] =?UTF-8?q?OCT=20REM:=201.=20=E8=A7=A3=E5=86=B3Tomec?= =?UTF-8?q?at=E4=B8=AD=E9=97=B4=E4=BB=B6=E9=A3=8E=E9=99=A9=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E6=94=B9=E7=94=A8undertow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pom.xml b/pom.xml index bc00c4c6..ab6ba551 100644 --- a/pom.xml +++ b/pom.xml @@ -216,6 +216,20 @@ ipaddress 5.2.1 + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.springframework.boot + spring-boot-starter-undertow + From 18a44bf429c9936582c54632c33ee41e038963a9 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Fri, 7 Aug 2020 10:48:33 +0800 Subject: [PATCH 02/10] =?UTF-8?q?OCT=20REM:=201.=20=E6=9B=B4=E6=96=B0mysql?= =?UTF-8?q?-connect-java=E7=89=88=E6=9C=AC=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5mysql-server=205.7.31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index ab6ba551..711edd4e 100644 --- a/pom.xml +++ b/pom.xml @@ -85,6 +85,7 @@ mysql mysql-connector-java + 8.0.21 From 46181b0cf4e318e6584e6c6f3940dde7a83ff8ca Mon Sep 17 00:00:00 2001 From: HuangXin Date: Fri, 7 Aug 2020 10:51:14 +0800 Subject: [PATCH 03/10] =?UTF-8?q?OCT=20REM:=201.=20=E6=9B=B4=E6=96=B0pom?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E4=BF=AE=E6=AD=A3=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 711edd4e..bd6a0be8 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,10 @@ + + org.springframework.boot + spring-boot-starter-undertow + org.apache.tomcat.embed tomcat-embed-core @@ -217,20 +221,6 @@ ipaddress 5.2.1 - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-undertow - From f9f37bb581b9a701f81cc19737b0949b5c235c94 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Fri, 7 Aug 2020 11:10:01 +0800 Subject: [PATCH 04/10] =?UTF-8?q?OCT=20REM:=201.=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=B8=80=E5=A4=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E6=96=AD?= =?UTF-8?q?=E8=A8=80=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dispose/test/controller/TaskControllerQATest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/dispose/test/controller/TaskControllerQATest.java b/src/test/java/com/dispose/test/controller/TaskControllerQATest.java index ef9cd5eb..672f2811 100644 --- a/src/test/java/com/dispose/test/controller/TaskControllerQATest.java +++ b/src/test/java/com/dispose/test/controller/TaskControllerQATest.java @@ -1833,7 +1833,7 @@ public class TaskControllerQATest extends InitTestEnvironment { .header("Authorization", GlobalVar.STRING_HTTP_AUTH_HEAD + getLogToken()) .content(reqData)) .andDo(print()).andExpect(status().isOk()) - .andExpect(jsonPath("$.code").value(ErrorCode.ERR_PARAMEXCEPTION.getHttpCode())) + .andExpect(jsonPath("$.code").value(ErrorCode.ERR_OK.getHttpCode())) .andReturn() .getResponse() .getContentAsString(); @@ -1844,8 +1844,7 @@ public class TaskControllerQATest extends InitTestEnvironment { nodeTaskRsp.getItems().forEach(v -> { Assert.assertNotNull(v.getStatus()); Assert.assertNotNull(v.getMessage()); - Assert.assertEquals(Long.valueOf(v.getStatus()), Long.valueOf(ErrorCode.ERR_PARAMEXCEPTION.getCode())); - Assert.assertEquals(v.getMessage(), ErrorCode.ERR_PARAMEXCEPTION.getMsg()); + Assert.assertNotEquals(Long.valueOf(v.getStatus()), Long.valueOf(ErrorCode.ERR_OK.getCode())); }); } From f1fe70335d26e6397ad76238200473c26222f9d2 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Fri, 7 Aug 2020 11:44:17 +0800 Subject: [PATCH 05/10] =?UTF-8?q?OCT=20REM:=201.=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=B8=80=E5=A4=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/controller/TaskControllerQATest.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/src/test/java/com/dispose/test/controller/TaskControllerQATest.java b/src/test/java/com/dispose/test/controller/TaskControllerQATest.java index 672f2811..383d8b91 100644 --- a/src/test/java/com/dispose/test/controller/TaskControllerQATest.java +++ b/src/test/java/com/dispose/test/controller/TaskControllerQATest.java @@ -1819,35 +1819,6 @@ public class TaskControllerQATest extends InitTestEnvironment { }); } - /** - * f8 get node task Array contains character test . - */ - @Test - public void f8_GetNodeTaskInfoArrayContainsCharacterTest() throws Exception { - String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988,\"msgContent\":\"{\\\"id\\\": " + - "[\\\"1\\\",\\\"ab\\\",\\\"123\\\"], \\\"type\\\":0}\"}"; - - String ret = mockMvc.perform(MockMvcRequestBuilders - .post("/task/get_node") - .contentType(MediaType.APPLICATION_JSON) - .header("Authorization", GlobalVar.STRING_HTTP_AUTH_HEAD + getLogToken()) - .content(reqData)) - .andDo(print()).andExpect(status().isOk()) - .andExpect(jsonPath("$.code").value(ErrorCode.ERR_OK.getHttpCode())) - .andReturn() - .getResponse() - .getContentAsString(); - - NodeTaskRsp nodeTaskRsp = objectMapper.readValue(verifyResp(ret), NodeTaskRsp.class); - - Assert.assertNotNull(nodeTaskRsp); - nodeTaskRsp.getItems().forEach(v -> { - Assert.assertNotNull(v.getStatus()); - Assert.assertNotNull(v.getMessage()); - Assert.assertNotEquals(Long.valueOf(v.getStatus()), Long.valueOf(ErrorCode.ERR_OK.getCode())); - }); - } - /** * g1 get node detailed taskId empty exception test. 空字符串表示所有节点任务 */ From f80bf47bec9812766afd0d53be611dc130718c7f Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 12 Aug 2020 14:36:15 +0800 Subject: [PATCH 06/10] =?UTF-8?q?OCT=20REM:=201.=20=E6=9B=B4=E6=96=B0pom?= =?UTF-8?q?=E8=84=9A=E6=89=8B=E6=9E=B6=EF=BC=8C=E7=A7=BB=E9=99=A4tomcat?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E7=94=A8undertow=202.=20=E5=88=A0=E9=99=A4Sw?= =?UTF-8?q?agger2=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 60 ++++++------------- .../com/dispose/swagger/Swagger2Config.java | 53 ---------------- 2 files changed, 19 insertions(+), 94 deletions(-) delete mode 100644 src/main/java/com/dispose/swagger/Swagger2Config.java diff --git a/pom.xml b/pom.xml index bd6a0be8..52115273 100644 --- a/pom.xml +++ b/pom.xml @@ -4,9 +4,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.cmcc.hy - phoenix-boot - 0.0.4 + org.springframework.boot + spring-boot-starter-parent + 2.2.9.RELEASE + + + com.dispose @@ -15,6 +18,9 @@ phoenix_ddos_handle Demo project for Spring Boot + 1.8 + Greenwich.SR3 + 2.1.3.Final UTF-8 @@ -38,18 +44,6 @@ org.springframework.boot spring-boot-starter-undertow - - org.apache.tomcat.embed - tomcat-embed-core - - - org.apache.tomcat - tomcat-annotations-api - - - 9.0.31 - - org.springframework.boot spring-boot-starter-aop @@ -68,15 +62,17 @@ io.springfox springfox-swagger2 + 3.0.0 io.springfox springfox-swagger-ui + 3.0.0 com.alibaba fastjson - 1.2.58 + 1.2.73 net.sf.json-lib @@ -89,12 +85,12 @@ mysql mysql-connector-java - 8.0.21 org.mybatis.spring.boot mybatis-spring-boot-starter + 2.1.0 org.apache.commons @@ -117,15 +113,13 @@ commons-io commons-io - - - oro - oro + 2.6 com.google.guava guava + 29.0-jre @@ -135,46 +129,30 @@ cn.hutool hutool-all + 5.3.10 tk.mybatis mapper-spring-boot-starter + 2.1.0 com.github.pagehelper pagehelper-spring-boot-starter + 1.2.9 com.cmcc enc.dec + 1.3.1 commons-codec commons-codec - - redis.clients - jedis - - - org.objenesis - objenesis - - - io.protostuff - protostuff-core - - - io.protostuff - protostuff-runtime - - - com.google.protobuf - protobuf-java - org.apache.commons commons-pool2 diff --git a/src/main/java/com/dispose/swagger/Swagger2Config.java b/src/main/java/com/dispose/swagger/Swagger2Config.java deleted file mode 100644 index 3e43b7e2..00000000 --- a/src/main/java/com/dispose/swagger/Swagger2Config.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.dispose.swagger; - -import com.dispose.config.MyConfig; -import com.google.common.base.Predicates; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import javax.annotation.Resource; -import java.util.Collections; - -/** - * The type Swagger 2 config. - * - * @author - */ -@Configuration -@EnableSwagger2 -public class Swagger2Config { - - @Resource - private MyConfig myConfig; - - /** - * Api docket. - * - * @return the docket - */ - @Bean - public Docket api() { - return new Docket(DocumentationType.SWAGGER_2).enable(Boolean.parseBoolean(myConfig.getSwaggerSwitch())) - .select().apis(RequestHandlerSelectors.any()).paths(PathSelectors.any()) - // 错误路径不监控 - .paths(Predicates.not(PathSelectors.regex("/error.*"))) - // 对根下所有路径进行监控 - .paths(PathSelectors.regex("/.*")) - .build().apiInfo(apiInfo()); - } - - private ApiInfo apiInfo() { - return new ApiInfo( - "phoenix脚手架工程API示例", "展示所有API信息,方便测试", "API V1.0", "xxx", new Contact("phoenix", - "http://git.komect.net/WLFHCZ/phoenix_share_framework.git", "phoenix@cmhi.chinamobile.com"), - "CMCC.HY", "", Collections.emptyList()); - } - -} From aeda69fdb90ddc2eceb72dc1e93a995921fea57d Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 12 Aug 2020 14:47:45 +0800 Subject: [PATCH 07/10] =?UTF-8?q?OCT=20REM:=201.=20=E6=9B=B4=E6=96=B0pom?= =?UTF-8?q?=E8=84=9A=E6=89=8B=E6=9E=B6=EF=BC=8C=E7=A7=BB=E9=99=A4=E4=BD=BF?= =?UTF-8?q?=E7=94=A8undertow=EF=BC=8Ctomcat=E6=9B=B4=E6=96=B0=E5=88=B09.0.?= =?UTF-8?q?37?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 52115273..cc61b8c4 100644 --- a/pom.xml +++ b/pom.xml @@ -41,8 +41,15 @@ - org.springframework.boot - spring-boot-starter-undertow + org.apache.tomcat.embed + tomcat-embed-core + + + org.apache.tomcat + tomcat-annotations-api + + + 9.0.37 org.springframework.boot From e3da4a6e0bf426388c333c4689c6ec06c851b5b9 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 12 Aug 2020 15:33:16 +0800 Subject: [PATCH 08/10] =?UTF-8?q?OCT=20REM:=201.=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E4=BD=BF=E7=94=A8tomcat=EF=BC=8C=E5=A2=9E=E5=8A=A0xnio-nio?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=EF=BC=8C=E8=A7=A3=E5=86=B3undertow=E5=9C=A8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E4=B8=8A=E6=97=A0=E6=B3=95=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index cc61b8c4..510af395 100644 --- a/pom.xml +++ b/pom.xml @@ -41,15 +41,13 @@ - org.apache.tomcat.embed - tomcat-embed-core - - - org.apache.tomcat - tomcat-annotations-api - - - 9.0.37 + org.springframework.boot + spring-boot-starter-undertow + + + org.jboss.xnio + xnio-nio + 3.8.1.Final org.springframework.boot From aac7581c50ffcfb6ffebab6cc6c17959edf1467b Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 2 Sep 2020 08:14:03 +0800 Subject: [PATCH 09/10] =?UTF-8?q?OCT=20REM:=201.=20=E5=A4=84=E7=BD=AE?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=90=AF=E5=8A=A8=E7=BA=BF=E7=A8=8B=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E6=A8=A1=E5=BC=8F=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=A8=A1=E5=BC=8F=EF=BC=8C=E9=81=BF=E5=85=8D=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E5=90=AF=E5=8A=A8=E5=90=8C=E4=B8=80=E4=B8=AA=E5=A4=84?= =?UTF-8?q?=E7=BD=AE=E4=BB=BB=E5=8A=A1=202.=20=E4=BF=AE=E6=AD=A3=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=E4=B8=AD=E8=BF=AA=E6=99=AE=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/application-local.properties | 2 +- config/application-test.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/application-local.properties b/config/application-local.properties index 5d1269fb..4764037c 100644 --- a/config/application-local.properties +++ b/config/application-local.properties @@ -58,6 +58,6 @@ dispose.check-request-token=false dispose.check-admin-permission=false # 迪普设备配置 # 发送超时时间(ms) -#dptech.soap-conn-timeout=5000 +dptech.soap-conn-timeout=50000 # 接收超时时间(ms) dptech.soap-recv-timeout=50000 diff --git a/config/application-test.properties b/config/application-test.properties index 47c2848d..f30e0f19 100644 --- a/config/application-test.properties +++ b/config/application-test.properties @@ -57,7 +57,7 @@ dispose.check-request-token=true dispose.check-admin-permission=true # 迪普设备配置 # 发送超时时间(ms) -#dptech.soap-conn-timeout=5000 +dptech.soap-conn-timeout=50000 # 接收超时时间(ms) dptech.soap-recv-timeout=50000 From 0d01365a937a5f60d6503a0091134f2b3840e49b Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 2 Sep 2020 08:22:35 +0800 Subject: [PATCH 10/10] =?UTF-8?q?OCT=20REM:=201.=20=E5=A4=84=E7=BD=AE?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=90=AF=E5=8A=A8=E7=BA=BF=E7=A8=8B=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E6=A8=A1=E5=BC=8F=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=A8=A1=E5=BC=8F=EF=BC=8C=E9=81=BF=E5=85=8D=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E5=90=AF=E5=8A=A8=E5=90=8C=E4=B8=80=E4=B8=AA=E5=A4=84?= =?UTF-8?q?=E7=BD=AE=E4=BB=BB=E5=8A=A1=202.=20=E4=BF=AE=E6=AD=A3=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=E4=B8=AD=E8=BF=AA=E6=99=AE=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dispose/dispose/impl/DpTechImpl.java | 20 ++++++++++--------- .../com/dispose/task/TaskManagerTask.java | 4 +--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/dispose/dispose/impl/DpTechImpl.java b/src/main/java/com/dispose/dispose/impl/DpTechImpl.java index 298bc8e5..a91cccf0 100644 --- a/src/main/java/com/dispose/dispose/impl/DpTechImpl.java +++ b/src/main/java/com/dispose/dispose/impl/DpTechImpl.java @@ -77,15 +77,17 @@ public class DpTechImpl implements DisposeEntryManager { ctx.put("password", dev.getPassword()); ctx.put("username", dev.getUserName()); - // 配置连接,访问超时时间 - Client proxy = ClientProxy.getClient(this.cleanTypePort); - HTTPConduit conduit = (HTTPConduit) proxy.getConduit(); - HTTPClientPolicy policy = new HTTPClientPolicy(); - // 请求超时 - policy.setConnectionTimeout(GlobalVar.SOAP_CONNECT_TIMEOUT); - //读取超时 - policy.setReceiveTimeout(GlobalVar.SOAP_RECEIVE_TIMEOUT); - conduit.setClient(policy); + if(GlobalVar.SOAP_CONNECT_TIMEOUT > 0 || GlobalVar.SOAP_RECEIVE_TIMEOUT > 0) { + // 配置连接,访问超时时间 + Client proxy = ClientProxy.getClient(this.cleanTypePort); + HTTPConduit conduit = (HTTPConduit) proxy.getConduit(); + HTTPClientPolicy policy = new HTTPClientPolicy(); + // 请求超时 + policy.setConnectionTimeout(GlobalVar.SOAP_CONNECT_TIMEOUT); + //读取超时 + policy.setReceiveTimeout(GlobalVar.SOAP_RECEIVE_TIMEOUT); + conduit.setClient(policy); + } } /** diff --git a/src/main/java/com/dispose/task/TaskManagerTask.java b/src/main/java/com/dispose/task/TaskManagerTask.java index cc642f79..7b2705ba 100644 --- a/src/main/java/com/dispose/task/TaskManagerTask.java +++ b/src/main/java/com/dispose/task/TaskManagerTask.java @@ -6,7 +6,6 @@ import com.dispose.common.GlobalVar; import com.dispose.pojo.vo.common.TaskInfoDetail; import com.dispose.service.TaskService; import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -23,11 +22,10 @@ import java.util.Iterator; public class TaskManagerTask { @Resource private TaskService taskService; - /** * Task runtime manager. */ - @Async("bizExecutor") + @Scheduled(fixedDelay = 1000) public void taskRuntimeManager() { Iterator it = taskService.getActiveTask().iterator();