|
@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.hssx.bms.entity.Book;
|
|
|
+import com.hssx.bms.entity.BookCategory;
|
|
|
+import com.hssx.bms.entity.BookPage;
|
|
|
import com.hssx.bms.entity.InstitutionalInformation;
|
|
|
+import com.hssx.bms.mapper.BookCategoryMapper;
|
|
|
import com.hssx.bms.mapper.BookMapper;
|
|
|
+import com.hssx.bms.mapper.BookPageMapper;
|
|
|
import com.hssx.bms.service.BookService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.hssx.bms.until.HttpRespMsg;
|
|
@@ -35,6 +39,10 @@ public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements Bo
|
|
|
private BookMapper bookMapper;
|
|
|
@Value("${upload.path}")
|
|
|
private String path;
|
|
|
+ @Resource
|
|
|
+ private BookPageMapper bookPageMapper;
|
|
|
+ @Resource
|
|
|
+ private BookCategoryMapper bookCategoryMapper;
|
|
|
|
|
|
@Override
|
|
|
public HttpRespMsg addOrUpdateBook(Book book, MultipartFile file) {
|
|
@@ -73,4 +81,13 @@ public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements Bo
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg del(String id) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ bookMapper.deleteById(id);
|
|
|
+ bookPageMapper.delete(new QueryWrapper<BookPage>().eq("book_id",id));
|
|
|
+ bookCategoryMapper.delete(new QueryWrapper<BookCategory>().eq("book_id",id));
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
}
|