Browse Source

清理缓存

wangchangsheng 2 years ago
parent
commit
fbff8980c2

+ 6 - 0
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicEnergyGroupController.java

@@ -2,11 +2,13 @@ package com.gyee.backconfig.controller;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.CacheContext;
 import com.gyee.backconfig.config.R;
 import com.gyee.backconfig.model.auto.ProBasicEnergyGroup;
 import com.gyee.backconfig.service.auto.IProBasicEnergyGroupService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -27,6 +29,9 @@ public class ProBasicEnergyGroupController {
     @Resource
     private IProBasicEnergyGroupService proBasicEnergyGroupService;
 
+    @Autowired
+    private CacheContext cacheContext;
+
     /**
      * 查询
      * @param id
@@ -62,6 +67,7 @@ public class ProBasicEnergyGroupController {
 
         boolean b = proBasicEnergyGroupService.saveOrUpdate(proBasicEnergyGroup);
         if (b) {
+            cacheContext.initGroupList();
             return R.ok().data(b);
         } else {
             return R.error().data("保存失败!");