Java毕业设计实战之book小说阅读系统的实现
book-小说
获取源码联系:大家点赞、收藏、关注、评论啦 👇🏻👇🏻👇🏻评论区获取联系方式👇🏻👇🏻👇🏻
软件架构
springboot+mybatisplus+jsoup+mysql
图片展示
登录
注册
头部
中间
底部
书架
小说详情
章节列表
阅读
抓取小说页面
抓取地址
代码截图
@RequestMapping("/book/editPage")
public String editPage(Model model, Integer bookId){
Book dbBook = bookService.findById(bookId);
model.addAttribute("book",dbBook);
return "book/book-edit";
}
//更新基本信息
@RequestMapping("/book/edit")
@ResponseBody
public ResultData edit(Book book){
return bookService.edit(book);
}
// 批量删除
@RequestMapping("/book/deleteAll")
@ResponseBody
public ResultData deleteAll(@RequestParam(name="ids") String ids){
//将ids转为数组
String[] idArr = ids.split(",");`
@RequestMapping("/book/editCondition")
@ResponseBody
public ResultData editCondition(Integer bookId, Integer condition){
return bookService.updateStatus(bookId,condition);
}
// 编辑页面
@RequestMapping("/book/editPage")
public String editPage(Model model, Integer bookId){
Book dbBook = bookService.findById(bookId);
model.addAttribute("book",dbBook);
return "book/book-edit";
}
//更新基本信息
@RequestMapping("/book/edit")
@ResponseBody
public ResultData edit(Book book){
return bookService.edit(book);
}
// 批量删除
@RequestMapping("/book/deleteAll")
@ResponseBody
public ResultData deleteAll(@RequestParam(name="ids") String ids){
//将ids转为数组
String[] idArr = ids.split(",");
//将字符串数组转为int数组
return bookService.batchDelete(idArr);
}
// search
@RequestMapping("/book/search")
public String searchList(Model model,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "3") Integer pageSize,
String keyword) {
PageInfo<Book> pageInfo=bookService.searchList(page,pageSize,keyword);
model.addAttribute("list",pageInfo.getList());
model.addAttribute("pageInfo",pageInfo);
return "book/book-list";
}
@RequestMapping("/book/search1")
public String searchList1(Model model,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "3") Integer pageSize,
String keyword1) {
PageInfo<Book> pageInfo=bookService.searchList1(page,pageSize,keyword1);
model.addAttribute("list",pageInfo.getList());
@RequestMapping(value = "/book/getByName",method = RequestMethod.POST)
public String getByName(String likeName, Model model, HttpSession session) throws UnsupportedEncodingException {
// String likeName1 = new String(likeName.getBytes("ISO-8859-1"),"utf-8");
List<Book> bookList = bookService.findByLikeName(likeName);
List<Book> randList = bookService.findRandList();
//将字符串数组转为int数组
session.setAttribute("bookList",bookList);
session.setAttribute("randList",randList);
return "/front/personal";
}
}
角色控制层:
@Controller
public class AuthorController {
@Autowired
private AuthorService authorService;
@RequestMapping("/zuozhe")
public String duzhe(){
return "loginauthor";
}
@RequestMapping("/zuoping")
public String zuoping(){
获取源码联系:大家点赞、收藏、关注、评论啦 👇🏻👇🏻👇🏻评论区获取联系方式👇🏻👇🏻👇🏻