package com.izouma.zhirongip.service;

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

@Service
@AllArgsConstructor
public class InformationService {

    private final InformationRepo informationRepo;

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


}
