Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
852 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | package finki.diplomska.tripplanner.web.rest;
|
---|
| 2 |
|
---|
| 3 | import finki.diplomska.tripplanner.models.Region;
|
---|
| 4 | import finki.diplomska.tripplanner.service.RegionService;
|
---|
| 5 | import org.springframework.web.bind.annotation.CrossOrigin;
|
---|
| 6 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
| 7 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
| 8 | import org.springframework.web.bind.annotation.RestController;
|
---|
| 9 |
|
---|
| 10 | import java.util.List;
|
---|
| 11 |
|
---|
| 12 | @RestController
|
---|
| 13 | @CrossOrigin(origins = "http://localhost:4200")
|
---|
| 14 | @RequestMapping(value = "/api")
|
---|
| 15 | public class RegionRestController {
|
---|
| 16 |
|
---|
| 17 | private final RegionService regionService;
|
---|
| 18 |
|
---|
| 19 | public RegionRestController(RegionService regionService) {
|
---|
| 20 | this.regionService = regionService;
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | @GetMapping (value = "/regions")
|
---|
| 24 | public List<Region> findAllRegions(){
|
---|
| 25 | return this.regionService.findAll();
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.