package com.izouma.wenlvju.service.regulation;

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

@Service
@AllArgsConstructor
public class ComplainService {

    private ComplainRepo complainRepo;

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