mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-17 23:46:12 +08:00
后台添加图书、修改图书、书籍管理列表页功能完成;修正一处数据渲染错误;一些小调整
This commit is contained in:
@@ -74,7 +74,6 @@ public class BookServiceImpl implements BookService {
|
||||
|
||||
@Override
|
||||
public Integer addBook(BookModel bookModel) throws BusinessException {
|
||||
|
||||
// 校验入参
|
||||
ValidationResult result = validator.validate(bookModel);
|
||||
if (result.isHasErrors()) {
|
||||
@@ -85,6 +84,18 @@ public class BookServiceImpl implements BookService {
|
||||
return bookDOMapper.insertSelective(bookDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer modifyBook(BookModel bookModel) throws BusinessException {
|
||||
// 校验入参
|
||||
ValidationResult result = validator.validate(bookModel);
|
||||
if (result.isHasErrors()) {
|
||||
throw new BusinessException(BusinessErrorCode.PARAMETER_VALIDATION_ERROR, result.getErrMsg());
|
||||
}
|
||||
|
||||
BookDO bookDO = convertToDataObjecct(bookModel);
|
||||
return bookDOMapper.updateByPrimaryKeySelective(bookDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户收藏书籍
|
||||
*
|
||||
|
Reference in New Issue
Block a user