package com.izouma.wenlvju.service;

import com.izouma.wenlvju.domain.Award;
import com.izouma.wenlvju.dto.PageQuery;
import com.izouma.wenlvju.repo.AwardRepo;
import com.izouma.wenlvju.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class AwardService {

    private AwardRepo awardRepo;

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