Add additional content in comment content

pull/137/head
johnniang 2019-03-25 18:51:34 +08:00
parent 3a1bf64636
commit 2e94ff0524
2 changed files with 6 additions and 2 deletions

View File

@ -27,7 +27,7 @@ public interface CommentService extends CrudService<Comment, Long> {
* %s: parent commentator author name
* %s: comment content
*/
String COMMENT_TEMPLATE = "<a href='#comment-id-%d>@%s</a> %s";
String COMMENT_TEMPLATE = "<a href='#comment-id-%d'>@%s</a> %s";
/**
* Lists latest comments.

View File

@ -219,7 +219,11 @@ public class CommentServiceImpl extends AbstractCrudService<Comment, Long> imple
// Convert to comment vo
CommentVO commentVO = new CommentVO().convertFrom(comment);
// TODO Add template
// Add additional content
if (commentVO.getParentId() > 0) {
// TODO Provide an optional additional content
commentVO.setContent(String.format(COMMENT_TEMPLATE, parentComment.getId(), parentComment.getAuthor(), commentVO.getContent()));
}
// Init children container
if (parentComment.getChildren() == null) {