fix: the problem that meta is not deleted when the sheet is deleted.

pull/461/head
ruibaby 2020-01-01 21:39:52 +08:00
parent 79e66cd3c0
commit 013fa1fdcb
2 changed files with 5 additions and 1 deletions

View File

@ -43,7 +43,7 @@ public class SheetParam implements InputConverter<Sheet> {
private Date createTime; private Date createTime;
@Size(max = 255, message = "Length of password must not be more than {max}") @Size(max = 255, message = "页面密码的字符长度不能超过 {max}")
private String password; private String password;
@Size(max = 255, message = "Length of template must not be more than {max}") @Size(max = 255, message = "Length of template must not be more than {max}")

View File

@ -226,6 +226,10 @@ public class SheetServiceImpl extends BasePostServiceImpl<Sheet> implements Shee
@Override @Override
public Sheet removeById(Integer id) { public Sheet removeById(Integer id) {
// Remove sheet metas
List<SheetMeta> sheetMetas = sheetMetaService.removeByPostId(id);
log.debug("Removed sheet metas: [{}]", sheetMetas);
// Remove sheet comments // Remove sheet comments
List<SheetComment> sheetComments = sheetCommentService.removeByPostId(id); List<SheetComment> sheetComments = sheetCommentService.removeByPostId(id);
log.debug("Removed sheet comments: [{}]", sheetComments); log.debug("Removed sheet comments: [{}]", sheetComments);