package com.yc.education.service.impl;/**
 * huangpan
 * 2019/10/16
 * energy
 */

import com.github.pagehelper.PageHelper;
import com.yc.education.mapper.NoticeMapper;
import com.yc.education.model.Notice;
import com.yc.education.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@ClassName NoticeServiceImpl
 *@Description TODO
 *@Author QuZhangJing
 *@Date 2019/10/16 9:39
 *@Version 1.0
 */
@Service
public class NoticeServiceImpl extends BaseService<Notice> implements NoticeService {
    @Autowired
    NoticeMapper noticeMapper;

    @Override
    public List<Notice> getNotices(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return noticeMapper.getNotices();
    }

    @Override
    public Notice getNoticeById(Integer id) {
        return noticeMapper.getNoticeById(id);
    }

    @Override
    public void delNoticeById(Integer id) {
    noticeMapper.deleteByPrimaryKey(id);
    }
}
