package com.izouma.wenlvju.service;

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

@Service
@AllArgsConstructor
public class RegulatoryService {

    private RegulatoryRepo regulatoryRepo;

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