Commit 400977ce authored by benhoumine's avatar benhoumine

poubelle controller

parent 1edc61fe
package isima.f2.controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import isima.f2.model.Poubelle;
import isima.f2.services.ImpPoubelle;
@RestController
@RequestMapping("poubelles")
public class PoubelleController {
@Autowired
private ImpPoubelle poubelles;
@GetMapping("/")
public List<Poubelle> getPoubelles() {
return poubelles.getPoubelles();
}
}
......@@ -3,39 +3,42 @@ package isima.f2.services;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import isima.f2.contrats.IPoubelle;
import isima.f2.dao.IPoubelleDAO;
import isima.f2.model.Poubelle;
@Service
public class ImpPoubelle implements IPoubelle{
@Autowired
IPoubelleDAO poubelleDAO ;
@Override
public Poubelle ajouterPoubelle(Poubelle poubelle) {
// TODO Auto-generated method stub
return null;
}
@Override
public void deletePoubelle(Long id) {
// TODO Auto-generated method stub
}
@Override
public Poubelle modifierPoubelle(Poubelle poubelle) {
// TODO Auto-generated method stub
return null;
}
@Override
public Optional<Poubelle> getPoubelle(Long id) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Poubelle> getPoubelles() {
// TODO Auto-generated method stub
return null;
return poubelleDAO.findAll();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment