package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class BlindBoxItemService {

    private BlindBoxItemRepo blindBoxItemRepo;

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