package com.izouma.wenlvju.service.performance;

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

@Service
@AllArgsConstructor
public class PerformanceService {

    private PerformanceRepo performanceRepo;

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