source: source/freeparkingspace/src/main/java/com/proekt/Controller/test.java

Last change on this file was 31d67c0, checked in by zlatko2810 <zlatko.stojanovski@…>, 2 years ago

proekt

  • Property mode set to 100644
File size: 2.4 KB
Line 
1package com.proekt.Controller;
2
3import com.proekt.Repository.*;
4import com.proekt.model.*;
5import com.proekt.model.Korisnik.Korisnik;
6import com.proekt.model.Korisnik.KorisnikKey;
7import com.proekt.model.Vraboten.Vraboten;
8import com.proekt.model.Vraboten.VrabotenKey;
9import org.springframework.http.ResponseEntity;
10import org.springframework.web.bind.annotation.GetMapping;
11import org.springframework.web.bind.annotation.RequestMapping;
12import org.springframework.web.bind.annotation.RestController;
13
14import java.util.List;
15
16@RestController
17@RequestMapping("/tests")
18public 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}
Note: See TracBrowser for help on using the repository browser.