package com.izouma.jiashanxia.service;

import com.izouma.jiashanxia.domain.Withdraw;
import com.izouma.jiashanxia.dto.PageQuery;
import com.izouma.jiashanxia.repo.WithdrawRepo;
import com.izouma.jiashanxia.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class WithdrawService {

    private WithdrawRepo withdrawRepo;

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