Ignore:
Timestamp:
09/11/22 18:03:58 (2 years ago)
Author:
Marko <Marko@…>
Branches:
master
Children:
775e15e
Parents:
527b93f
Message:

Prototype version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/PhoneController.java

    r527b93f re5b84dc  
    2222//     handle request parameters for filtering phones
    2323    @GetMapping(path = "/phones")
    24     public List<Phone> getPhones(){
    25         return phoneService.getPhones().stream()
    26                 .sorted(Comparator.comparing(Phone::getTotal_offers).reversed())
    27                 .collect(Collectors.toList());
     24    public List<Phone> getPhones(@RequestParam(name = "shops", required = false) String shops,
     25                                 @RequestParam(name = "brands", required = false) String brands,
     26                                 @RequestParam(name = "sortBy", required = false) String sortBy,
     27                                 @RequestParam(name = "priceRange", required = false) String priceRange,
     28                                 @RequestParam(name = "searchValue", required = false) String searchValue){
     29
     30        return phoneService.getPhones(shops,brands,sortBy,priceRange,searchValue);
    2831    }
    2932
Note: See TracChangeset for help on using the changeset viewer.