package app.usluga.web;

import app.model.Oglas;
import app.rep.OglasRep;
import app.usluga.OglasUsluga;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/oglasi")
public class OglasController
{
    @Autowired
    private OglasUsluga oglasUsluga;



    @RequestMapping("/getAll")
    public  String getAll(Model model)
    {

        List<Oglas> oglasi = oglasUsluga.getAll();
        model.addAttribute("oglasi",oglasi);





        return "oglasi";
    }
}
