source: trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/CountryRestController.java@ 84d0fbb

Last change on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 866 bytes
Line 
1package finki.diplomska.tripplanner.web.rest;
2
3import finki.diplomska.tripplanner.models.Country;
4import finki.diplomska.tripplanner.service.CountryService;
5import org.springframework.web.bind.annotation.CrossOrigin;
6import org.springframework.web.bind.annotation.GetMapping;
7import org.springframework.web.bind.annotation.RequestMapping;
8import org.springframework.web.bind.annotation.RestController;
9
10import java.util.List;
11
12@RestController
13@CrossOrigin(origins = "http://localhost:4200")
14@RequestMapping(value = "api")
15public class CountryRestController {
16
17 private final CountryService countryService;
18
19 public CountryRestController(CountryService countryService) {
20 this.countryService = countryService;
21 }
22
23 @GetMapping(value = "/countries")
24 public List<Country> findAllCountries(){
25 return this.countryService.findAll();
26 }
27}
Note: See TracBrowser for help on using the repository browser.