package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class RecordRankService {

    private RecordRankRepo recordRankRepo;

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