czesciowy profile

This commit is contained in:
mar committed 2015-01-25 21:31:34 +01:00
1 parent ea675d9185
commit aa4154fd7f
3 files changed
+29 -3

No files matched your search

@@ -18,6 +18,7 @@ import java.util.List;
@Controller
@RequestMapping(APIServicePaths.GIS_CONTROLLER)
public class GisController {
@Autowired
GisDbApi gisDbApi;
@@ -4,7 +4,11 @@ import hello.agh.edu.bazy.dbApi.profile.ProfileDbApi;
import hello.agh.edu.bazy.path.APIServicePaths;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import pl.edu.agh.ztb.configs.model.Configuration;
import java.sql.SQLException;
import java.util.List;
/**
* Created by mar on 25.01.15.
@@ -16,5 +20,23 @@ public class ProfileController {
@Autowired
ProfileDbApi profileDbApi;
@RequestMapping(value = APIServicePaths.DELETE_PROFILE + "/{name}", method = RequestMethod.DELETE)
boolean deleteProfile(@PathVariable("name") String name) throws SQLException {
profileDbApi.getProfileDbApi().deleteProfile(name);
return true;
}
@RequestMapping(value = APIServicePaths.GET_ALL_CONFIGURATION)
@ResponseBody
List<Configuration> getAllConfiguration() throws SQLException {
return profileDbApi.getProfileDbApi().getAllConfigurations();
}
@RequestMapping(value = APIServicePaths.DELETE_CONFIGURATION + "/{projectId}/{segmentId}/{profileId}", method = RequestMethod.DELETE)
@ResponseBody
boolean deleteConfiguration(@PathVariable("projectId") String projectId, @PathVariable("segmentId") String segmentId, @PathVariable("profileId") String profileId) throws SQLException {
profileDbApi.getProfileDbApi().deleteConfiguration(projectId, Long.valueOf(segmentId), profileId);
return true;
}
}
@@ -10,6 +10,8 @@ package hello.agh.edu.bazy.path;
public final class APIServicePaths {
private APIServicePaths() {
}
@@ -43,6 +45,7 @@ public final class APIServicePaths {
//PROFILE
public static final String PROFILE_CONTROLLER = "/profile";
public static final String DELETE_PROFILE = "/profile";
public static final String GET_ALL_CONFIGURATION = "/configurations";
public static final String DELETE_CONFIGURATION = "/configuration";
}