From 31c46b4a4a880d1eff76de8edfaafefdce05d708 Mon Sep 17 00:00:00 2001 From: lukasgol Date: Mon, 26 Jan 2015 18:26:24 +0100 Subject: [PATCH] reafactor gisdbapi --- src/main/java/hello/agh/edu/bazy/dbApi/gis/GisDbApi.java | 8 ++++---- .../java/hello/agh/edu/bazy/path/APIServicePaths.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/hello/agh/edu/bazy/dbApi/gis/GisDbApi.java b/src/main/java/hello/agh/edu/bazy/dbApi/gis/GisDbApi.java index a8604a2..f9e781d 100644 --- a/src/main/java/hello/agh/edu/bazy/dbApi/gis/GisDbApi.java +++ b/src/main/java/hello/agh/edu/bazy/dbApi/gis/GisDbApi.java @@ -16,9 +16,9 @@ import java.util.List; @Component public class GisDbApi { - private static final String GET_LAMP = "SELECT osm_id,tags,st_transform(way,4326) FROM planet_osm_point WHERE highway='street_lamp'"; + private static final String GET_LAMPS = "SELECT osm_id,tags,st_transform(way,4326) FROM planet_osm_point WHERE highway='street_lamp'"; private static String PUT_LAMP = "INSERT INTO public.gis_points(gis_points_id, way, highway) VALUES (@, st_geomfromtext('POINT(@ @)',4326), 'street_lamp');"; - private static final String GET_LAMPS = "SELECT st_transform(way,900913) FROM gis_points WHERE gis_points_id = ?;"; + private static final String GET_LAMP = "SELECT st_transform(way,900913) FROM gis_points WHERE gis_points_id = ?;"; private static final String DELETE_LAMP = "DELETE FROM public.gis_points WHERE gis_points_id = ?"; JdbcTemplate gisJdbcTemplate; @@ -39,11 +39,11 @@ public class GisDbApi { } public List getAllLamps() { - return gisJdbcTemplate.query(GET_LAMP, new GisRowMapperForLamps()); + return gisJdbcTemplate.query(GET_LAMPS, new GisRowMapperForLamps()); } public List getLamp(long id) { - return gisJdbcTemplate.query(GET_LAMPS, new Object[]{id}, new PointRowMapper()); + return gisJdbcTemplate.query(GET_LAMP, new Object[]{id}, new PointRowMapper()); } public int putLamp(long id, double x, double y) { diff --git a/src/main/java/hello/agh/edu/bazy/path/APIServicePaths.java b/src/main/java/hello/agh/edu/bazy/path/APIServicePaths.java index 983626b..6042cf8 100644 --- a/src/main/java/hello/agh/edu/bazy/path/APIServicePaths.java +++ b/src/main/java/hello/agh/edu/bazy/path/APIServicePaths.java @@ -24,7 +24,7 @@ public final class APIServicePaths { //GIS public static final String GIS_CONTROLLER = "/gis"; - public static final String GET_ALL_LAMPS = "/lamp"; + public static final String GET_ALL_LAMPS = "/lamps"; public static final String PUT_LAMP = "/lamp"; public static final String DELETE_LAMP = "/lamp"; public static final String GET_LAMP = "/lamp";