优化数据字典缓存刷新机制
authorTang Cheng <cheng.tang@supwisdom.com>
Sat, 13 Jul 2019 12:55:55 +0000 (20:55 +0800)
committerTang Cheng <cheng.tang@supwisdom.com>
Sat, 13 Jul 2019 12:55:55 +0000 (20:55 +0800)
payapi/src/main/java/com/supwisdom/dlpay/system/controller/DictPoolAction.java
payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/DictionaryDataServiceImpl.java

index 16e68da..aa8bf76 100644 (file)
@@ -22,7 +22,9 @@ public class DictPoolAction {
 
   @GetMapping("/dictpool")
   public Map getDictDataByDicttype(@RequestParam("dicttype") String dictType, HttpServletRequest request) {
-    dictType = request.getParameter("dicttype");
+    if (dictType == null) {
+      dictType = request.getParameter("dicttype");
+    }
     return dictionaryProxy.getDictionaryAsMap(dictType);
   }
 
index 1b9a14e..0f93d76 100644 (file)
@@ -54,7 +54,7 @@ public class DictionaryDataServiceImpl implements DictionaryDataService {
   }
 
   @Override
-  @CacheEvict(cacheNames = "dictionary_cache", allEntries = true)
+  @CacheEvict(cacheNames = "dictionary_cache", key = "'.*'", allEntries = true)
   public void refreshCache() {
 
   }