1 | package com.proekt.Controller;
|
---|
2 |
|
---|
3 | import com.proekt.Repository.*;
|
---|
4 | import com.proekt.model.*;
|
---|
5 | import com.proekt.model.Korisnik.Korisnik;
|
---|
6 | import com.proekt.model.Korisnik.KorisnikKey;
|
---|
7 | import com.proekt.model.Vraboten.Vraboten;
|
---|
8 | import com.proekt.model.Vraboten.VrabotenKey;
|
---|
9 | import org.springframework.http.ResponseEntity;
|
---|
10 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
11 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
12 | import org.springframework.web.bind.annotation.RestController;
|
---|
13 |
|
---|
14 | import java.util.List;
|
---|
15 |
|
---|
16 | @RestController
|
---|
17 | @RequestMapping("/tests")
|
---|
18 | public class test {
|
---|
19 |
|
---|
20 | private final NajavaRepository najavaRepository;
|
---|
21 | private final KorisnikRepository korisnikRepository;
|
---|
22 | private final VrabotenRepository1 vrabotenRepository;
|
---|
23 | private final AvtomobilRepository avtomobilRepository;
|
---|
24 | private final ParkingMestoRepository parkingMestoRepository;
|
---|
25 | private final PlakjanjeRepository plakjanjeRepository;
|
---|
26 |
|
---|
27 |
|
---|
28 | public test(NajavaRepository najavaRepository, KorisnikRepository korisnikRepository, VrabotenRepository1 vrabotenRepository, AvtomobilRepository avtomobilRepository, ParkingMestoRepository parkingMestoRepository, PlakjanjeRepository plakjanje, PlakjanjeRepository plakjanjeRepository) {
|
---|
29 | this.najavaRepository = najavaRepository;
|
---|
30 | this.korisnikRepository = korisnikRepository;
|
---|
31 | this.vrabotenRepository = vrabotenRepository;
|
---|
32 | this.avtomobilRepository = avtomobilRepository;
|
---|
33 | this.parkingMestoRepository = parkingMestoRepository;
|
---|
34 | this.plakjanjeRepository = plakjanjeRepository;
|
---|
35 | }
|
---|
36 |
|
---|
37 |
|
---|
38 | @GetMapping
|
---|
39 | public ResponseEntity viewQuery() {
|
---|
40 | Najava najava = new Najava();
|
---|
41 | najava.setKorisnickoIme("korisnicko_ime");
|
---|
42 | najava.setIme("ime");
|
---|
43 | najava.setPrezime("prezime");
|
---|
44 | najava.setEmbg("embg");
|
---|
45 | najava.setEmail("email");
|
---|
46 | najava.setBrTel("br_tel");
|
---|
47 | najava.setPassword("password");
|
---|
48 |
|
---|
49 |
|
---|
50 |
|
---|
51 | //////TEST-RESERVATION-ALL///////
|
---|
52 | Avtomobil avtomobil = avtomobilRepository.findById("SK-2410-AZ").get();
|
---|
53 | ParkingMesto parkingMesto = parkingMestoRepository.findById(1).get();
|
---|
54 | Plakjanje plakjanje = plakjanjeRepository.findById(113).get();
|
---|
55 | Rezervacija rezervacija = new Rezervacija();
|
---|
56 | rezervacija.setIdRezervacija(1337);
|
---|
57 | rezervacija.setRegTablica(avtomobil);
|
---|
58 | rezervacija.setBrojNaPmesta(parkingMesto);
|
---|
59 | rezervacija.setIdPlakanje(plakjanje);
|
---|
60 |
|
---|
61 | return ResponseEntity.ok(rezervacija);
|
---|
62 |
|
---|
63 |
|
---|
64 | }
|
---|
65 |
|
---|
66 |
|
---|
67 |
|
---|
68 | }
|
---|