mirror of
https://github.com/201206030/novel-plus.git
synced 2025-06-24 04:46:37 +00:00
作家后台新增作品封片图片修改功能
This commit is contained in:
@ -160,6 +160,17 @@ public class AuthorController extends BaseController{
|
||||
return ResultBean.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小说封面
|
||||
*/
|
||||
@PostMapping("updateBookPic")
|
||||
public ResultBean updateBookPic(@RequestParam("bookId") Long bookId,@RequestParam("bookPic") String bookPic,HttpServletRequest request) {
|
||||
Author author = checkAuthor(request);
|
||||
bookService.updateBookPic(bookId,bookPic, author.getId());
|
||||
return ResultBean.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 作家日收入统计数据分页列表查询
|
||||
* */
|
||||
|
@ -279,4 +279,12 @@ public interface BookService {
|
||||
* @param authorId
|
||||
*/
|
||||
void updateBookContent( Long indexId, String indexName, String content, Long authorId);
|
||||
|
||||
/**
|
||||
* 修改小说封面
|
||||
* @param bookId
|
||||
* @param bookPic
|
||||
* @param authorId
|
||||
*/
|
||||
void updateBookPic(Long bookId, String bookPic, Long authorId);
|
||||
}
|
||||
|
@ -830,5 +830,18 @@ public class BookServiceImpl implements BookService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBookPic(Long bookId, String bookPic, Long authorId) {
|
||||
bookMapper.update(update(book)
|
||||
.set(picUrl)
|
||||
.equalTo(bookPic)
|
||||
.set(updateTime)
|
||||
.equalTo(new Date())
|
||||
.where(id, isEqualTo(bookId))
|
||||
.and(BookDynamicSqlSupport.authorId, isEqualTo(authorId))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user