package fr.eni.enchere.bll;

import fr.eni.enchere.bo.Article;
import fr.eni.enchere.bo.SearchArticleCritere;
import fr.eni.enchere.dal.ArticleRepository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService{

    private ArticleRepository articleRepository;

    public ArticleServiceImpl(ArticleRepository articleRepository) {
        this.articleRepository = articleRepository;
    }
    @Override
    public List<Article> findAllArticle() {
        return articleRepository.findAllArticle();
    }

    @Override
    public Article findArticleById(int id) {
        return null;
    }

    @Override
    public void saveArticle(Article article) {

    }

    @Override
    public void deleteArticle(int id) {

    }

    @Override
    public void updateArticle(int id) {

    }

    @Override
    public List<Article> findArticleByTitle(String title) {
        return articleRepository.findArticleByTitle(title);
    }

    @Override
    public List<Article> searchArticle(SearchArticleCritere critere) {
        return articleRepository.searchArticle(critere);
    }
}
