package com.izouma.wenlvju.service;

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

@Service
@AllArgsConstructor
public class RecordExpertService {

    private RecordExpertRepo recordExpertRepo;

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