package com.izouma.zhirongip.service;

import com.izouma.zhirongip.domain.TestClass;
import com.izouma.zhirongip.dto.PageQuery;
import com.izouma.zhirongip.repo.TestClassRepo;
import com.izouma.zhirongip.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class TestClassService {

    private TestClassRepo testClassRepo;

    public Page<TestClass> all(PageQuery pageQuery) {
        return testClassRepo.findAll(JpaUtils.toSpecification(pageQuery, TestClass.class), JpaUtils.toPageRequest(pageQuery));
    }
}
