Skip to content
Snippets Groups Projects
Commit 34b4b655 authored by Rodríguez Ortega, Alejandro's avatar Rodríguez Ortega, Alejandro
Browse files

Simplified rest interface for Anonymice methods.

parent 173af029
No related branches found
No related tags found
No related merge requests found
......@@ -15,12 +15,16 @@
*/
package com.tecnalia.urbanite.anonymize.rest;
import javax.websocket.server.PathParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.tecnalia.urbanite.anonymize.service.AnonymizerService;
......@@ -39,7 +43,7 @@ public class AnonymizerAPI {
@Autowired
AnonymizerService anonymizerService;
/* @RequestMapping(method = RequestMethod.POST, value = "/anonymize/{city}/{model}/{property}/{value}")
@RequestMapping(method = RequestMethod.POST, value = "/anonymize/{city}/{model}/{property}/{value}")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Successful operation."),
@ApiResponse(responseCode = "400", description = "Bad request. (User unknow)")})
......@@ -52,7 +56,7 @@ public class AnonymizerAPI {
return anonymizerService.anonymizeProperty(city,model,property,value);
} */
}
@RequestMapping(method = RequestMethod.POST, value = "/removePointsOutOfArea/{city}/{model}/{property}/{value}")
@ApiResponses(value = {
......@@ -79,17 +83,17 @@ public class AnonymizerAPI {
}
@RequestMapping(method = RequestMethod.POST, value = "/generateAnonymousVehicleTripFromVehiclePointsString/{city}/{model}/{property}")
@RequestMapping(method = RequestMethod.POST, value = "/generateAnonymousVehicleTripFromVehiclePoints")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Successful operation."),
@ApiResponse(responseCode = "400", description = "Bad request. ")})
public ResponseEntity<String> generateAnonymousVehicleTripFromVehiclePointsString(
@Parameter(description = "City where is the model to be anonymized", example = "messina") @PathVariable String city,
@Parameter(description = "Model that is going to be anonymized.", example = "vehicle") @PathVariable String model,
@Parameter(description = "Property of the model that is going to be anonymized.", example = "name") @PathVariable String property) throws Exception {
@Operation(summary = "Generate anonymiced routes from trips.", description = "The service get the messina Vehicle points of ebikes and generate GPS Routes, then anonymice this routas deleting the "
+ " {meters} of the beginnig and the end.")
public ResponseEntity<String> generateAnonymousVehicleTripFromVehiclePoints(
@Parameter(description = "Meters to delete", example = "50", required = false) @RequestParam(required = false) double meters
) throws Exception {
return anonymizerService.generateAnonymousVehicleTripFromVehiclePointsString(city,model,property, 50);
return anonymizerService.generateAnonymousVehicleTripFromVehiclePointsString("messina","vehicle","name", meters);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment