package com.fzm.mall.server.front.goods.service.impl;

import com.fzm.mall.server.front.goods.model.LowPrice;
import com.fzm.mall.server.front.goods.mapper.LowPriceMapper;
import com.fzm.mall.server.front.goods.model.vo.PageVo;
import com.fzm.mall.server.front.goods.model.vo.SaleHotVo;
import com.fzm.mall.server.front.goods.service.ILowPriceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 低价好货 服务实现类
 * </p>
 *
 * @author fzm
 * @since 2021-03-04
 */
@Service
public class LowPriceServiceImpl extends ServiceImpl<LowPriceMapper, LowPrice> implements ILowPriceService {

    @Autowired
    private LowPriceMapper lowPriceMapper;

    @Override
    public List<SaleHotVo> getList(PageVo pageVo) {
        int start = (pageVo.getPage()-1)*pageVo.getSize();
        int end = pageVo.getPage()* pageVo.getSize();
        return lowPriceMapper.getList(start,end);
    }

    @Override
    public int getCount() {
        return lowPriceMapper.getCount();
    }
}
