Search in sources :

Example 1 with ExtraCommentTypeEnum

use of com.zyd.blog.business.enums.ExtraCommentTypeEnum in project OneBlog by zhangyd-c.

the class Comment method getArticleTitle.

public String getArticleTitle() {
    BizArticle article = this.article;
    String title = null == article ? null : article.getTitle();
    if (title == null) {
        Long sid = getSid();
        ExtraCommentTypeEnum extraCommentType = ExtraCommentTypeEnum.getBySid(sid);
        title = extraCommentType.getTitle();
    }
    return title;
}
Also used : BizArticle(com.zyd.blog.persistence.beans.BizArticle) ExtraCommentTypeEnum(com.zyd.blog.business.enums.ExtraCommentTypeEnum)

Example 2 with ExtraCommentTypeEnum

use of com.zyd.blog.business.enums.ExtraCommentTypeEnum in project OneBlog by zhangyd-c.

the class Comment method getSourceUrl.

/**
 * 获取评论文章的地址
 *
 * @return
 */
public String getSourceUrl() {
    Long sid = getSid();
    ExtraCommentTypeEnum extraCommentType = ExtraCommentTypeEnum.getBySid(sid);
    if (null == extraCommentType) {
        return "";
    }
    if (extraCommentType.equals(ExtraCommentTypeEnum.ARTICLE)) {
        return extraCommentType.getUrl() + sid;
    }
    return extraCommentType.getUrl();
}
Also used : ExtraCommentTypeEnum(com.zyd.blog.business.enums.ExtraCommentTypeEnum)

Aggregations

ExtraCommentTypeEnum (com.zyd.blog.business.enums.ExtraCommentTypeEnum)2 BizArticle (com.zyd.blog.persistence.beans.BizArticle)1