🎨 评论分享链接格式修改

This commit is contained in:
x ronger 2020-08-04 21:00:54 +08:00
parent 22979810e5
commit af17c90ef4
2 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,9 @@ import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/**
* @author ronger
*/
public interface CommentService extends Service<Comment> { public interface CommentService extends Service<Comment> {
List<CommentDTO> getArticleComments(Integer idArticle); List<CommentDTO> getArticleComments(Integer idArticle);

View File

@ -83,7 +83,7 @@ public class CommentServiceImpl extends AbstractService<Comment> implements Comm
comment.setCreatedTime(new Date()); comment.setCreatedTime(new Date());
commentMapper.insertSelective(comment); commentMapper.insertSelective(comment);
StringBuilder commentSharpUrl = new StringBuilder(article.getArticlePermalink()); StringBuilder commentSharpUrl = new StringBuilder(article.getArticlePermalink());
commentSharpUrl.append("/comment/").append(comment.getIdComment()); commentSharpUrl.append("#comment-").append(comment.getIdComment());
commentMapper.updateCommentSharpUrl(comment.getIdComment(), commentSharpUrl.toString()); commentMapper.updateCommentSharpUrl(comment.getIdComment(), commentSharpUrl.toString());
String commentContent = comment.getCommentContent(); String commentContent = comment.getCommentContent();