From 3b1af08ca296f9cecc1944dd282031cc684fba23 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期二, 08 八月 2023 16:50:02 +0800
Subject: [PATCH] 图层控制器、角色图层控制器添加缓存功能

---
 src/main/java/com/moon/server/controller/sys/LayerController.java |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/moon/server/controller/sys/LayerController.java b/src/main/java/com/moon/server/controller/sys/LayerController.java
index 6462914..58a7525 100644
--- a/src/main/java/com/moon/server/controller/sys/LayerController.java
+++ b/src/main/java/com/moon/server/controller/sys/LayerController.java
@@ -5,6 +5,7 @@
 import com.moon.server.entity.all.ResponseMsg;
 import com.moon.server.entity.sys.LayerEntity;
 import com.moon.server.entity.sys.UserEntity;
+import com.moon.server.service.all.PermsService;
 import com.moon.server.service.sys.LayerService;
 import com.moon.server.service.sys.TokenService;
 import io.swagger.annotations.Api;
@@ -30,6 +31,9 @@
 
     @Autowired
     TokenService tokenService;
+
+    @Autowired
+    PermsService permsService;
 
     @SysLog()
     @ApiOperation(value = "鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟")
@@ -101,6 +105,9 @@
             }
 
             int count = layerService.insert(entity);
+            if (count > 0) {
+                permsService.clearLayerCache();
+            }
 
             return success(count);
         } catch (Exception ex) {
@@ -124,6 +131,9 @@
             }
 
             int count = layerService.inserts(list);
+            if (count > 0) {
+                permsService.clearLayerCache();
+            }
 
             return success(count);
         } catch (Exception ex) {
@@ -140,6 +150,9 @@
     public ResponseMsg<Integer> delete(int id) {
         try {
             int count = layerService.delete(id);
+            if (count > 0) {
+                permsService.clearLayerCache();
+            }
 
             return success(count);
         } catch (Exception ex) {
@@ -160,6 +173,9 @@
             }
 
             int count = layerService.deletes(ids);
+            if (count > 0) {
+                permsService.clearLayerCache();
+            }
 
             return success(count);
         } catch (Exception ex) {
@@ -182,6 +198,9 @@
             }
 
             int count = layerService.update(entity);
+            if (count > 0) {
+                permsService.clearLayerCache();
+            }
 
             return success(count);
         } catch (Exception ex) {
@@ -206,6 +225,9 @@
             }
 
             int count = layerService.updates(list);
+            if (count > 0) {
+                permsService.clearLayerCache();
+            }
 
             return success(count);
         } catch (Exception ex) {

--
Gitblit v1.9.3