Last change
on this file since e5b84dc was e5b84dc, checked in by Marko <Marko@…>, 22 months ago |
Prototype version
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | package finki.it.phoneluxbackend.controllers;
|
---|
2 |
|
---|
3 | import finki.it.phoneluxbackend.entities.Phone;
|
---|
4 | import finki.it.phoneluxbackend.entities.PhoneOffer;
|
---|
5 | import finki.it.phoneluxbackend.services.PhoneOfferService;
|
---|
6 | import finki.it.phoneluxbackend.services.PhoneService;
|
---|
7 | import lombok.AllArgsConstructor;
|
---|
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
|
---|
17 | @AllArgsConstructor
|
---|
18 | public class PhoneOfferController {
|
---|
19 | private final PhoneOfferService phoneOfferService;
|
---|
20 | private final PhoneService phoneService;
|
---|
21 |
|
---|
22 | @GetMapping(path = "/phones/offers/{phoneId}")
|
---|
23 | public List<PhoneOffer> getOffersForPhone(@PathVariable("phoneId") Long phoneId){
|
---|
24 | return phoneOfferService.getPhoneOffersForPhone(phoneId);
|
---|
25 | }
|
---|
26 |
|
---|
27 | @GetMapping(path = "/phoneoffer/{offerId}")
|
---|
28 | public PhoneOffer getPhoneOffer(@PathVariable("offerId") Long offerId){
|
---|
29 | return phoneOfferService.getPhoneOffer(offerId);
|
---|
30 | }
|
---|
31 |
|
---|
32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.