From ac0dfedd2c63798f4eee915e9095405e32aa0380 Mon Sep 17 00:00:00 2001 From: "hukekuan@163.com" Date: Sat, 27 Jan 2018 18:02:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gis3c/ol/entity/Source.java | 28 +- src/main/resources/init.sql | 8 +- src/test/resources/mappings/ol/SourceDao.xml | 251 ++---------------- 3 files changed, 39 insertions(+), 248 deletions(-) diff --git a/src/main/java/com/gis3c/ol/entity/Source.java b/src/main/java/com/gis3c/ol/entity/Source.java index c5d1414..fc71a2c 100644 --- a/src/main/java/com/gis3c/ol/entity/Source.java +++ b/src/main/java/com/gis3c/ol/entity/Source.java @@ -9,8 +9,8 @@ import java.util.Map; public class Source { private String sourceId; private String sourceName; - private String url; - private java.util.Map params; + private String type; + private java.util.Map options; private String description; public String getSourceId() { @@ -29,14 +29,6 @@ public class Source { this.sourceName = sourceName; } - public java.util.Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } - public String getDescription() { return description; } @@ -45,11 +37,19 @@ public class Source { this.description = description; } - public String getUrl() { - return url; + public String getType() { + return type; } - public void setUrl(String url) { - this.url = url; + public void setType(String type) { + this.type = type; + } + + public Map getOptions() { + return options; + } + + public void setOptions(Map options) { + this.options = options; } } diff --git a/src/main/resources/init.sql b/src/main/resources/init.sql index e57af0d..8d823b3 100644 --- a/src/main/resources/init.sql +++ b/src/main/resources/init.sql @@ -130,10 +130,10 @@ create table c3gis_ol_source_wmts( ); create table c3gis_ol_source( - sourceid varchar(50) not null PRIMARY KEY, - sourcename varchar(50) not null, - url varchar(50) not null, - params jsonb, + sourceId varchar(50) not null PRIMARY KEY, + sourceName varchar(50) not null, + type varchar(50) not null, + options jsonb, description varchar(50) ); diff --git a/src/test/resources/mappings/ol/SourceDao.xml b/src/test/resources/mappings/ol/SourceDao.xml index a63bcd2..3d6a564 100644 --- a/src/test/resources/mappings/ol/SourceDao.xml +++ b/src/test/resources/mappings/ol/SourceDao.xml @@ -1,248 +1,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - sourceid - , sourcename - , url - , layer - , style - , format - , matrixSet + + sourceId + , sourceName + , type + , options , description - - sourceid - , sourcename - , url - , logo - , useSpatialIndex - , wrapX - , description - - - sourceid - , sourcename - , url - , crossOrigin - , projection - , wrapX - , description - - - sourceid - , sourcename - , url - , wrapX - , opaque - , description - - - - - - - - - INSERT INTO c3gis_ol_source_tilearcgisrest( - sourceid - , sourcename - , url - , crossOrigin - , projection - , wrapX - , description - ) - VALUES( - #{sourceId} - , #{sourceName} - , #{url} - , #{crossOrigin} - , #{projection} - , #{wrapX} - , #{description}); - - - - - - - - - INSERT INTO c3gis_ol_source_tilesupermaprest( - sourceid - , sourcename - , url - , wrapX - , opaque - , description - ) - VALUES( - #{sourceId} - , #{sourceName} - , #{url} - , #{wrapX} - , #{opaque} - , #{description}); - - - - - - - - - INSERT INTO c3gis_ol_source_vector( - sourceid - , sourcename - , url - , logo - , useSpatialIndex - , wrapX - , description - ) - VALUES( - #{sourceId} - , #{sourceName} - , #{url} - , #{logo} - , #{useSpatialIndex} - , #{wrapX} - , #{description}); - - - - - - - - - - INSERT INTO c3gis_ol_source_wmts( - sourceid - , sourcename - , url - , layer - , style - , format - , matrixSet - , description - ) - VALUES( - #{sourceId} - , #{sourceName} - , #{url} - , #{layer} - , #{style} - , #{format} - , #{matrixSet} - , #{description} - ); - - INSERT INTO c3gis_ol_source( - sourceid - , sourcename - , url - , params - , description + INSERT INTO c3gis_ol_source(sourceId + , sourceName + , type + , options + , description ) - VALUES( - #{sourceId} - , #{sourceName} - , #{url} - , #{params, javaType=ObjectJSON}::jsonb - , #{description} + VALUES(#{sourceId} + , #{sourceName} + , #{type} + , #{options, javaType=ObjectJSON}::jsonb + , #{description} ); \ No newline at end of file