Changeset ffd50db for phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/PhoneController.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/PhoneController.java
rfd5b100 rffd50db 6 6 import finki.it.phoneluxbackend.services.PhoneService; 7 7 import lombok.AllArgsConstructor; 8 import org.apache.coyote.Response; 8 9 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.http.MediaType; 11 import org.springframework.http.ResponseEntity; 9 12 import org.springframework.web.bind.annotation.*; 10 13 … … 50 53 } 51 54 55 @GetMapping(path = "/totaloffers/{phoneModel}") 56 public Long getTotalOffersForPhone(@PathVariable("phoneModel") String phoneModel){ 57 return phoneService.getTotalOffersForPhone(phoneModel); 58 } 59 60 @PutMapping(path = "/settotaloffers/{phoneId}/{totaloffers}") 61 public ResponseEntity<Object> setTotalOffersForPhone(@PathVariable("phoneId") Long phoneId, 62 @PathVariable("totaloffers") int totaloffers){ 63 return phoneService.setTotalOffersForPhone(phoneId,totaloffers); 64 } 65 66 @PutMapping(path = "/setlowestprice/{phoneId}/{lowestPrice}") 67 public ResponseEntity<Object> setLowestPriceForPhone(@PathVariable("phoneId") Long phoneId, 68 @PathVariable("lowestPrice") int lowestPrice){ 69 return phoneService.setLowestPriceForPhone(phoneId,lowestPrice); 70 } 71 72 @PutMapping(path = "/setimageurl/{phoneId}", consumes = { 73 MediaType.APPLICATION_JSON_VALUE, 74 MediaType.APPLICATION_XML_VALUE 75 }, produces = { 76 MediaType.APPLICATION_JSON_VALUE, 77 MediaType.APPLICATION_XML_VALUE 78 }) 79 public ResponseEntity<Object> setImageUrlForPhone(@PathVariable("phoneId") Long phoneId, 80 @RequestBody String newImageUrl){ 81 return phoneService.setImageUrlForPhone(phoneId,newImageUrl); 82 } 83 84 52 85 }
Note:
See TracChangeset
for help on using the changeset viewer.