作家后台新增作品封片图片修改功能

This commit is contained in:
xiongxiaoyang
2021-04-24 10:38:55 +08:00
parent 419d7a971b
commit fb0098aef8
5 changed files with 89 additions and 26 deletions

View File

@ -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();
}
/**
* 作家日收入统计数据分页列表查询
* */

View File

@ -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);
}

View File

@ -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));
}
}