package com.izouma.nineth.service;

import com.izouma.nineth.domain.ShowCollection;
import com.izouma.nineth.dto.PageQuery;
import com.izouma.nineth.repo.ShowCollectionRepo;
import com.izouma.nineth.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class ShowCollectionService {

    private ShowCollectionRepo showCollectionRepo;

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