Ignore:
Timestamp:
09/17/22 01:23:47 (22 months ago)
Author:
Marko <Marko@…>
Branches:
master
Children:
7e88e46
Parents:
e5b84dc
Message:

Added more controllers

Location:
phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers
Files:
3 added
2 edited

Legend:

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

    re5b84dc r775e15e  
    1818public class PhoneController {
    1919    private final PhoneService phoneService;
    20     private final PhoneOfferService phoneOfferService;
    2120
    22 //     handle request parameters for filtering phones
    2321    @GetMapping(path = "/phones")
    2422    public List<Phone> getPhones(@RequestParam(name = "shops", required = false) String shops,
     
    4240    }
    4341
    44     @GetMapping(path = "/shops")
    45     public List<String> getShops(){
    46         return phoneOfferService.getShops();
    47     }
    48 
    49     @GetMapping(path = "/lowestPrice")
    50     public int getLowestPrice()
    51     {
    52         return phoneOfferService.getLowestPrice();
    53     }
    54 
    55     @GetMapping(path = "/highestPrice")
    56     public int getHighestPrice()
    57     {
    58         return phoneOfferService.getHighestPrice();
    59     }
    60 
    61 
    6242}
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/PhoneOfferController.java

    re5b84dc r775e15e  
    1818public class PhoneOfferController {
    1919    private final PhoneOfferService phoneOfferService;
    20     private final PhoneService phoneService;
    2120
    2221    @GetMapping(path = "/phones/offers/{phoneId}")
     
    3029    }
    3130
     31    @GetMapping(path = "/phoneoffer/{offerId}/cheaperoffers")
     32    public List<PhoneOffer> getCheaperOffers(@PathVariable("offerId") Long offerId){
     33        return phoneOfferService.getCheaperOffers(offerId);
     34    }
     35
     36    @GetMapping(path = "/shops")
     37    public List<String> getShops(){
     38        return phoneOfferService.getShops();
     39    }
     40
     41    @GetMapping(path = "/lowestPrice")
     42    public int getLowestPrice()
     43    {
     44        return phoneOfferService.getLowestPrice();
     45    }
     46
     47    @GetMapping(path = "/highestPrice")
     48    public int getHighestPrice()
     49    {
     50        return phoneOfferService.getHighestPrice();
     51    }
     52
    3253}
Note: See TracChangeset for help on using the changeset viewer.