|
@@ -6,6 +6,7 @@ import com.book.dao.cpsshard.entity.UserRecentlyRead;
|
|
|
import com.book.server.common.entity.Result;
|
|
|
import com.book.server.common.entity.ResultCode;
|
|
|
import com.book.dao.VO.*;
|
|
|
+import com.book.server.service.BlockCacheGuava;
|
|
|
import com.book.server.service.BookService;
|
|
|
import com.book.server.service.CacheService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -91,17 +92,6 @@ public class BookController extends BaseController {
|
|
|
return Result.byObject(list);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 更新block缓存
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- //@GetMapping("/resetBlockCache")
|
|
|
- //@CacheEvict(value = "block", allEntries = true)
|
|
|
- //public Result resetBlockCache() {
|
|
|
- // return Result.byObject("OK");
|
|
|
- //}
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 导入书库
|
|
@@ -193,6 +183,7 @@ public class BookController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private CacheService cacheService;
|
|
|
+
|
|
|
/**
|
|
|
* 自定义书籍上传
|
|
|
*
|
|
@@ -236,4 +227,18 @@ public class BookController extends BaseController {
|
|
|
public Result updateBookContent(@RequestBody BookContentVO bookContentVO) {
|
|
|
return Result.byObject(bookService.updateBookContent(bookContentVO));
|
|
|
}
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private BlockCacheGuava blockCacheGuava;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新 block 缓存
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/updateBlockCache")
|
|
|
+ public Result updateBlockCache() {
|
|
|
+ blockCacheGuava.clearCache();
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
}
|