package cn.com.countrygarden.bi.main.service.ck.impl;

import cn.com.countrygarden.bi.main.core.Response;
import cn.com.countrygarden.bi.main.core.Result;
import cn.com.countrygarden.bi.main.dao.ck.CkCleanerRecordingMapper;
import cn.com.countrygarden.bi.main.model.AccessToken;
import cn.com.countrygarden.bi.main.model.PageData;
import cn.com.countrygarden.bi.main.model.ck.CkCleanerRecording;
import cn.com.countrygarden.bi.main.service.ck.CkCleanerRecordingService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CkCleanerRecordingServiceImpl implements CkCleanerRecordingService {

    @Autowired
    private CkCleanerRecordingMapper ckCleanerRecordingMapper;

    @Override
    public Result queryPageList(CkCleanerRecording ckCleanerRecording,int page,int size, AccessToken accessToken) {
        Page<Object> pageList = PageHelper.startPage(page,size);
        List<CkCleanerRecording> recordingsList=ckCleanerRecordingMapper.selectList(ckCleanerRecording);
        PageData data = new PageData(pageList);
        data.setData(recordingsList);
        return Response.response(data);
    }
}
