package com.iamberry.wechat.service.product;

import com.iamberry.wechat.core.entity.product.IndexProduct;
import com.iamberry.wechat.face.porduct.IndexProductService;
import com.iamberry.wechat.service.mapper.IndexProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  首页热销产品接口
 * @author xm
 * @Date 2019-03-26
 */
@Service
public class IndexProductServiceImpl  implements IndexProductService {
    @Autowired
    private IndexProductMapper indexProductMapper;
    /**
     * 获取集合
     * @param  indexProduct
     * @return List
     */
    @Override
    public List<IndexProduct> getIndexProductList(IndexProduct  indexProduct){
        return  indexProductMapper.getIndexProductList(indexProduct);
    }
    /**
     * 查询单条数据
     * @param  id
     * @return  indexProduct
     */
    @Override
    public  IndexProduct  getIndexProductById(Integer  id){
        return  indexProductMapper.getIndexProductById(id);
    }
    /**
     * 增加数据
     * @param  indexProduct
     * @return Integer
     */
    @Override
    public  Integer  save(IndexProduct  indexProduct){
        return  indexProductMapper.save(indexProduct);
    }
    /**
     * 修改数据
     * @param  indexProduct
     * @return Integer
     */
    @Override
    public  Integer  update(IndexProduct  indexProduct){
        return  indexProductMapper.update(indexProduct);
    }
    /**
     * 删除数据
     * @param  id
     * @return Integer
     */
    @Override
    public  Integer  delete(Integer  id){
        return  indexProductMapper.delete(id);
    }
}