pull/756/head
Ryan Wang 2020-04-05 14:51:07 +08:00 committed by GitHub
parent 3a45b7a5ed
commit ba1eb8fc50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -80,11 +80,12 @@ public class CommentEventListener {
User user = userService.getCurrentUser().orElseThrow(() -> new ServiceException("未查询到博主信息"));
Map<String, Object> data = new HashMap<>();
StringBuilder subject = new StringBuilder();
Boolean enabledAbsolutePath = optionService.isEnabledAbsolutePath();
if (newEvent.getSource() instanceof PostCommentService) {
// Get postComment id
PostComment postComment = postCommentService.getById(newEvent.getCommentId());
@ -93,7 +94,7 @@ public class CommentEventListener {
BasePostMinimalDTO post = postService.convertToMinimal(postService.getById(postComment.getPostId()));
data.put("pageFullPath", post.getFullPath());
data.put("pageFullPath", enabledAbsolutePath ? post.getFullPath() : optionService.getBlogBaseUrl() + post.getFullPath());
data.put("pageTitle", post.getTitle());
data.put("author", postComment.getAuthor());
data.put("content", postComment.getContent());
@ -109,7 +110,7 @@ public class CommentEventListener {
BasePostMinimalDTO sheet = sheetService.convertToMinimal(sheetService.getById(sheetComment.getPostId()));
data.put("pageFullPath", sheet.getFullPath());
data.put("pageFullPath", enabledAbsolutePath ? sheet.getFullPath() : optionService.getBlogBaseUrl() + sheet.getFullPath());
data.put("pageTitle", sheet.getTitle());
data.put("author", sheetComment.getAuthor());
data.put("content", sheetComment.getContent());
@ -167,6 +168,8 @@ public class CommentEventListener {
StringBuilder subject = new StringBuilder();
Boolean enabledAbsolutePath = optionService.isEnabledAbsolutePath();
log.debug("replyEvent.getSource():" + replyEvent.getSource().toString());
if (replyEvent.getSource() instanceof PostCommentService) {
@ -187,7 +190,7 @@ public class CommentEventListener {
BasePostMinimalDTO post = postService.convertToMinimal(postService.getById(postComment.getPostId()));
data.put("pageFullPath", post.getFullPath());
data.put("pageFullPath", enabledAbsolutePath ? post.getFullPath() : optionService.getBlogBaseUrl() + post.getFullPath());
data.put("pageTitle", post.getTitle());
data.put("baseAuthor", baseComment.getAuthor());
data.put("baseContent", baseComment.getContent());
@ -217,7 +220,7 @@ public class CommentEventListener {
BasePostMinimalDTO sheet = sheetService.convertToMinimal(sheetService.getById(sheetComment.getPostId()));
data.put("pageFullPath", sheet.getFullPath());
data.put("pageFullPath", enabledAbsolutePath ? sheet.getFullPath() : optionService.getBlogBaseUrl() + sheet.getFullPath());
data.put("pageTitle", sheet.getTitle());
data.put("baseAuthor", baseComment.getAuthor());
data.put("baseContent", baseComment.getContent());