package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class AirDropService {

    private AirDropRepo airDropRepo;

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