Browse Source

更新缓存

tianyunperfect 3 years ago
parent
commit
e4f26ec217

+ 12 - 0
book-server/src/main/java/com/book/server/controller/WxPayController.java

@@ -61,6 +61,13 @@ public class WxPayController extends BaseController {
 
 
     }
     }
 
 
+    /**
+     * 跳转中间页
+     * @param userId
+     * @param code
+     * @param page
+     * @return
+     */
     @GetMapping("/page")
     @GetMapping("/page")
     public String chargePage(@RequestParam("userId") String userId, @RequestParam("code") String code,@RequestParam("state") String page) {
     public String chargePage(@RequestParam("userId") String userId, @RequestParam("code") String code,@RequestParam("state") String page) {
 
 
@@ -68,6 +75,11 @@ public class WxPayController extends BaseController {
         return wxPayService.chargePage(userId, code,page);
         return wxPayService.chargePage(userId, code,page);
     }
     }
 
 
+    /**
+     * 查询订单
+     * @param orderId
+     * @return
+     */
     @GetMapping("/query")
     @GetMapping("/query")
     public Result<OrderVo> queryOrder(@RequestParam("orderId") String orderId){
     public Result<OrderVo> queryOrder(@RequestParam("orderId") String orderId){
         return  Result.success(wxPayService.queryOrder(orderId));
         return  Result.success(wxPayService.queryOrder(orderId));

+ 6 - 0
book-server/src/main/java/com/book/server/service/BlockCacheGuava.java

@@ -39,5 +39,11 @@ public class BlockCacheGuava {
     public void clearCache() {
     public void clearCache() {
         blockResCache.refresh(1);
         blockResCache.refresh(1);
         blockResCache.refresh(2);
         blockResCache.refresh(2);
+        cacheService.deleteSmartRecommandCache("1");
+        cacheService.deleteSmartRecommandCache("2");
+        cacheService.deleteTopRecommendCache("1");
+        cacheService.deleteTopRecommendCache("2");
+        cacheService.deleteSearchKeywordsCache("1");
+        cacheService.deleteSearchKeywordsCache("2");
     }
     }
 }
 }

+ 14 - 1
book-server/src/main/java/com/book/server/service/CacheService.java

@@ -207,6 +207,10 @@ public class CacheService {
         return searchKeywords;
         return searchKeywords;
     }
     }
 
 
+    @CacheFind(key = "searchKeyword", delete = true)
+    public void deleteSearchKeywordsCache(String sex) {
+    }
+
     @CacheFind(key = "smartRecommand")
     @CacheFind(key = "smartRecommand")
     public List<BookRes> setSmartRecommandCache(String sex) {
     public List<BookRes> setSmartRecommandCache(String sex) {
         QueryVO queryVO = new QueryVO();
         QueryVO queryVO = new QueryVO();
@@ -215,6 +219,10 @@ public class CacheService {
         return bookRes;
         return bookRes;
     }
     }
 
 
+    @CacheFind(key = "smartRecommand", delete = true)
+    public void deleteSmartRecommandCache(String sex) {
+    }
+
     @CacheFind(key = "topRecommend")
     @CacheFind(key = "topRecommend")
     public List<BookRes> setTopRecommendCache(String sex) {
     public List<BookRes> setTopRecommendCache(String sex) {
         QueryVO queryVO = new QueryVO();
         QueryVO queryVO = new QueryVO();
@@ -223,6 +231,10 @@ public class CacheService {
         return bookRes;
         return bookRes;
     }
     }
 
 
+    @CacheFind(key = "topRecommend", delete = true)
+    public void deleteTopRecommendCache(String sex) {
+    }
+
     @Autowired
     @Autowired
     private UserService userService;
     private UserService userService;
 
 
@@ -239,7 +251,8 @@ public class CacheService {
     public EditBook getEditBookCache(Long bookId, Long chapterId) {
     public EditBook getEditBookCache(Long bookId, Long chapterId) {
         return bookService.getEditBookContent(bookId, chapterId);
         return bookService.getEditBookContent(bookId, chapterId);
     }
     }
-    @CacheFind(key = "edit_book",update = true)
+
+    @CacheFind(key = "edit_book", update = true)
     public EditBook updateEditBookCache(Long bookId, Long chapterId) {
     public EditBook updateEditBookCache(Long bookId, Long chapterId) {
         return bookService.getEditBookContent(bookId, chapterId);
         return bookService.getEditBookContent(bookId, chapterId);
     }
     }