package com.cristobalbernal.foro.Servicios;

import com.cristobalbernal.foro.Entidades.Foro;
import com.cristobalbernal.foro.Respositorios.IForo;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServicioForo {
    @Autowired
    private IForo iForo;

    public List<Foro> init(){
        return iForo.findAll();
    }
    public Foro findById(long id){
        return iForo.findById((int) id).orElse(null);
    }
}
