Commit 94b61059 by Bogdan Andjelkovic

obrisani souti i uredjen kod malo

parent 4ff6a1b9
......@@ -20,18 +20,22 @@ public class AdminController
{
@Autowired
KomentarRepository komRepo;
@Autowired
KorisnikRepository kRepo;
@Autowired
LokacijaRepository lRepo;
@Autowired
OglasRepository oRepo;
@Autowired
ZahtevRepository zRepo;
@Autowired
LajkRepository lajkRepo;
@Autowired
KomentarVlasnikRepository komentarVlasnikRepo;
@GetMapping("/lista-korisnika")
public String getListaKorisnika(Model model, @AuthenticationPrincipal KorisnikDetails loggedUser)
{
......
......@@ -24,6 +24,7 @@ public class AppController
{
@Autowired
KorisnikRepository kRepo;
@Autowired
LokacijaRepository lRepo;
......@@ -68,6 +69,7 @@ public class AppController
return("register");
}
}
@GetMapping("/onama")
public String getOnama(Model model,@AuthenticationPrincipal KorisnikDetails loggedUser)
{
......
......@@ -14,8 +14,10 @@ public class AppRestController
{
@Autowired
KorisnikRepository kRepo;
@Autowired
LokacijaRepository lRepo;
@GetMapping("/listLokacija")
public List<Lokacija> getRegister()
{
......
......@@ -10,13 +10,17 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class KomentarController {
public class KomentarController
{
@Autowired
KomentarRepository komentarRepo;
@Autowired
ZahtevRepository zRepo;
@Autowired
KomentarVlasnikRepository komentarVlasnikRepo;
@GetMapping("/profile/moji-zahtevi/sacuvaj-komentar")
public String postSacuvajKomentar(@RequestParam("korisnikId") int korisnikId,
@RequestParam("oglasId") int oglasId,
......
......@@ -16,6 +16,7 @@ public class LajkController
{
@Autowired
LajkRepository lajkRepo;
@GetMapping("/lajkuj-oglas/{oglasId}")
public String postLajkujOglas(Model model, @AuthenticationPrincipal KorisnikDetails loggedUser, @PathVariable("oglasId") int oglasId)
{
......
......@@ -35,8 +35,10 @@ public class ProfileController
@Autowired
KomentarRepository komRepo;
@Autowired
KomentarVlasnikRepository komentarVlasnikRepo;
@GetMapping("/profile")
public String getProfile(Model model, @AuthenticationPrincipal KorisnikDetails loggedUser)
{
......
......@@ -26,14 +26,17 @@ import java.util.Date;
import java.util.List;
@Controller
public class ZahtevController {
public class ZahtevController
{
@Autowired
ZahtevRepository zRepo;
@Autowired
OglasRepository oRepo;
@Autowired
SlikeRepository sRepo;
@Autowired
KorisnikRepository kRepo;
......
......@@ -25,12 +25,10 @@ public class LajkRepository {
{
if(this.isLiked(lajk))
{
System.out.println("delete "+ lajk.toString());
this.deleteLajk(lajk);
}
else
{
System.out.println("insert "+ lajk.toString());
this.insertLajk(lajk);
}
}
......
......@@ -226,8 +226,7 @@ public class OglasRepository
if(!( pretraga == null || ( pretraga != null && oglas.getNaslov().toLowerCase().contains( pretraga.toLowerCase()) ) ) ) continue;
else if(!( pretraga == null || ( pretraga != null && oglas.getOpis().toLowerCase().contains( pretraga.toLowerCase()) ) ) ) continue;
System.out.println( oglas.toString());
;
list.add( oglas);
}
} catch (SQLException e) {
......
......@@ -26,7 +26,6 @@ public class ZahtevRepository {
provera.setInt( 2, oglasId);
ResultSet rs = provera.executeQuery();
while( rs.next()) {
System.out.println(rs.getString("stanje"));
throw new AktivanZahtevPostoji();
}
} catch (SQLException e) {
......
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