package com.izouma.jiashanxia.service;

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

@Service
@AllArgsConstructor
public class CommissionRecordService {

    private CommissionRecordRepo commissionRecordRepo;

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