From 1ccd98eb1f8649571917e9352cac96ac9e73a797 Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Tue, 19 Jan 2021 08:30:34 +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/common/OkHttpUtil.java | 2 +- .../dipperposition/common/RedisUtil.java | 7 +--- .../config/NettyServerConfig.java | 2 +- .../dipperposition/config/PositionConfig.java | 2 +- .../DipperAstPosAsyncTaskController.java | 30 +++++++++++++ .../DipperAstTimeAsyncTaskController.java | 32 ++++++++++++++ ...ava => DipperDataAsyncTaskController.java} | 23 +++++++++- .../handler/NettyServerHandler.java | 42 ++++++++++--------- .../IDipperAstPosAsyncTaskService.java | 14 +++---- .../IDipperAstTimeAsyncTaskService.java | 4 +- .../service/IDipperDataAsyncTaskService.java | 4 +- .../service/IpProvinceService.java | 4 +- .../DipperAstPosAsyncTaskServiceImpl.java | 35 +++++++++------- .../DipperAstTimeAsyncTaskServiceImpl.java | 20 ++++----- .../impl/DipperDataAsyncTaskServiceImpl.java | 21 +++++----- .../service/impl/IpProvinceServiceImpl.java | 18 ++++---- 16 files changed, 175 insertions(+), 85 deletions(-) create mode 100644 src/main/java/com/telpo/dipperposition/controller/DipperAstPosAsyncTaskController.java create mode 100644 src/main/java/com/telpo/dipperposition/controller/DipperAstTimeAsyncTaskController.java rename src/main/java/com/telpo/dipperposition/controller/{DipperPositionController.java => DipperDataAsyncTaskController.java} (54%) diff --git a/src/main/java/com/telpo/dipperposition/common/OkHttpUtil.java b/src/main/java/com/telpo/dipperposition/common/OkHttpUtil.java index 2452e02..daac774 100644 --- a/src/main/java/com/telpo/dipperposition/common/OkHttpUtil.java +++ b/src/main/java/com/telpo/dipperposition/common/OkHttpUtil.java @@ -26,7 +26,7 @@ public class OkHttpUtil { @Autowired private OkHttpClient okHttpClient; - private static OkHttpUtil okHttpUtil; + public static OkHttpUtil okHttpUtil; @PostConstruct public void init() { diff --git a/src/main/java/com/telpo/dipperposition/common/RedisUtil.java b/src/main/java/com/telpo/dipperposition/common/RedisUtil.java index 107ace8..33b262a 100644 --- a/src/main/java/com/telpo/dipperposition/common/RedisUtil.java +++ b/src/main/java/com/telpo/dipperposition/common/RedisUtil.java @@ -25,12 +25,7 @@ public class RedisUtil { @Resource private RedisTemplate redisTemplate; - private static RedisUtil redisUtil; - /** - * spring会自动从ioc容器当中根据RedisUtil类型找到redisUtil,当做参数传进来 - * - */ - + public static RedisUtil redisUtil; @PostConstruct public void init() { redisUtil = this; diff --git a/src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java b/src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java index b5f2b55..3c0b6bc 100644 --- a/src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java +++ b/src/main/java/com/telpo/dipperposition/config/NettyServerConfig.java @@ -34,7 +34,7 @@ public class NettyServerConfig { @NacosValue(value = "${position-server.starsAsycPort}") private String starsAsycServerPort; - private static NettyServerConfig nettyServerConfig; + public static NettyServerConfig nettyServerConfig; @PostConstruct public void init() { diff --git a/src/main/java/com/telpo/dipperposition/config/PositionConfig.java b/src/main/java/com/telpo/dipperposition/config/PositionConfig.java index f4e16a9..47d8b0a 100644 --- a/src/main/java/com/telpo/dipperposition/config/PositionConfig.java +++ b/src/main/java/com/telpo/dipperposition/config/PositionConfig.java @@ -40,7 +40,7 @@ public class PositionConfig { int astTimeout; - private static PositionConfig positionConfig; + public static PositionConfig positionConfig; @PostConstruct public void init() { diff --git a/src/main/java/com/telpo/dipperposition/controller/DipperAstPosAsyncTaskController.java b/src/main/java/com/telpo/dipperposition/controller/DipperAstPosAsyncTaskController.java new file mode 100644 index 0000000..78dca24 --- /dev/null +++ b/src/main/java/com/telpo/dipperposition/controller/DipperAstPosAsyncTaskController.java @@ -0,0 +1,30 @@ +package com.telpo.dipperposition.controller; + +import com.telpo.dipperposition.service.IDipperAstPosAsyncTaskService; +import com.telpo.dipperposition.service.IDipperAstTimeAsyncTaskService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RestController; + + +/** + * @program: DipperAstPosAsyncTaskController + * @description: 北斗定位 + * @author: linwl + * @create: 2020-07-10 14:01 + */ +@RestController +@Slf4j +public class DipperAstPosAsyncTaskController { + + @Autowired + IDipperAstPosAsyncTaskService dipperAstPosAsyncTaskService; + + /* + * 拉取星历数据 + */ + public String pushAstPos(String ipAddress) { + return dipperAstPosAsyncTaskService.pushAstPos(ipAddress); + } + +} diff --git a/src/main/java/com/telpo/dipperposition/controller/DipperAstTimeAsyncTaskController.java b/src/main/java/com/telpo/dipperposition/controller/DipperAstTimeAsyncTaskController.java new file mode 100644 index 0000000..265e5ee --- /dev/null +++ b/src/main/java/com/telpo/dipperposition/controller/DipperAstTimeAsyncTaskController.java @@ -0,0 +1,32 @@ +package com.telpo.dipperposition.controller; + +import com.telpo.dipperposition.service.IDipperAstTimeAsyncTaskService; +import com.telpo.dipperposition.service.IDipperDataAsyncTaskService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * @program: DipperPositionController + * @description: 北斗定位 + * @author: linwl + * @create: 2020-07-10 14:01 + */ +@RestController +@Slf4j +public class DipperAstTimeAsyncTaskController { + + @Autowired + IDipperAstTimeAsyncTaskService dipperTimeAsyncTaskService; + + /* + * 拉取星历数据 + */ + public String pushAstTime() { + return dipperTimeAsyncTaskService.pushAstTime(); + } + +} diff --git a/src/main/java/com/telpo/dipperposition/controller/DipperPositionController.java b/src/main/java/com/telpo/dipperposition/controller/DipperDataAsyncTaskController.java similarity index 54% rename from src/main/java/com/telpo/dipperposition/controller/DipperPositionController.java rename to src/main/java/com/telpo/dipperposition/controller/DipperDataAsyncTaskController.java index 524256a..786a9c8 100644 --- a/src/main/java/com/telpo/dipperposition/controller/DipperPositionController.java +++ b/src/main/java/com/telpo/dipperposition/controller/DipperDataAsyncTaskController.java @@ -1,6 +1,8 @@ package com.telpo.dipperposition.controller; +import com.telpo.dipperposition.service.IDipperDataAsyncTaskService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -14,13 +16,32 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @Slf4j -public class DipperPositionController { +public class DipperDataAsyncTaskController { @Value(value = "${position-server.serverAddr}") private String hello; //RzlAccount rzlAccount; + @Autowired + IDipperDataAsyncTaskService dipperDataAsyncTaskService; + + /* + * 拉取星历数据 + */ + public void pullAstEPH() { + dipperDataAsyncTaskService.pullAstEPH(); + } + + /* + * 获取星历数据 + */ + public String getAstEPH() { + return dipperDataAsyncTaskService.getAstEPH(); + } + + @RequestMapping("/getPos") public String getPos() { return "return serverAddr = " + hello; } + } diff --git a/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java b/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java index 66173fa..651adad 100644 --- a/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java +++ b/src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java @@ -2,6 +2,9 @@ package com.telpo.dipperposition.handler; import com.telpo.dipperposition.config.NettyServerConfig; import com.telpo.dipperposition.config.PositionConfig; +import com.telpo.dipperposition.controller.DipperAstPosAsyncTaskController; +import com.telpo.dipperposition.controller.DipperAstTimeAsyncTaskController; +import com.telpo.dipperposition.controller.DipperDataAsyncTaskController; import com.telpo.dipperposition.enums.DipperReturnValue; import com.telpo.dipperposition.service.IDipperAstPosAsyncTaskService; import com.telpo.dipperposition.service.IDipperAstTimeAsyncTaskService; @@ -38,11 +41,11 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { private static String AST_EPH_CMD_BYTE = "455048"; @Autowired - private IDipperAstTimeAsyncTaskService dipperTimeAsyncTaskService; + private DipperAstTimeAsyncTaskController dipperTimeAsyncTaskController; @Autowired - private IDipperAstPosAsyncTaskService dipperAstPosAsyncTaskService; + private DipperAstPosAsyncTaskController dipperAstPosAsyncTaskController; @Autowired - private IDipperDataAsyncTaskService dipperDataAsyncTaskService; + private DipperDataAsyncTaskController dipperDataAsyncTaskController; @Autowired private NettyServerConfig nettyServerConfig; @@ -114,10 +117,10 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { //if (AST_TIME_CMD.equals(recvmg)) { if (AST_TIME_CMD.equals(msg)) { // 初始时间辅助输入; - if (dipperTimeAsyncTaskService == null) { - dipperTimeAsyncTaskService = new DipperAstTimeAsyncTaskServiceImpl(); - } - channelAns = dipperTimeAsyncTaskService.pushAstTime(); +// if (dipperTimeAsyncTaskService == null) { +// dipperTimeAsyncTaskService = new DipperAstTimeAsyncTaskServiceImpl(); +// } + channelAns = dipperTimeAsyncTaskController.pushAstTime(); } // 发送SDBP-AST-POS获取辅助位置信息 @@ -136,24 +139,25 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { // positionConfig.getCenterProvince(), // positionConfig.getIpPositionRequestPath(), // positionConfig.getIpPositionRequestKey()); - if (dipperAstPosAsyncTaskService == null) { - dipperAstPosAsyncTaskService = new DipperAstPosAsyncTaskServiceImpl(); - } - channelAns = dipperAstPosAsyncTaskService.pushAstPos(ipAddress, - "/csv/provinceLonAlt.csv", - "湖北省", - "https://restapi.amap.com/v3/ip", - "65e794b0a1a4b87eeec86f93fea05411"); +// if (dipperAstPosAsyncTaskService == null) { +// dipperAstPosAsyncTaskService = new DipperAstPosAsyncTaskServiceImpl(); +// } + channelAns = dipperAstPosAsyncTaskController.pushAstPos(ipAddress); +// (ipAddress, +// "/csv/provinceLonAlt.csv", +// "湖北省", +// "https://restapi.amap.com/v3/ip", +// "65e794b0a1a4b87eeec86f93fea05411"); } // 从缓存获取SDBP-AST-EPH星历数 //if (Integer.parseInt(starsAsycServerPort) == channel.localAddress().getPort()) { //if (AST_POS_CMD.equals(recvmg)) { if (AST_POS_CMD.equals(msg)) { - if (dipperDataAsyncTaskService == null) { - dipperDataAsyncTaskService = new DipperDataAsyncTaskServiceImpl(); - } - channelAns = dipperDataAsyncTaskService.getAstEPH(); +// if (dipperDataAsyncTaskService == null) { +// dipperDataAsyncTaskService = new DipperDataAsyncTaskServiceImpl(); +// } + channelAns = dipperDataAsyncTaskController.getAstEPH(); } log.info(channelAns); diff --git a/src/main/java/com/telpo/dipperposition/service/IDipperAstPosAsyncTaskService.java b/src/main/java/com/telpo/dipperposition/service/IDipperAstPosAsyncTaskService.java index 49417ed..5c85f4b 100644 --- a/src/main/java/com/telpo/dipperposition/service/IDipperAstPosAsyncTaskService.java +++ b/src/main/java/com/telpo/dipperposition/service/IDipperAstPosAsyncTaskService.java @@ -16,16 +16,16 @@ import java.io.UnsupportedEncodingException; */ public interface IDipperAstPosAsyncTaskService { - @Autowired - void setDipperAstPosAsyncTaskService(IDipperAstPosAsyncTaskService dipperAstPosAsyncTaskService); /** * 同步任务 * */ - String pushAstPos(String ipAddress, - String centerProvinceFilePath, - String centerProvince, - String ipPositionRequestPath, - String ipPositionRequestKey) throws UnsupportedEncodingException; + String pushAstPos(String ipAddress); + +// String pushAstPos(String ipAddress, +// String centerProvinceFilePath, +// String centerProvince, +// String ipPositionRequestPath, +// String ipPositionRequestKey) throws UnsupportedEncodingException; } diff --git a/src/main/java/com/telpo/dipperposition/service/IDipperAstTimeAsyncTaskService.java b/src/main/java/com/telpo/dipperposition/service/IDipperAstTimeAsyncTaskService.java index ff3ae94..7703a56 100644 --- a/src/main/java/com/telpo/dipperposition/service/IDipperAstTimeAsyncTaskService.java +++ b/src/main/java/com/telpo/dipperposition/service/IDipperAstTimeAsyncTaskService.java @@ -11,8 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired; */ public interface IDipperAstTimeAsyncTaskService { - @Autowired - void setDipperAstTimeAsyncTaskService(IDipperAstTimeAsyncTaskService dipperAstTimeAsyncTaskService); +// @Autowired +// void setDipperAstTimeAsyncTaskService(IDipperAstTimeAsyncTaskService dipperAstTimeAsyncTaskService); /** * 同步任务 * diff --git a/src/main/java/com/telpo/dipperposition/service/IDipperDataAsyncTaskService.java b/src/main/java/com/telpo/dipperposition/service/IDipperDataAsyncTaskService.java index 8778f97..d5637f9 100644 --- a/src/main/java/com/telpo/dipperposition/service/IDipperDataAsyncTaskService.java +++ b/src/main/java/com/telpo/dipperposition/service/IDipperDataAsyncTaskService.java @@ -13,8 +13,8 @@ import org.springframework.beans.factory.annotation.Value; */ public interface IDipperDataAsyncTaskService { - @Autowired - void setDipperDataAsyncTaskService(IDipperDataAsyncTaskService IDipperDataAsyncTaskService); +// @Autowired +// void setDipperDataAsyncTaskService(IDipperDataAsyncTaskService IDipperDataAsyncTaskService); /** * 同步任务 * diff --git a/src/main/java/com/telpo/dipperposition/service/IpProvinceService.java b/src/main/java/com/telpo/dipperposition/service/IpProvinceService.java index e335e8f..cb58ab0 100644 --- a/src/main/java/com/telpo/dipperposition/service/IpProvinceService.java +++ b/src/main/java/com/telpo/dipperposition/service/IpProvinceService.java @@ -11,8 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired; */ public interface IpProvinceService { - @Autowired - void setIPProvinceService(IpProvinceService ipProvinceService); +// @Autowired +// void setIPProvinceService(IpProvinceService ipProvinceService); /** * 保存IP省份 * diff --git a/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java b/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java index 218b1d5..b2e42d8 100644 --- a/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java +++ b/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java @@ -2,6 +2,8 @@ package com.telpo.dipperposition.service.impl; import com.alibaba.fastjson.JSONObject; import com.telpo.dipperposition.common.*; +import com.telpo.dipperposition.config.NettyServerConfig; +import com.telpo.dipperposition.config.PositionConfig; import com.telpo.dipperposition.entity.mongo.IpProvinceEntity; import com.telpo.dipperposition.service.IDipperAstPosAsyncTaskService; import com.telpo.dipperposition.service.IpProvinceService; @@ -33,17 +35,21 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS @Autowired private OkHttpUtil okHttpUtil; @Autowired + private NettyServerConfig nettyServerConfig; + @Autowired + private PositionConfig positionConfig; + @Autowired private IpProvinceService ipProvinceService; - private static IDipperAstPosAsyncTaskService dipperAstPosAsyncTaskService; +// private static IDipperAstPosAsyncTaskService dipperAstPosAsyncTaskService; /** * spring会自动从ioc容器当中根据IDipperAstPosAsyncTaskService类型找到dipperAstPosAsyncTaskService,当做参数传进来 * */ - @Override - public void setDipperAstPosAsyncTaskService(IDipperAstPosAsyncTaskService dipperAstPosAsyncTaskService) { - this.dipperAstPosAsyncTaskService = dipperAstPosAsyncTaskService; - } +// @Override +// public void setDipperAstPosAsyncTaskService(IDipperAstPosAsyncTaskService dipperAstPosAsyncTaskService) { +// this.dipperAstPosAsyncTaskService = dipperAstPosAsyncTaskService; +// } private String centerProvince; private String centerProvinceFilePath; @@ -149,15 +155,16 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS */ @Override @Async("asyncServiceExecutor") - public String pushAstPos(String ipAddress, - String centerProvinceFilePath, - String centerProvince, - String ipPositionRequestPath, - String ipPositionRequestKey) throws UnsupportedEncodingException { - this.ipPositionRequestKey = ipPositionRequestKey; - this.ipPositionRequestPath = ipPositionRequestPath; - this.centerProvince = centerProvince; - this.centerProvinceFilePath = centerProvinceFilePath; +// public String pushAstPos(String ipAddress, +// String centerProvinceFilePath, +// String centerProvince, +// String ipPositionRequestPath, +// String ipPositionRequestKey) throws UnsupportedEncodingException { + public String pushAstPos(String ipAddress) { + this.ipPositionRequestKey = positionConfig.getIpPositionRequestKey(); + this.ipPositionRequestPath = positionConfig.getIpPositionRequestPath(); + this.centerProvince = positionConfig.getCenterProvince(); + this.centerProvinceFilePath = positionConfig.getCenterProvinceFilePath(); // (1) 获取省会城市信息 String centerAddress = getIpPositionProvince(ipAddress); if (ObjectUtils.isEmpty(centerAddress) || centerAddress.equals("0")) { diff --git a/src/main/java/com/telpo/dipperposition/service/impl/DipperAstTimeAsyncTaskServiceImpl.java b/src/main/java/com/telpo/dipperposition/service/impl/DipperAstTimeAsyncTaskServiceImpl.java index 964d01b..eebb377 100644 --- a/src/main/java/com/telpo/dipperposition/service/impl/DipperAstTimeAsyncTaskServiceImpl.java +++ b/src/main/java/com/telpo/dipperposition/service/impl/DipperAstTimeAsyncTaskServiceImpl.java @@ -21,16 +21,16 @@ import java.time.LocalDateTime; @Service @Slf4j public class DipperAstTimeAsyncTaskServiceImpl implements IDipperAstTimeAsyncTaskService { - - private static IDipperAstTimeAsyncTaskService dipperAstTimeAsyncTaskService; - /** - * spring会自动从ioc容器当中根据IDipperAstTimeAsyncTaskService类型找到dipperAstTimeAsyncTaskService,当做参数传进来 - * - */ - @Override - public void setDipperAstTimeAsyncTaskService(IDipperAstTimeAsyncTaskService dipperAstTimeAsyncTaskService) { - this.dipperAstTimeAsyncTaskService = dipperAstTimeAsyncTaskService; - } +// +// private static IDipperAstTimeAsyncTaskService dipperAstTimeAsyncTaskService; +// /** +// * spring会自动从ioc容器当中根据IDipperAstTimeAsyncTaskService类型找到dipperAstTimeAsyncTaskService,当做参数传进来 +// * +// */ +// @Override +// public void setDipperAstTimeAsyncTaskService(IDipperAstTimeAsyncTaskService dipperAstTimeAsyncTaskService) { +// this.dipperAstTimeAsyncTaskService = dipperAstTimeAsyncTaskService; +// } @Override @Async("asyncServiceExecutor") diff --git a/src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java b/src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java index 61f55db..5ccce12 100644 --- a/src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java +++ b/src/main/java/com/telpo/dipperposition/service/impl/DipperDataAsyncTaskServiceImpl.java @@ -31,15 +31,15 @@ public class DipperDataAsyncTaskServiceImpl implements IDipperDataAsyncTaskServi private SchedulingExecutorConfig schedulingExecutorConfig; - private static IDipperDataAsyncTaskService dipperDataAsyncTaskService; - /** - * spring会自动从ioc容器当中根据IDipperAstTimeAsyncTaskService类型找到dipperDataAsyncTaskService,当做参数传进来 - * - */ - @Override - public void setDipperDataAsyncTaskService(IDipperDataAsyncTaskService dipperDataAsyncTaskService) { - this.dipperDataAsyncTaskService = dipperDataAsyncTaskService; - } +// private static IDipperDataAsyncTaskService dipperDataAsyncTaskService; +// /** +// * spring会自动从ioc容器当中根据IDipperAstTimeAsyncTaskService类型找到dipperDataAsyncTaskService,当做参数传进来 +// * +// */ +// @Override +// public void setDipperDataAsyncTaskService(IDipperDataAsyncTaskService dipperDataAsyncTaskService) { +// this.dipperDataAsyncTaskService = dipperDataAsyncTaskService; +// } @Override public void pullAstEPH() { @@ -51,6 +51,7 @@ public class DipperDataAsyncTaskServiceImpl implements IDipperDataAsyncTaskServi log.error("获取星历数据错误,取不到星历数据。"); } else { // 保存到DB或者缓存 + log.info("保存到DB或者缓存"); redisUtil.set(DIPPER_DATA_KEY,dipperData); } } @@ -73,7 +74,7 @@ public class DipperDataAsyncTaskServiceImpl implements IDipperDataAsyncTaskServi } @Override - @Async("asyncServiceExecutor") + //@Async("asyncServiceExecutor") public String getAstEPH(){ return (String)redisUtil.get(DIPPER_DATA_KEY); } diff --git a/src/main/java/com/telpo/dipperposition/service/impl/IpProvinceServiceImpl.java b/src/main/java/com/telpo/dipperposition/service/impl/IpProvinceServiceImpl.java index ab282df..24c54cc 100644 --- a/src/main/java/com/telpo/dipperposition/service/impl/IpProvinceServiceImpl.java +++ b/src/main/java/com/telpo/dipperposition/service/impl/IpProvinceServiceImpl.java @@ -23,15 +23,15 @@ public class IpProvinceServiceImpl implements IpProvinceService { @Autowired private IpProvinceMapper ipProvinceMapper; - private static IpProvinceService ipProvinceService; - /** - * spring会自动从ioc容器当中根据IPProvinceService类型找到ipProvinceService,当做参数传进来 - * - */ - @Override - public void setIPProvinceService(IpProvinceService ipProvinceService) { - this.ipProvinceService = ipProvinceService; - } +// private static IpProvinceService ipProvinceService; +// /** +// * spring会自动从ioc容器当中根据IPProvinceService类型找到ipProvinceService,当做参数传进来 +// * +// */ +// @Override +// public void setIPProvinceService(IpProvinceService ipProvinceService) { +// this.ipProvinceService = ipProvinceService; +// } @Override public boolean saveIpProvince(IpProvinceEntity entity) { ipProvinceMapper.saveIp(entity);