package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class RarityLabelService {

    private RarityLabelRepo rarityLabelRepo;

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