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

import com.github.pagehelper.PageHelper;
import com.yc.education.mapper.ContactusMapper;
import com.yc.education.model.Contactus;
import com.yc.education.service.ContacusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@ClassName ContactusServiceImpl
 *@Description TODO
 *@Author QuZhangJing
 *@Date 2019/10/14 17:08
 *@Version 1.0
 */
@Service
public class ContactusServiceImpl extends BaseService<Contactus> implements ContacusService {
    @Autowired
    ContactusMapper contactusMapper;

    @Override
    public Contactus getContacusById(Integer id) {
        return contactusMapper.getContacusById(id);
    }

    @Override
    public void delContacusById(Integer id) {
    contactusMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Contactus> getContacus(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return contactusMapper.getContacus();
    }
}
