package com.ichangzuo.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ichangzuo.system.mapper.IntegralMapper;
import com.ichangzuo.system.model.entity.Integral;
import com.ichangzuo.system.model.query.IntegralPageQuery;
import com.ichangzuo.system.model.vo.IntegralAdminPageVO;
import com.ichangzuo.system.model.vo.IntegralUserPageVO;
import org.springframework.stereotype.Service;

@Service
public class IntegralServiceImpl extends ServiceImpl<IntegralMapper, Integral> {
    public IPage<IntegralAdminPageVO> listPagedAdmin(IntegralPageQuery queryParams){
        int pageNum = queryParams.getPageNum();
        int pageSize = queryParams.getPageSize();
        return baseMapper.listPagedAdmin(new Page<>(pageNum, pageSize), queryParams);
    }

    public IPage<IntegralUserPageVO> listPagedUser(IntegralPageQuery queryParams){
        int pageNum = queryParams.getPageNum();
        int pageSize = queryParams.getPageSize();

        return baseMapper.listPagedUser(new Page<>(pageNum, pageSize), queryParams);
    }
}
