package com.izouma.wenlvju.service;

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

import java.util.List;

@Service
@AllArgsConstructor
public class PerformanceScoreService {

    private final PerformanceScoreRepo performanceScoreRepo;

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