package com.izouma.jiashanxia.service;

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

@Service
@AllArgsConstructor
public class PackageGoodsService {

    private PackageGoodsRepo packageGoodsRepo;

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