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);
}
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;
}
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;
}
Aggregations