Changeset ffd50db for phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/PhoneOfferController.java
- Timestamp:
- 10/01/22 22:57:41 (2 years ago)
- Branches:
- master
- Children:
- 47f4eaf
- Parents:
- fd5b100
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/PhoneOfferController.java
rfd5b100 rffd50db 7 7 import lombok.AllArgsConstructor; 8 8 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.http.ResponseEntity; 9 10 import org.springframework.web.bind.annotation.*; 10 11 … … 16 17 private final PhoneOfferService phoneOfferService; 17 18 19 20 @GetMapping(path = "/alloffers") 21 public List<PhoneOffer> getAllOffers(){ 22 return phoneOfferService.getAllOffers(); 23 } 18 24 @GetMapping(path = "/phones/offers/{phoneId}") 19 25 public List<PhoneOffer> getOffersForPhone(@PathVariable("phoneId") Long phoneId){ … … 22 28 23 29 @GetMapping(path = "/multipleoffers") 24 public List<PhoneOffer> get PhoneOffer(@RequestParam("offerIds") String offerIds){30 public List<PhoneOffer> getMultiplePhoneOffers(@RequestParam("offerIds") String offerIds){ 25 31 return phoneOfferService.getMultiplePhoneOffers(offerIds); 26 32 } … … 58 64 } 59 65 66 67 @PutMapping(path = "/phoneoffer/{offerId}/addphonemodel/{phoneId}") 68 public ResponseEntity<Object> addPhoneModelToOffer(@PathVariable("offerId") Long offerId, 69 @PathVariable("phoneId") Long phoneId) 70 { 71 return phoneOfferService.addPhoneModelToOffer(offerId,phoneId); 72 } 73 @PutMapping(path = "/phoneoffer/{offerId}/changeprice/{price}") 74 public ResponseEntity<Object> changePriceForOffer(@PathVariable("offerId") Long offerId, 75 @PathVariable("price") int price) 76 { 77 return phoneOfferService.changePriceForOffer(offerId,price); 78 } 79 80 @PostMapping(path = "/phoneoffer/addoffer") 81 public ResponseEntity<Object> addOffer(@RequestBody PhoneOffer offer) 82 { 83 return phoneOfferService.addOffer(offer); 84 } 85 86 @DeleteMapping(path = "/phoneoffer/deleteoffer/{offerId}") 87 public ResponseEntity<Object> deleteOffer(@PathVariable("offerId") Long offerId) 88 { 89 return phoneOfferService.deleteOffer(offerId); 90 } 60 91 }
Note:
See TracChangeset
for help on using the changeset viewer.