|
|
|
@ -15,7 +15,7 @@ public class BookController {
|
|
|
|
|
@Autowired
|
|
|
|
|
Result res;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//初始化获取图书信息
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@GetMapping("/getallbooks")
|
|
|
|
|
public Result getAllBooks(){
|
|
|
|
@ -28,6 +28,7 @@ public class BookController {
|
|
|
|
|
else{
|
|
|
|
|
res.setCode(0);
|
|
|
|
|
res.setMsg("获取成功");
|
|
|
|
|
res.data.clear();
|
|
|
|
|
for (Book book : books) {
|
|
|
|
|
res.data.add(book);
|
|
|
|
|
}
|
|
|
|
@ -35,6 +36,7 @@ public class BookController {
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//通过类别实现图书查找
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@GetMapping("/getbooks")
|
|
|
|
|
public Result getAllBooksByKind(@RequestParam("kind")String kind){
|
|
|
|
@ -47,6 +49,7 @@ public class BookController {
|
|
|
|
|
else{
|
|
|
|
|
res.setCode(0);
|
|
|
|
|
res.setMsg("获取成功");
|
|
|
|
|
res.data.clear();
|
|
|
|
|
for (Book book : books) {
|
|
|
|
|
res.data.add(book);
|
|
|
|
|
}
|
|
|
|
@ -54,6 +57,7 @@ public class BookController {
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//通过书名查找
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@GetMapping("/searchbooks")
|
|
|
|
|
public Result getAllBooksBySearch(@RequestParam("bookname")String bookname){
|
|
|
|
@ -66,13 +70,14 @@ public class BookController {
|
|
|
|
|
else{
|
|
|
|
|
res.setCode(0);
|
|
|
|
|
res.setMsg("获取成功");
|
|
|
|
|
res.data.clear();
|
|
|
|
|
for (Book book : books) {
|
|
|
|
|
res.data.add(book);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
//添加型图书 图书表结构更改
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@PostMapping("/addbook")
|
|
|
|
@ -106,5 +111,5 @@ public class BookController {
|
|
|
|
|
res.data=null;
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|