Search in sources :

Example 1 with BizArticle

use of com.zyd.blog.persistence.beans.BizArticle 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 BizArticle

use of com.zyd.blog.persistence.beans.BizArticle in project OneBlog by zhangyd-c.

the class BizTypeServiceImpl method removeByPrimaryKey.

@Override
@Transactional(rollbackFor = Exception.class)
public boolean removeByPrimaryKey(Long primaryKey) {
    BizArticle article = new BizArticle();
    article.setTypeId(primaryKey);
    List<BizArticle> articles = bizArticleMapper.select(article);
    if (!CollectionUtils.isEmpty(articles)) {
        throw new ZhydException("当前分类下存在文章信息,禁止删除!");
    }
    return bizTypeMapper.deleteByPrimaryKey(primaryKey) > 0;
}
Also used : ZhydException(com.zyd.blog.framework.exception.ZhydException) BizArticle(com.zyd.blog.persistence.beans.BizArticle) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

BizArticle (com.zyd.blog.persistence.beans.BizArticle)2 ExtraCommentTypeEnum (com.zyd.blog.business.enums.ExtraCommentTypeEnum)1 ZhydException (com.zyd.blog.framework.exception.ZhydException)1 Transactional (org.springframework.transaction.annotation.Transactional)1