Last change
on this file since 527b93f 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
|
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 | @RequestMapping(path = "/phones/offers/{phoneId}")
|
---|
19 | public class PhoneOfferController {
|
---|
20 | private final PhoneOfferService phoneOfferService;
|
---|
21 | private final PhoneService phoneService;
|
---|
22 |
|
---|
23 | @GetMapping
|
---|
24 | public List<PhoneOffer> getOffersForPhone(@PathVariable("phoneId") Long phoneId){
|
---|
25 | return phoneOfferService.getPhoneOffersForPhone(phoneId);
|
---|
26 | }
|
---|
27 |
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.