package com.izouma.nineth.service;

import com.izouma.nineth.domain.TestClass;
import com.izouma.nineth.dto.PageQuery;
import com.izouma.nineth.repo.TestClassRepo;
import com.izouma.nineth.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));
    }
}
