From 90d710f099645da8343bf8e8cb66dca15c3692b7 Mon Sep 17 00:00:00 2001 From: Gary Date: Mon, 4 Mar 2024 17:37:39 +0800 Subject: [PATCH] 1.evict cache when journal add/delete --- .../java/com/luoo/music/controller/CMSJournalController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/luoo_music/src/main/java/com/luoo/music/controller/CMSJournalController.java b/luoo_music/src/main/java/com/luoo/music/controller/CMSJournalController.java index 3c27535..50a014c 100644 --- a/luoo_music/src/main/java/com/luoo/music/controller/CMSJournalController.java +++ b/luoo_music/src/main/java/com/luoo/music/controller/CMSJournalController.java @@ -50,6 +50,7 @@ public class CMSJournalController { @ApiOperation(value = "新增期刊", notes = "新增期刊") @RequestMapping(value = "/add", method = RequestMethod.POST) public Result add(@ApiParam(value = "期刊信息", required = true) @Valid @RequestBody JournalAddModel addModel){ + cacheChannel.evict("default", "journal_filter"); cacheChannel.clear(Constants.J2CACHE_REGION_JOURNAL_QUERY_PAGE); return journalService.add(addModel); } @@ -86,6 +87,7 @@ public class CMSJournalController { @ApiOperation(value = "删除单条期刊", notes = "物理删除") @RequestMapping(value="/{id}", method= RequestMethod.DELETE) public Result delete(@ApiParam(value = "期刊ID", required = true) @PathVariable String id){ + cacheChannel.evict("default", "journal_filter"); cacheChannel.clear(Constants.J2CACHE_REGION_JOURNAL_QUERY_PAGE); return journalService.deleteById(id); }