package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class OnOffService {

    private OnOffRepo onOffRepo;

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