Search in sources :

Example 1 with SysNotice

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

the class SysNoticeServiceImpl method getByPrimaryKey.

@Override
public Notice getByPrimaryKey(Long primaryKey) {
    Assert.notNull(primaryKey, "PrimaryKey不可为空!");
    SysNotice entity = sysNoticeMapper.selectByPrimaryKey(primaryKey);
    return null == entity ? null : new Notice(entity);
}
Also used : SysNotice(com.zyd.blog.persistence.beans.SysNotice) Notice(com.zyd.blog.business.entity.Notice) SysNotice(com.zyd.blog.persistence.beans.SysNotice)

Example 2 with SysNotice

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

the class SysNoticeServiceImpl method listRelease.

/**
 * 获取已发布的通知列表
 *
 * @return
 */
@Override
public List<SysNoticeDTO> listRelease() {
    NoticeConditionVO vo = new NoticeConditionVO();
    vo.setStatus(NoticeStatusEnum.RELEASE.toString());
    List<SysNotice> list = sysNoticeMapper.findPageBreakByCondition(vo);
    if (CollectionUtils.isEmpty(list)) {
        return null;
    }
    List<SysNoticeDTO> boList = new ArrayList<>();
    for (SysNotice sysNotice : list) {
        boList.add(BeanConvertUtil.doConvert(sysNotice, SysNoticeDTO.class));
    }
    return boList;
}
Also used : SysNotice(com.zyd.blog.persistence.beans.SysNotice) SysNoticeDTO(com.zyd.blog.business.dto.SysNoticeDTO) ArrayList(java.util.ArrayList) NoticeConditionVO(com.zyd.blog.business.vo.NoticeConditionVO)

Example 3 with SysNotice

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

the class SysNoticeServiceImpl method findPageBreakByCondition.

/**
 * 分页查询
 *
 * @param vo
 * @return
 */
@Override
public PageInfo<Notice> findPageBreakByCondition(NoticeConditionVO vo) {
    PageHelper.startPage(vo.getPageNumber(), vo.getPageSize());
    List<SysNotice> list = sysNoticeMapper.findPageBreakByCondition(vo);
    if (CollectionUtils.isEmpty(list)) {
        return null;
    }
    List<Notice> boList = new ArrayList<>();
    for (SysNotice sysNotice : list) {
        boList.add(new Notice(sysNotice));
    }
    PageInfo bean = new PageInfo<SysNotice>(list);
    bean.setList(boList);
    return bean;
}
Also used : SysNotice(com.zyd.blog.persistence.beans.SysNotice) PageInfo(com.github.pagehelper.PageInfo) Notice(com.zyd.blog.business.entity.Notice) SysNotice(com.zyd.blog.persistence.beans.SysNotice) ArrayList(java.util.ArrayList)

Aggregations

SysNotice (com.zyd.blog.persistence.beans.SysNotice)3 Notice (com.zyd.blog.business.entity.Notice)2 ArrayList (java.util.ArrayList)2 PageInfo (com.github.pagehelper.PageInfo)1 SysNoticeDTO (com.zyd.blog.business.dto.SysNoticeDTO)1 NoticeConditionVO (com.zyd.blog.business.vo.NoticeConditionVO)1