mirror of
https://github.com/201206030/novel.git
synced 2025-07-04 20:36:39 +00:00
漫画专区上线
This commit is contained in:
@ -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();
|
||||
|
@ -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<Book> books = bookService.search(page, pageSize, userId, null, keyword, bookStatus, catId, softCat, softTag, sortBy, sort);
|
||||
List<BookVO> 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<Book> 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) {
|
||||
//查询基本信息
|
||||
|
Reference in New Issue
Block a user