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

import com.fzm.mall.server.front.goods.model.Custom;
import com.fzm.mall.server.front.goods.mapper.CustomMapper;
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.ICustomService;
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 CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> implements ICustomService {

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

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