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