Ignore:
Timestamp:
11/11/21 12:59:26 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
59329aa
Parents:
6c1585f
Message:

add location to planner

Location:
trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/LocationRestController.java

    r6c1585f rceaed42  
    22
    33import finki.diplomska.tripplanner.models.Location;
     4import finki.diplomska.tripplanner.models.dto.PlannerLocationDto;
    45import finki.diplomska.tripplanner.service.LocationService;
    56import finki.diplomska.tripplanner.service.PlannerService;
     
    5051        return this.locationService.findLocationsFromRegionForm(regionId, companionId,lengthOfStay, categoryIds);
    5152    }
     53
     54    @PutMapping(value = "/add-location")
     55    public Location addLocationToPlanner(@RequestBody PlannerLocationDto plannerLocationDto){
     56        return this.locationService.addLocationToPlanner(plannerLocationDto);
     57    }
     58
     59    @GetMapping(value = "/planner/locations")
     60    public List<Location> getAllLocationsForPlanner (@RequestParam Long plannerId){
     61        return this.locationService.getAllLocationsForPlanner(plannerId);
     62    }
    5263}
  • trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/PlannerRestController.java

    r6c1585f rceaed42  
    7171    }
    7272
    73     @PutMapping(value = "/add-location")
    74     public Planner addLocationToPlanner(@RequestParam Long lid, @RequestParam Long pid){
    75         return this.plannerService.addLocationToPlanner(lid, pid);
    76     }
     73
    7774}
Note: See TracChangeset for help on using the changeset viewer.