fix: batch publishing does not refresh private status (#1821)

pull/1824/head^2
guqing 2022-04-06 16:08:39 +08:00 committed by GitHub
parent 09f1f4d9db
commit 63e8cd0cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -206,6 +206,14 @@ public class PostServiceImpl extends BasePostServiceImpl<Post> implements PostSe
return updatedPost; return updatedPost;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public Post updateStatus(PostStatus status, Integer postId) {
Post post = super.updateStatus(status, postId);
eventPublisher.publishEvent(new PostUpdatedEvent(this, post));
return post;
}
@Override @Override
public Post getBy(PostStatus status, String slug) { public Post getBy(PostStatus status, String slug) {
return super.getBy(status, slug); return super.getBy(status, slug);