mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-05 16:56:39 +00:00
实现小说内容多种存储方式(txt、db..)并存
This commit is contained in:
@ -37,10 +37,10 @@ public class BookController extends BaseController {
|
||||
|
||||
private final BookService bookService;
|
||||
|
||||
private final BookContentService bookContentService;
|
||||
|
||||
private final RabbitTemplate rabbitTemplate;
|
||||
|
||||
private final Map<String, BookContentService> bookContentServiceMap;
|
||||
|
||||
@Value("${spring.rabbitmq.enable}")
|
||||
private Integer enableMq;
|
||||
|
||||
@ -130,7 +130,8 @@ public class BookController extends BaseController {
|
||||
public ResultBean<Map<String, Object>> queryBookIndexAbout(Long bookId, Long lastBookIndexId) {
|
||||
Map<String, Object> data = new HashMap<>(2);
|
||||
data.put("bookIndexCount", bookService.queryIndexCount(bookId));
|
||||
String lastBookContent = bookContentService.queryBookContent(bookId,lastBookIndexId).getContent();
|
||||
BookIndex bookIndex = bookService.queryBookIndex(lastBookIndexId);
|
||||
String lastBookContent = bookContentServiceMap.get(bookIndex.getStorageType()).queryBookContent(bookId,lastBookIndexId).getContent();
|
||||
if (lastBookContent.length() > 42) {
|
||||
lastBookContent = lastBookContent.substring(0, 42);
|
||||
}
|
||||
|
Reference in New Issue
Block a user