package com.weavi.service;

import com.weavi.entity.Goods;
import com.weavi.entity.Userinfo;
import com.weavi.repository.GoodsRepository;
import com.weavi.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
public class GoodsService {
    @Resource
    GoodsRepository goodsRepository;

    public Page<Goods> findAll(Pageable pageable){
        return goodsRepository.findAll(pageable);
    }

    public Iterable<Goods> findAllSort(Sort sort){
        return goodsRepository.findAll(sort);
    }

}
