From c6e81465dc997b6ccff0d3ee7ccf1e4b42d7da5b Mon Sep 17 00:00:00 2001 From: ZZ Date: Fri, 30 Jul 2021 16:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=9B=B4=E6=8E=A5=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=B4=B9=E7=8E=87=E6=A8=A1=E5=9E=8B=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=A1=A9=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xhpc/pp/controller/StationController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java index dcf7e2ce..e80b096f 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java @@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; +import java.util.Set; + import static com.xhpc.pp.server.ChargingPileServer.REDIS; @RestController @@ -24,7 +26,10 @@ public class StationController { String rkey = "rateModel:".concat(rateModelId.toString()); REDIS.setCacheObject(rkey, rateModel); String rmskey = "rateModelStation:".concat(stationId.toString()); - REDIS.setCacheSet(rmskey, cacheStation.getPiles()); + Set piles = cacheStation.getPiles(); + if (piles!=null) { + REDIS.setCacheSet(rmskey, piles); + } return R.ok(); }