package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class MetaSpatialInfoService {

    private MetaSpatialInfoRepo metaSpatialInfoRepo;

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