source: phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/PhoneOfferController.java@ e5b84dc

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 
1package finki.it.phoneluxbackend.controllers;
2
3import finki.it.phoneluxbackend.entities.Phone;
4import finki.it.phoneluxbackend.entities.PhoneOffer;
5import finki.it.phoneluxbackend.services.PhoneOfferService;
6import finki.it.phoneluxbackend.services.PhoneService;
7import lombok.AllArgsConstructor;
8import org.springframework.beans.factory.annotation.Autowired;
9import org.springframework.web.bind.annotation.GetMapping;
10import org.springframework.web.bind.annotation.PathVariable;
11import org.springframework.web.bind.annotation.RequestMapping;
12import org.springframework.web.bind.annotation.RestController;
13
14import java.util.List;
15
16@RestController
17@AllArgsConstructor
18public 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.