package com.izouma.wenlvju.service;

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

@Service
@AllArgsConstructor
public class RecordSpecialtyService {

    private RecordSpecialtyRepo recordSpecialtyRepo;

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