package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class ActivityMaterialService {

    private ActivityMaterialRepo activityMaterialRepo;

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