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

import com.fzm.mall.server.front.goods.model.Hot;
import com.fzm.mall.server.front.goods.mapper.HotMapper;
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.IHotService;
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 HotServiceImpl extends ServiceImpl<HotMapper, Hot> implements IHotService {

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

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