package com.sqx.modules.integral.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.integral.dao.UserIntegralDetailsDao;
import com.sqx.modules.integral.entity.UserIntegralDetails;
import com.sqx.modules.integral.service.UserIntegralDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserIntegralDetailsServiceImpl extends ServiceImpl<UserIntegralDetailsDao, UserIntegralDetails> implements UserIntegralDetailsService {

    @Autowired
    private UserIntegralDetailsDao userIntegralDetailsDao;

    @Override
    public Result selectIntegraldetailsList(Long userId, Integer page, Integer limit, Integer classify) {
        Page<UserIntegralDetails> pages=new Page<>(page,limit);
        PageUtils pageUtils = new PageUtils(userIntegralDetailsDao.selectIntegraldetailsList(pages, userId, classify));
        return Result.success().put("data", pageUtils);
    }

    @Override
    public Result selectSignIn(Integer page, Integer limit, Long userId) {
        Page<UserIntegralDetails> pages=new Page<>(page,limit);
        PageUtils pageUtils = new PageUtils(userIntegralDetailsDao.selectSignIn(pages, userId));
        return Result.success().put("data", pageUtils);
    }
}
