diff --git a/novel-front/pom.xml b/novel-front/pom.xml
index 762f007..a2a7407 100644
--- a/novel-front/pom.xml
+++ b/novel-front/pom.xml
@@ -27,24 +27,6 @@
${jjwt.version}
-
- org.springframework.boot
- spring-boot-starter-amqp
-
-
-
-
- io.searchbox
- jest
- ${jest.version}
-
-
-
- org.elasticsearch.client
- elasticsearch-rest-high-level-client
- ${elasticsearch.version}
-
-
com.aliyun.oss
@@ -70,14 +52,6 @@
-
-
-
-
com.alipay.sdk
alipay-sdk-java
diff --git a/novel-front/src/main/java/com/java2nb/novel/controller/BookController.java b/novel-front/src/main/java/com/java2nb/novel/controller/BookController.java
index d95cc2c..5581bb1 100644
--- a/novel-front/src/main/java/com/java2nb/novel/controller/BookController.java
+++ b/novel-front/src/main/java/com/java2nb/novel/controller/BookController.java
@@ -7,18 +7,16 @@ import com.java2nb.novel.entity.BookCategory;
import com.java2nb.novel.entity.BookComment;
import com.java2nb.novel.entity.BookIndex;
import com.java2nb.novel.service.BookContentService;
+import com.java2nb.novel.service.BookService;
import com.java2nb.novel.vo.BookCommentVO;
import com.java2nb.novel.vo.BookSettingVO;
import com.java2nb.novel.vo.BookSpVO;
-import com.java2nb.novel.service.BookService;
import com.java2nb.novel.vo.BookVO;
import io.github.xxyopen.model.page.PageBean;
import io.github.xxyopen.model.page.builder.pagehelper.PageBuilder;
import io.github.xxyopen.model.resp.RestResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-import org.springframework.amqp.rabbit.core.RabbitTemplate;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@@ -37,14 +35,8 @@ public class BookController extends BaseController {
private final BookService bookService;
- private final RabbitTemplate rabbitTemplate;
-
private final Map bookContentServiceMap;
- @Value("${spring.rabbitmq.enable}")
- private Integer enableMq;
-
-
/**
* 查询首页小说设置列表数据
*/
@@ -89,7 +81,8 @@ public class BookController extends BaseController {
* 分页搜索
*/
@GetMapping("searchByPage")
- public RestResult> searchByPage(BookSpVO bookSP, @RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "20") int pageSize) {
+ public RestResult> searchByPage(BookSpVO bookSP, @RequestParam(value = "curr", defaultValue = "1") int page,
+ @RequestParam(value = "limit", defaultValue = "20") int pageSize) {
return RestResult.ok(bookService.searchByPage(bookSP, page, pageSize));
}
@@ -106,7 +99,8 @@ public class BookController extends BaseController {
* 查询小说排行信息
*/
@GetMapping("listRank")
- public RestResult> listRank(@RequestParam(value = "type", defaultValue = "0") Byte type, @RequestParam(value = "limit", defaultValue = "30") Integer limit) {
+ public RestResult> listRank(@RequestParam(value = "type", defaultValue = "0") Byte type,
+ @RequestParam(value = "limit", defaultValue = "30") Integer limit) {
return RestResult.ok(bookService.listRank(type, limit));
}
@@ -115,11 +109,7 @@ public class BookController extends BaseController {
*/
@PostMapping("addVisitCount")
public RestResult addVisitCount(Long bookId) {
- if (enableMq == 1) {
- rabbitTemplate.convertAndSend("ADD-BOOK-VISIT-EXCHANGE", null, bookId);
- } else {
- bookService.addVisitCount(bookId, 1);
- }
+ bookService.addVisitCount(bookId, 1);
return RestResult.ok();
}
@@ -131,7 +121,8 @@ public class BookController extends BaseController {
Map data = new HashMap<>(2);
data.put("bookIndexCount", bookService.queryIndexCount(bookId));
BookIndex bookIndex = bookService.queryBookIndex(lastBookIndexId);
- String lastBookContent = bookContentServiceMap.get(bookIndex.getStorageType()).queryBookContent(bookId,lastBookIndexId).getContent();
+ String lastBookContent = bookContentServiceMap.get(bookIndex.getStorageType())
+ .queryBookContent(bookId, lastBookIndexId).getContent();
if (lastBookContent.length() > 42) {
lastBookContent = lastBookContent.substring(0, 42);
}
@@ -152,7 +143,9 @@ public class BookController extends BaseController {
* 分页查询书籍评论列表
*/
@GetMapping("listCommentByPage")
- public RestResult> listCommentByPage(@RequestParam("bookId") Long bookId, @RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize) {
+ public RestResult> listCommentByPage(@RequestParam("bookId") Long bookId,
+ @RequestParam(value = "curr", defaultValue = "1") int page,
+ @RequestParam(value = "limit", defaultValue = "5") int pageSize) {
return RestResult.ok(bookService.listCommentByPage(null, bookId, page, pageSize));
}
@@ -181,7 +174,10 @@ public class BookController extends BaseController {
* 目录页
*/
@GetMapping("/queryIndexList")
- public RestResult> indexList(Long bookId, @RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize, @RequestParam(value = "orderBy", defaultValue = "index_num desc") String orderBy) {
+ public RestResult> indexList(Long bookId,
+ @RequestParam(value = "curr", defaultValue = "1") int page,
+ @RequestParam(value = "limit", defaultValue = "5") int pageSize,
+ @RequestParam(value = "orderBy", defaultValue = "index_num desc") String orderBy) {
return RestResult.ok(PageBuilder.build(bookService.queryIndexList(bookId, orderBy, page, pageSize)));
}
diff --git a/novel-front/src/main/java/com/java2nb/novel/page/PageController.java b/novel-front/src/main/java/com/java2nb/novel/controller/PageController.java
similarity index 83%
rename from novel-front/src/main/java/com/java2nb/novel/page/PageController.java
rename to novel-front/src/main/java/com/java2nb/novel/controller/PageController.java
index 873624a..f32f6d6 100644
--- a/novel-front/src/main/java/com/java2nb/novel/page/PageController.java
+++ b/novel-front/src/main/java/com/java2nb/novel/controller/PageController.java
@@ -1,6 +1,5 @@
-package com.java2nb.novel.page;
+package com.java2nb.novel.controller;
-import com.java2nb.novel.controller.BaseController;
import com.java2nb.novel.core.bean.UserDetails;
import com.java2nb.novel.core.utils.ThreadLocalUtil;
import com.java2nb.novel.entity.*;
@@ -12,15 +11,12 @@ import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@@ -34,9 +30,6 @@ import java.util.concurrent.ThreadPoolExecutor;
@Controller
public class PageController extends BaseController {
- @Value("${content.save.path}")
- private String fileSavePath;
-
private final BookService bookService;
private final NewsService newsService;
@@ -55,7 +48,8 @@ public class PageController extends BaseController {
}
@RequestMapping("{module}/{url}.html")
- public String module2(@PathVariable("module") String module, @PathVariable("url") String url, HttpServletRequest request) {
+ public String module2(@PathVariable("module") String module, @PathVariable("url") String url,
+ HttpServletRequest request) {
if (request.getRequestURI().startsWith("/author")) {
//访问作者专区
@@ -75,7 +69,8 @@ public class PageController extends BaseController {
}
@RequestMapping("{module}/{classify}/{url}.html")
- public String module3(@PathVariable("module") String module, @PathVariable("classify") String classify, @PathVariable("url") String url) {
+ public String module3(@PathVariable("module") String module, @PathVariable("classify") String classify,
+ @PathVariable("url") String url) {
return module + "/" + classify + "/" + url;
}
@@ -86,9 +81,11 @@ public class PageController extends BaseController {
@RequestMapping(path = {"/", "/index", "/index.html"})
public String index(Model model) {
//加载小说首页小说基本信息线程
- CompletableFuture