From c27b73b144fd8c2293df6fd47ce2967c8a2a6e4e Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Mon, 18 Jan 2021 14:10:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9Enacos=E5=8C=97=E6=96=97=E8=BE=85?= =?UTF-8?q?=E5=8A=A9=E5=AE=9A=E4=BD=8D=E9=A1=B9=E7=9B=AE=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../telpo/beidouast/entity/mongo/IPProvinceEntity.java | 1 - .../com/telpo/beidouast/handler/NettyServerHandler.java | 4 ---- .../beidouast/handler/ServerChannelInitializer.java | 3 +-- .../com/telpo/beidouast/server/DipperPositionServer.java | 6 ------ .../com/telpo/beidouast/service/IPProvinceService.java | 3 +-- .../service/impl/DipperAstPosAsyncTaskServiceImpl.java | 9 +-------- .../service/impl/DipperAstTimeAsyncTaskServiceImpl.java | 2 -- 7 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/telpo/beidouast/entity/mongo/IPProvinceEntity.java b/src/main/java/com/telpo/beidouast/entity/mongo/IPProvinceEntity.java index eba5bc4..1493d1b 100644 --- a/src/main/java/com/telpo/beidouast/entity/mongo/IPProvinceEntity.java +++ b/src/main/java/com/telpo/beidouast/entity/mongo/IPProvinceEntity.java @@ -1,6 +1,5 @@ package com.telpo.beidouast.entity.mongo; -import com.telpo.beidouast.vo.IPProvinceVo; import lombok.Getter; import lombok.Setter; import lombok.ToString; diff --git a/src/main/java/com/telpo/beidouast/handler/NettyServerHandler.java b/src/main/java/com/telpo/beidouast/handler/NettyServerHandler.java index 6fa1a50..a7c4417 100644 --- a/src/main/java/com/telpo/beidouast/handler/NettyServerHandler.java +++ b/src/main/java/com/telpo/beidouast/handler/NettyServerHandler.java @@ -1,6 +1,5 @@ package com.telpo.beidouast.handler; -import com.telpo.beidouast.enums.DipperReturnValue; import com.telpo.beidouast.service.IDipperAstPosAsyncTaskService; import com.telpo.beidouast.service.IDipperAstTimeAsyncTaskService; import com.telpo.beidouast.service.IDipperDataAsyncTaskService; @@ -13,9 +12,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import java.io.InputStream; -import java.time.LocalDateTime; - /** * @program: dipperposition * @description: Netty服务器处理句柄 diff --git a/src/main/java/com/telpo/beidouast/handler/ServerChannelInitializer.java b/src/main/java/com/telpo/beidouast/handler/ServerChannelInitializer.java index d2baf75..b17dc52 100644 --- a/src/main/java/com/telpo/beidouast/handler/ServerChannelInitializer.java +++ b/src/main/java/com/telpo/beidouast/handler/ServerChannelInitializer.java @@ -1,7 +1,6 @@ package com.telpo.beidouast.handler; import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelPipeline; import io.netty.channel.socket.SocketChannel; import io.netty.handler.codec.string.StringDecoder; import io.netty.handler.codec.string.StringEncoder; @@ -14,7 +13,7 @@ import io.netty.util.CharsetUtil; **/ public class ServerChannelInitializer extends ChannelInitializer { @Override - protected void initChannel(SocketChannel socketChannel) throws Exception { + protected void initChannel(SocketChannel socketChannel) { //添加编解码 socketChannel.pipeline().addLast("decoder", new StringDecoder(CharsetUtil.UTF_8)); socketChannel.pipeline().addLast("encoder", new StringEncoder(CharsetUtil.UTF_8)); diff --git a/src/main/java/com/telpo/beidouast/server/DipperPositionServer.java b/src/main/java/com/telpo/beidouast/server/DipperPositionServer.java index e33868c..2e10cbb 100644 --- a/src/main/java/com/telpo/beidouast/server/DipperPositionServer.java +++ b/src/main/java/com/telpo/beidouast/server/DipperPositionServer.java @@ -11,8 +11,6 @@ import io.netty.channel.socket.nio.NioServerSocketChannel; import lombok.extern.slf4j.Slf4j; import org.springframework.core.env.ConfigurableEnvironment; -import java.net.InetSocketAddress; - /** * @program: DipperPositionServer * @description: 北斗定位 @@ -23,16 +21,12 @@ import java.net.InetSocketAddress; public class DipperPositionServer { // @Autowired PositionConfigInfo positionConfigInfo; - private String serverAddr; - private Integer serverPort; private Integer timeAsycPort; private Integer posAsycPort; private Integer starsAsycPort; public DipperPositionServer(ConfigurableEnvironment environment) { - this.serverAddr = environment.getProperty("position-server.serverAddr"); - this.serverPort = Integer.parseInt(environment.getProperty("server.port")); this.timeAsycPort = Integer.parseInt(environment.getProperty("position-server.timeAsycPort")); this.posAsycPort = Integer.parseInt(environment.getProperty("position-server.posAsycPort")); this.starsAsycPort = Integer.parseInt(environment.getProperty("position-server.starsAsycPort")); diff --git a/src/main/java/com/telpo/beidouast/service/IPProvinceService.java b/src/main/java/com/telpo/beidouast/service/IPProvinceService.java index 3d8e7c4..67bda51 100644 --- a/src/main/java/com/telpo/beidouast/service/IPProvinceService.java +++ b/src/main/java/com/telpo/beidouast/service/IPProvinceService.java @@ -1,7 +1,6 @@ package com.telpo.beidouast.service; -import com.telpo.dipperposition.entity.mongo.IPProvinceEntity; -import com.telpo.dipperposition.vo.IPProvinceVo; +import com.telpo.beidouast.entity.mongo.IPProvinceEntity; /** * @program: IPProvinceService diff --git a/src/main/java/com/telpo/beidouast/service/impl/DipperAstPosAsyncTaskServiceImpl.java b/src/main/java/com/telpo/beidouast/service/impl/DipperAstPosAsyncTaskServiceImpl.java index 6f2c8a7..c858dce 100644 --- a/src/main/java/com/telpo/beidouast/service/impl/DipperAstPosAsyncTaskServiceImpl.java +++ b/src/main/java/com/telpo/beidouast/service/impl/DipperAstPosAsyncTaskServiceImpl.java @@ -1,24 +1,17 @@ package com.telpo.beidouast.service.impl; import com.alibaba.fastjson.JSONObject; -import com.google.common.base.Joiner; -import com.telpo.dipperposition.common.*; +import com.telpo.beidouast.common.*; import com.telpo.beidouast.entity.mongo.IPProvinceEntity; -import com.telpo.beidouast.mapper.IPProvinceMapper; import com.telpo.beidouast.service.IDipperAstPosAsyncTaskService; import com.telpo.beidouast.service.IPProvinceService; -import com.telpo.beidouast.vo.IPProvinceVo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.io.UnsupportedEncodingException; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; import java.util.List; /** diff --git a/src/main/java/com/telpo/beidouast/service/impl/DipperAstTimeAsyncTaskServiceImpl.java b/src/main/java/com/telpo/beidouast/service/impl/DipperAstTimeAsyncTaskServiceImpl.java index a00c5fd..b3439ad 100644 --- a/src/main/java/com/telpo/beidouast/service/impl/DipperAstTimeAsyncTaskServiceImpl.java +++ b/src/main/java/com/telpo/beidouast/service/impl/DipperAstTimeAsyncTaskServiceImpl.java @@ -1,10 +1,8 @@ package com.telpo.beidouast.service.impl; import com.telpo.beidouast.common.HexConvert; -import com.telpo.beidouast.common.SocketClient; import com.telpo.beidouast.service.IDipperAstTimeAsyncTaskService; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service;