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

import com.fzm.mall.server.front.goods.model.SaleHot;
import com.fzm.mall.server.front.goods.mapper.SaleHotMapper;
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.ISaleHotService;
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-02
 */
@Service
public class SaleHotServiceImpl extends ServiceImpl<SaleHotMapper, SaleHot> implements ISaleHotService {

    @Autowired
    private SaleHotMapper saleHotMapper;

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

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