From 5aaf4a19e271295ff5a013c26141664958bc1d7a Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Mon, 18 Jan 2021 22:24:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=B0docker=E5=A4=96?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dipperposition/config/NettyServerConfig.java | 15 +++++++-------- .../dipperposition/config/PositionConfig.java | 13 ++++++------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java b/src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java index 54fcfbb..b5f2b55 100644 --- a/src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java +++ b/src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java @@ -8,6 +8,8 @@ import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; +import javax.annotation.PostConstruct; + /** * @program: gateway * @description: jwt设置 @@ -33,13 +35,10 @@ public class NettyServerConfig { private String starsAsycServerPort; private static NettyServerConfig nettyServerConfig; - /** - * spring会自动从ioc容器当中根据NettyServerConfig类型找到nettyServerConfig, - * 当做参数传进来 - * - */ - @Autowired - public void setNettyServerConfig(NettyServerConfig nettyServerConfig) { - this.nettyServerConfig = nettyServerConfig; + + @PostConstruct + public void init() { + nettyServerConfig = this; } + } diff --git a/src/main/java/com/telpo/dipperposition/config/PositionConfig.java b/src/main/java/com/telpo/dipperposition/config/PositionConfig.java index 97d2d3a..f4e16a9 100644 --- a/src/main/java/com/telpo/dipperposition/config/PositionConfig.java +++ b/src/main/java/com/telpo/dipperposition/config/PositionConfig.java @@ -7,6 +7,8 @@ import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; +import javax.annotation.PostConstruct; + /** * @program: gateway * @description: jwt设置 @@ -39,12 +41,9 @@ public class PositionConfig { private static PositionConfig positionConfig; - /** - * spring会自动从ioc容器当中根据PositionConfig类型找到positionConfig,当做参数传进来 - * - */ - @Autowired - public void setPositionConfig(PositionConfig positionConfig) { - this.positionConfig = positionConfig; + + @PostConstruct + public void init() { + positionConfig = this; } }