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

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
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
18@RequestMapping(path = "/phones/offers/{phoneId}")
19public 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.