Last change
on this file since f25d07e was f25d07e, checked in by Marko <Marko@…>, 22 months ago |
Edited registration and login services
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[dfd5d87] | 1 | package finki.it.phoneluxbackend.controllers;
|
---|
| 2 |
|
---|
[f25d07e] | 3 | import finki.it.phoneluxbackend.entities.Phone;
|
---|
[dfd5d87] | 4 | import finki.it.phoneluxbackend.entities.PhoneOffer;
|
---|
| 5 | import finki.it.phoneluxbackend.services.PhoneOfferService;
|
---|
[f25d07e] | 6 | import finki.it.phoneluxbackend.services.PhoneService;
|
---|
| 7 | import lombok.AllArgsConstructor;
|
---|
[dfd5d87] | 8 | import org.springframework.beans.factory.annotation.Autowired;
|
---|
| 9 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
| 10 | import org.springframework.web.bind.annotation.PathVariable;
|
---|
| 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
|
---|
[f25d07e] | 17 | @AllArgsConstructor
|
---|
| 18 | @RequestMapping(path = "/phones/offers/{phoneId}")
|
---|
[dfd5d87] | 19 | public class PhoneOfferController {
|
---|
| 20 | private final PhoneOfferService phoneOfferService;
|
---|
[f25d07e] | 21 | private final PhoneService phoneService;
|
---|
[dfd5d87] | 22 |
|
---|
| 23 | @GetMapping
|
---|
| 24 | public List<PhoneOffer> getOffersForPhone(@PathVariable("phoneId") Long phoneId){
|
---|
| 25 | return phoneOfferService.getPhoneOffersForPhone(phoneId);
|
---|
| 26 | }
|
---|
[f25d07e] | 27 |
|
---|
[dfd5d87] | 28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.