package com.izouma.awesomeAdmin.service;

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