package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class RecommendService {

    private RecommendRepo recommendRepo;

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