diff --git a/novel-front/src/main/java/xyz/zinglizingli/books/service/BookService.java b/novel-front/src/main/java/xyz/zinglizingli/books/service/BookService.java index 235b55f..a7b30cd 100644 --- a/novel-front/src/main/java/xyz/zinglizingli/books/service/BookService.java +++ b/novel-front/src/main/java/xyz/zinglizingli/books/service/BookService.java @@ -211,6 +211,10 @@ public class BookService { catName = "轻小说"; break; } + case 9: { + catName = "漫画"; + break; + } default: { break; } @@ -458,6 +462,28 @@ public class BookService { } + public String getMhCatNameById(Integer softCat) { + String catName = "其他"; + + switch (softCat) { + case 3262: { + catName = "少年漫"; + break; + } + case 3263: { + catName = "少女漫"; + break; + } + default: { + break; + } + + + } + return catName; + + } + public void sendBullet(Long contentId, String bullet) { ScreenBullet screenBullet = new ScreenBullet(); diff --git a/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java b/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java index 42902a2..86258ba 100644 --- a/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java +++ b/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java @@ -150,6 +150,41 @@ public class BookController { return "books/soft_book_search"; } + @RequestMapping("searchMhBook.html") + public String searchMhBook(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "20") int pageSize, + @RequestParam(value = "keyword", required = false) String keyword, @RequestParam(value = "catId", defaultValue = "9") Integer catId, + @RequestParam(value = "softCat", required = false) Integer softCat, + @RequestParam(value = "bookStatus", required = false) String bookStatus, + @RequestParam(value = "softTag", required = false) String softTag, + @RequestParam(value = "sortBy", defaultValue = "update_time") String sortBy, @RequestParam(value = "sort", defaultValue = "DESC") String sort, + HttpServletRequest req, HttpServletResponse resp, ModelMap modelMap) { + + String userId = null; + List books = bookService.search(page, pageSize, userId, null, keyword, bookStatus, catId, softCat, softTag, sortBy, sort); + List bookVOList; + bookVOList = new ArrayList<>(); + for (Book book : books) { + BookVO bookvo = new BookVO(); + BeanUtils.copyProperties(book, bookvo); + bookvo.setCateName(bookService.getMhCatNameById(bookvo.getSoftCat())); + bookVOList.add(bookvo); + } + + + PageInfo bookPageInfo = new PageInfo<>(books); + modelMap.put("limit", bookPageInfo.getPageSize()); + modelMap.put("curr", bookPageInfo.getPageNum()); + modelMap.put("total", bookPageInfo.getTotal()); + modelMap.put("books", bookVOList); + modelMap.put("keyword", keyword); + modelMap.put("bookStatus", bookStatus); + modelMap.put("softCat", softCat); + modelMap.put("softTag", softTag); + modelMap.put("sortBy", sortBy); + modelMap.put("sort", sort); + return "books/mh_book_search"; + } + @RequestMapping("{bookId}.html") public String detail(@PathVariable("bookId") Long bookId, ModelMap modelMap) { //查询基本信息 diff --git a/novel-front/src/main/resources/application.yml b/novel-front/src/main/resources/application.yml index 0f7f852..56d3c2a 100644 --- a/novel-front/src/main/resources/application.yml +++ b/novel-front/src/main/resources/application.yml @@ -3,12 +3,12 @@ server: spring: datasource: - url: jdbc:mysql://148.70.59.92:3306/books?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai - username: xiongxiaoyang - password: Lzslov123! -# url: jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf-8 -# username: books -# password: books +# url: jdbc:mysql://148.70.59.92:3306/books?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai +# username: xiongxiaoyang +# password: Lzslov123! + url: jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai + username: root + password: test123456 cache: ehcache: config: classpath:ehcache.xml diff --git a/novel-front/src/main/resources/mybatis/mapping/BookMapper.xml b/novel-front/src/main/resources/mybatis/mapping/BookMapper.xml index cd89155..909807c 100644 --- a/novel-front/src/main/resources/mybatis/mapping/BookMapper.xml +++ b/novel-front/src/main/resources/mybatis/mapping/BookMapper.xml @@ -320,7 +320,7 @@ - AND book.catId ]]> 8 + AND book.catId 8 diff --git a/novel-front/src/main/resources/templates/books/mh_book_search.html b/novel-front/src/main/resources/templates/books/mh_book_search.html new file mode 100644 index 0000000..f0b555d --- /dev/null +++ b/novel-front/src/main/resources/templates/books/mh_book_search.html @@ -0,0 +1,289 @@ + + + + + + + + 精品小说楼_漫画专区 + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+
+ +
+
+ +
+ + +
+ +
+ +
+
+
+ +
+
+
+ +
+
+
+
+
更新: +
+
+
+

简介:

+
+ +
+
+
+ + +
+ +
+ + +
+ + +
+
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/novel-front/src/main/resources/templates/common/footer.html b/novel-front/src/main/resources/templates/common/footer.html index 597a74d..cdfbf36 100644 --- a/novel-front/src/main/resources/templates/common/footer.html +++ b/novel-front/src/main/resources/templates/common/footer.html @@ -1,5 +1,6 @@