package com.izouma.wenlvju.service;

import com.izouma.wenlvju.domain.GradingOrganization;
import com.izouma.wenlvju.dto.PageQuery;
import com.izouma.wenlvju.repo.GradingOrganizationRepo;
import com.izouma.wenlvju.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class GradingOrganizationService {

    private GradingOrganizationRepo gradingOrganizationRepo;

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