package com.izouma.zhirongip.service.resource;

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


@Service
@AllArgsConstructor
public class PolicyLawService {

    private final PolicyLawRepo policyLawRepo;

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