|
@@ -2,6 +2,10 @@ package com.hssx.bms.controller;
|
|
|
|
|
|
|
|
|
import com.hssx.bms.entity.Book;
|
|
|
+import com.hssx.bms.entity.BookCategory;
|
|
|
+import com.hssx.bms.entity.BookPage;
|
|
|
+import com.hssx.bms.service.BookCategoryService;
|
|
|
+import com.hssx.bms.service.BookPageService;
|
|
|
import com.hssx.bms.service.BookService;
|
|
|
import com.hssx.bms.until.HttpRespMsg;
|
|
|
import com.hssx.bms.until.PageUtil;
|
|
@@ -13,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* @author 吴涛涛
|
|
|
* @since 2019-10-16
|
|
@@ -23,6 +29,10 @@ public class BookController {
|
|
|
|
|
|
@Autowired
|
|
|
private BookService bookService;
|
|
|
+ @Autowired
|
|
|
+ private BookPageService bookPageService;
|
|
|
+ @Autowired
|
|
|
+ private BookCategoryService bookCategoryService;
|
|
|
/**
|
|
|
* 图书信息的录入
|
|
|
* 参数:name 名称,author 作者,descrip 描述
|
|
@@ -50,5 +60,64 @@ public class BookController {
|
|
|
HttpRespMsg msg = bookService.getList(page);
|
|
|
return msg;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 图书信息的录入
|
|
|
+ * 参数:bookId 图书对应的id
|
|
|
+ * file 上传的图书图片文件数组
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "图书图片的上传", notes = "图书图片的上传方法")
|
|
|
+ @RequestMapping("/addBookPage")
|
|
|
+ @ResponseBody
|
|
|
+ public HttpRespMsg addBookPage(BookPage bookPage, @RequestParam(required = false) MultipartFile[] file){
|
|
|
+ HttpRespMsg msg = bookPageService.addBookPage(bookPage,file);
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 图书图片删除
|
|
|
+ * 参数:id 图书图片对应的id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "图书图片删除", notes = "图书图片删除方法")
|
|
|
+ @RequestMapping("/deleteBookPage")
|
|
|
+ @ResponseBody
|
|
|
+ public HttpRespMsg deleteBookPage(BookPage bookPage){
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ msg.data = bookPageService.removeById(bookPage.getId());
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 单个图书图片列表(图片总张数)
|
|
|
+ * 参数:bookId 图书的id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "单个图书图片列表(图片总张数)", notes = "单个图书图片列表(图片总张数)方法")
|
|
|
+ @RequestMapping("/bookPageList")
|
|
|
+ @ResponseBody
|
|
|
+ public HttpRespMsg bookPageList(BookPage bookPage){
|
|
|
+ HttpRespMsg msg = bookPageService.getBookPageList(bookPage);
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 图书目录的录入/修改
|
|
|
+ * 参数:bookId 图书id rank 章节(对应数字0-序 1-第一章 2-第二章...)
|
|
|
+ * name 目录名称 pageNum 起始页码
|
|
|
+ * 修改时:需要传 id 目录的id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "图书目录的录入和修改", notes = "图书目录的录入和修改方法")
|
|
|
+ @RequestMapping("/addOrUpdateRank")
|
|
|
+ @ResponseBody
|
|
|
+ public HttpRespMsg addOrUpdateRank(BookCategory BookCategory){
|
|
|
+ HttpRespMsg msg = bookCategoryService.addOrUpdateRank(BookCategory);
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|