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

import com.github.pagehelper.PageHelper;
import com.yc.education.mapper.DownloadMapper;
import com.yc.education.model.Download;
import com.yc.education.service.DownloadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@ClassName DownloadServiceImpl
 *@Description TODO
 *@Author QuZhangJing
 *@Date 2019/10/16 9:39
 *@Version 1.0
 */
@Service
public class DownloadServiceImpl extends BaseService<Download > implements DownloadService {
    @Autowired
    DownloadMapper downloadMapper;

    @Override
    public List<Download> getDownloads(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return downloadMapper.getDownloads();
    }

    @Override
    public Download getDownloadById(Integer id) {
        return downloadMapper.getDownloadById(id);
    }

    @Override
    public void delDownload(Integer id) {
    downloadMapper.deleteByPrimaryKey(id);
    }
}
