From d389b52b6628948439a9678df7bead16c70dc64f Mon Sep 17 00:00:00 2001 From: "hukekuan@163.com" Date: Mon, 29 Jan 2018 14:51:32 +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/dao/LayerDao.java | 8 ++ src/main/java/com/gis3c/ol/dao/MapDao.java | 2 +- src/main/java/com/gis3c/ol/dao/SourceDao.java | 40 ++------- .../ol/entity/source/TileArcGISRest.java | 70 ---------------- .../ol/entity/source/TileSuperMapRest.java | 61 -------------- .../com/gis3c/ol/entity/source/Vector.java | 72 ---------------- .../java/com/gis3c/ol/entity/source/Wmts.java | 79 ----------------- .../com/gis3c/ol/entity/style/Circle.java | 7 -- .../java/com/gis3c/ol/entity/style/Fill.java | 7 -- .../java/com/gis3c/ol/entity/style/Icon.java | 7 -- .../gis3c/ol/entity/style/RegularShape.java | 7 -- .../com/gis3c/ol/entity/style/Stroke.java | 7 -- .../java/com/gis3c/ol/entity/style/Style.java | 61 -------------- .../com/gis3c/ol/service/LayerService.java | 5 ++ .../java/com/gis3c/ol/service/MapService.java | 2 +- .../com/gis3c/ol/service/SourceService.java | 39 ++------- .../ol/service/impl/LayerServiceImpl.java | 14 ++++ .../gis3c/ol/service/impl/MapServiceImpl.java | 6 +- .../ol/service/impl/SourceServiceImpl.java | 71 +++------------- src/test/java/com/gis3c/spatial/App.java | 43 +++++----- src/test/resources/mappings/ol/LayerDao.xml | 12 +++ src/test/resources/mappings/ol/MapDao.xml | 2 +- src/test/resources/mappings/ol/SourceDao.xml | 23 ++++- src/test/resources/mappings/ol/ViewDao.xml | 84 ------------------- 24 files changed, 117 insertions(+), 612 deletions(-) delete mode 100644 src/main/java/com/gis3c/ol/entity/source/TileArcGISRest.java delete mode 100644 src/main/java/com/gis3c/ol/entity/source/TileSuperMapRest.java delete mode 100644 src/main/java/com/gis3c/ol/entity/source/Vector.java delete mode 100644 src/main/java/com/gis3c/ol/entity/source/Wmts.java delete mode 100644 src/main/java/com/gis3c/ol/entity/style/Circle.java delete mode 100644 src/main/java/com/gis3c/ol/entity/style/Fill.java delete mode 100644 src/main/java/com/gis3c/ol/entity/style/Icon.java delete mode 100644 src/main/java/com/gis3c/ol/entity/style/RegularShape.java delete mode 100644 src/main/java/com/gis3c/ol/entity/style/Stroke.java delete mode 100644 src/main/java/com/gis3c/ol/entity/style/Style.java delete mode 100644 src/test/resources/mappings/ol/ViewDao.xml diff --git a/src/main/java/com/gis3c/ol/dao/LayerDao.java b/src/main/java/com/gis3c/ol/dao/LayerDao.java index 8837046..9a259c0 100644 --- a/src/main/java/com/gis3c/ol/dao/LayerDao.java +++ b/src/main/java/com/gis3c/ol/dao/LayerDao.java @@ -2,12 +2,20 @@ package com.gis3c.ol.dao; import com.gis3c.common.persistence.annotation.C3olDao; import com.gis3c.ol.entity.Layer; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * Created by hukekuan on 2017/12/15. */ @C3olDao public interface LayerDao { + public List findAllList(); + public List findLayersByPage( + @Param("pageSize") Integer pageSize, + @Param("currentPage") Integer currentPage); + public Layer findeLayerById(String layerId); public Layer findeLayerByName(String layerName); diff --git a/src/main/java/com/gis3c/ol/dao/MapDao.java b/src/main/java/com/gis3c/ol/dao/MapDao.java index 78d88a2..cfaeaea 100644 --- a/src/main/java/com/gis3c/ol/dao/MapDao.java +++ b/src/main/java/com/gis3c/ol/dao/MapDao.java @@ -12,7 +12,7 @@ import java.util.List; @C3olDao public interface MapDao { public List findAllList(); - public List findMapsByByPage( + public List findMapsByPage( @Param("pageSize") Integer pageSize, @Param("currentPage") Integer currentPage); diff --git a/src/main/java/com/gis3c/ol/dao/SourceDao.java b/src/main/java/com/gis3c/ol/dao/SourceDao.java index 8a9fe79..223666a 100644 --- a/src/main/java/com/gis3c/ol/dao/SourceDao.java +++ b/src/main/java/com/gis3c/ol/dao/SourceDao.java @@ -2,10 +2,7 @@ package com.gis3c.ol.dao; import com.gis3c.common.persistence.annotation.C3olDao; import com.gis3c.ol.entity.Source; -import com.gis3c.ol.entity.source.TileArcGISRest; -import com.gis3c.ol.entity.source.TileSuperMapRest; -import com.gis3c.ol.entity.source.Vector; -import com.gis3c.ol.entity.source.Wmts; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -14,32 +11,11 @@ import java.util.List; */ @C3olDao public interface SourceDao { - public TileArcGISRest findTileArcGISRestById(String sourceId); - public TileArcGISRest findTileArcGISRestByName(String sourceName); - - public Integer insertTileArcGISRest(TileArcGISRest tileArcGISRest); - - - - public TileSuperMapRest findTileTileSuperMapRestById(String sourceId); - public TileSuperMapRest findTileTileSuperMapRestByName(String sourceName); - - public Integer insertTileSuperMapRest(TileSuperMapRest tileSuperMapRest); - - - - public Vector findVectorById(String sourceId); - public Vector findVectorByName(String sourceName); - - public Integer insertVector(Vector vector); - - - - public Wmts findWmtsById(String sourceId); - public Wmts findWmtsByName(String sourceName); - - public Integer insertWmts(Wmts wmts); - - public List findAllSources(); - public void insertSource(Source source); + public List findAllList(); + public List findSourcesByPage( + @Param("pageSize") Integer pageSize, + @Param("currentPage") Integer currentPage); + public Source findSourceById(String sourceId); + public Source findSourceByName(String sourceName); + public Integer insertSource(Source source); } diff --git a/src/main/java/com/gis3c/ol/entity/source/TileArcGISRest.java b/src/main/java/com/gis3c/ol/entity/source/TileArcGISRest.java deleted file mode 100644 index b1262d1..0000000 --- a/src/main/java/com/gis3c/ol/entity/source/TileArcGISRest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.gis3c.ol.entity.source; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class TileArcGISRest { - private String sourceId; - private String sourceName; - private String crossOrigin; - private String projection; - private String url; - private Boolean wrapX; - private String description; - - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public String getSourceName() { - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public String getCrossOrigin() { - return crossOrigin; - } - - public void setCrossOrigin(String crossOrigin) { - this.crossOrigin = crossOrigin; - } - - public String getProjection() { - return projection; - } - - public void setProjection(String projection) { - this.projection = projection; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public Boolean getWrapX() { - return wrapX; - } - - public void setWrapX(Boolean wrapX) { - this.wrapX = wrapX; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } -} diff --git a/src/main/java/com/gis3c/ol/entity/source/TileSuperMapRest.java b/src/main/java/com/gis3c/ol/entity/source/TileSuperMapRest.java deleted file mode 100644 index 5c7df07..0000000 --- a/src/main/java/com/gis3c/ol/entity/source/TileSuperMapRest.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.gis3c.ol.entity.source; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class TileSuperMapRest { - private String sourceId; - private String sourceName; - private String url; - private Boolean wrapX; - private Boolean opaque; - private String description; - - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public String getSourceName() { - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public Boolean getWrapX() { - return wrapX; - } - - public void setWrapX(Boolean wrapX) { - this.wrapX = wrapX; - } - - public Boolean getOpaque() { - return opaque; - } - - public void setOpaque(Boolean opaque) { - this.opaque = opaque; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } -} diff --git a/src/main/java/com/gis3c/ol/entity/source/Vector.java b/src/main/java/com/gis3c/ol/entity/source/Vector.java deleted file mode 100644 index 257059f..0000000 --- a/src/main/java/com/gis3c/ol/entity/source/Vector.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.gis3c.ol.entity.source; - -import com.sun.org.apache.xpath.internal.operations.Bool; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class Vector { - private String sourceId; - private String sourceName; - private Boolean logo; - private String url; - private Boolean useSpatialIndex; - private Boolean wrapX; - private String description; - - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public String getSourceName() { - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public Boolean getLogo() { - return logo; - } - - public void setLogo(Boolean logo) { - this.logo = logo; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public Boolean getUseSpatialIndex() { - return useSpatialIndex; - } - - public void setUseSpatialIndex(Boolean useSpatialIndex) { - this.useSpatialIndex = useSpatialIndex; - } - - public Boolean getWrapX() { - return wrapX; - } - - public void setWrapX(Boolean wrapX) { - this.wrapX = wrapX; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } -} diff --git a/src/main/java/com/gis3c/ol/entity/source/Wmts.java b/src/main/java/com/gis3c/ol/entity/source/Wmts.java deleted file mode 100644 index ea18a9f..0000000 --- a/src/main/java/com/gis3c/ol/entity/source/Wmts.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.gis3c.ol.entity.source; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class Wmts { - private String sourceId; - private String sourceName; - private String url; - private String layer; - private String style; - private String format; - private String matrixSet; - private String description; - - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public String getSourceName() { - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getLayer() { - return layer; - } - - public void setLayer(String layer) { - this.layer = layer; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public String getFormat() { - return format; - } - - public void setFormat(String format) { - this.format = format; - } - - public String getMatrixSet() { - return matrixSet; - } - - public void setMatrixSet(String matrixSet) { - this.matrixSet = matrixSet; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } -} diff --git a/src/main/java/com/gis3c/ol/entity/style/Circle.java b/src/main/java/com/gis3c/ol/entity/style/Circle.java deleted file mode 100644 index 7916b1a..0000000 --- a/src/main/java/com/gis3c/ol/entity/style/Circle.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.gis3c.ol.entity.style; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class Circle { -} diff --git a/src/main/java/com/gis3c/ol/entity/style/Fill.java b/src/main/java/com/gis3c/ol/entity/style/Fill.java deleted file mode 100644 index abed0fe..0000000 --- a/src/main/java/com/gis3c/ol/entity/style/Fill.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.gis3c.ol.entity.style; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class Fill { -} diff --git a/src/main/java/com/gis3c/ol/entity/style/Icon.java b/src/main/java/com/gis3c/ol/entity/style/Icon.java deleted file mode 100644 index 7575d7a..0000000 --- a/src/main/java/com/gis3c/ol/entity/style/Icon.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.gis3c.ol.entity.style; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class Icon { -} diff --git a/src/main/java/com/gis3c/ol/entity/style/RegularShape.java b/src/main/java/com/gis3c/ol/entity/style/RegularShape.java deleted file mode 100644 index b631d77..0000000 --- a/src/main/java/com/gis3c/ol/entity/style/RegularShape.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.gis3c.ol.entity.style; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class RegularShape { -} diff --git a/src/main/java/com/gis3c/ol/entity/style/Stroke.java b/src/main/java/com/gis3c/ol/entity/style/Stroke.java deleted file mode 100644 index 64e40ae..0000000 --- a/src/main/java/com/gis3c/ol/entity/style/Stroke.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.gis3c.ol.entity.style; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class Stroke { -} diff --git a/src/main/java/com/gis3c/ol/entity/style/Style.java b/src/main/java/com/gis3c/ol/entity/style/Style.java deleted file mode 100644 index 0b9ccad..0000000 --- a/src/main/java/com/gis3c/ol/entity/style/Style.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.gis3c.ol.entity.style; - -/** - * Created by hukekuan on 2017/12/14. - */ -public class Style { - private String styleId; - private String getStyleName; - private String fill; - private String image; - private String stroke; - private String text; - - public String getStyleId() { - return styleId; - } - - public void setStyleId(String styleId) { - this.styleId = styleId; - } - - public String getGetStyleName() { - return getStyleName; - } - - public void setGetStyleName(String getStyleName) { - this.getStyleName = getStyleName; - } - - public String getFill() { - return fill; - } - - public void setFill(String fill) { - this.fill = fill; - } - - public String getImage() { - return image; - } - - public void setImage(String image) { - this.image = image; - } - - public String getStroke() { - return stroke; - } - - public void setStroke(String stroke) { - this.stroke = stroke; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } -} diff --git a/src/main/java/com/gis3c/ol/service/LayerService.java b/src/main/java/com/gis3c/ol/service/LayerService.java index beccdb9..a56cb09 100644 --- a/src/main/java/com/gis3c/ol/service/LayerService.java +++ b/src/main/java/com/gis3c/ol/service/LayerService.java @@ -3,10 +3,15 @@ package com.gis3c.ol.service; import com.gis3c.ol.entity.Layer; +import java.util.List; + /** * Created by hukekuan on 2017/12/15. */ public interface LayerService { + public List findAllList(); + public List findLayersByPage(Integer pageSize,Integer currentPage); + public Layer findeLayerById(String layerId); public Layer findeLayerByName(String layerName); diff --git a/src/main/java/com/gis3c/ol/service/MapService.java b/src/main/java/com/gis3c/ol/service/MapService.java index 9d9087f..6685d77 100644 --- a/src/main/java/com/gis3c/ol/service/MapService.java +++ b/src/main/java/com/gis3c/ol/service/MapService.java @@ -9,7 +9,7 @@ import java.util.List; */ public interface MapService { public List findAllList(); - public List findMapsByByPage(Integer pageSize,Integer currentPage); + public List findMapsByPage(Integer pageSize,Integer currentPage); public Map findMapById(String mapId); public Map findMapByName(String mapName); diff --git a/src/main/java/com/gis3c/ol/service/SourceService.java b/src/main/java/com/gis3c/ol/service/SourceService.java index 4c25227..6cb36d5 100644 --- a/src/main/java/com/gis3c/ol/service/SourceService.java +++ b/src/main/java/com/gis3c/ol/service/SourceService.java @@ -1,44 +1,15 @@ package com.gis3c.ol.service; import com.gis3c.ol.entity.Source; -import com.gis3c.ol.entity.source.TileArcGISRest; -import com.gis3c.ol.entity.source.TileSuperMapRest; -import com.gis3c.ol.entity.source.Vector; -import com.gis3c.ol.entity.source.Wmts; - import java.util.List; /** * Created by hukekuan on 2017/12/15. */ public interface SourceService { - public TileArcGISRest findTileArcGISRestById(String sourceId); - public TileArcGISRest findTileArcGISRestByName(String sourceName); - - public Integer insertTileArcGISRest(TileArcGISRest tileArcGISRest); - - - - public TileSuperMapRest findTileTileSuperMapRestById(String sourceId); - public TileSuperMapRest findTileTileSuperMapRestByName(String sourceName); - - public Integer insertTileSuperMapRest(TileSuperMapRest tileSuperMapRest); - - - - public Vector findVectorById(String sourceId); - public Vector findVectorByName(String sourceName); - - public Integer insertVector(Vector vector); - - - - public Wmts findWmtsById(String sourceId); - public Wmts findWmtsByName(String sourceName); - - public Integer insertWmts(Wmts wmts); - - - public List findAllSources(); - public void insertSource(Source source); + public List findAllList(); + public List findSourcesByPage(Integer pageSize,Integer currentPage); + public Source findSourceById(String sourceId); + public Source findSourceByName(String sourceName); + public Integer insertSource(Source source); } diff --git a/src/main/java/com/gis3c/ol/service/impl/LayerServiceImpl.java b/src/main/java/com/gis3c/ol/service/impl/LayerServiceImpl.java index b7d87c3..47d670f 100644 --- a/src/main/java/com/gis3c/ol/service/impl/LayerServiceImpl.java +++ b/src/main/java/com/gis3c/ol/service/impl/LayerServiceImpl.java @@ -6,6 +6,9 @@ import com.gis3c.ol.service.LayerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.UUID; + /** * Created by hukekuan on 2017/12/15. */ @@ -14,6 +17,16 @@ public class LayerServiceImpl implements LayerService { @Autowired private LayerDao layerDao; + @Override + public List findAllList() { + return layerDao.findAllList(); + } + + @Override + public List findLayersByPage(Integer pageSize, Integer currentPage) { + return layerDao.findLayersByPage(pageSize,(currentPage -1)*pageSize); + } + @Override public Layer findeLayerById(String layerId) { return layerDao.findeLayerById(layerId); @@ -26,6 +39,7 @@ public class LayerServiceImpl implements LayerService { @Override public Integer insertLayer(Layer layer) { + layer.setLayerId(UUID.randomUUID().toString()); return layerDao.insertLayer(layer); } } diff --git a/src/main/java/com/gis3c/ol/service/impl/MapServiceImpl.java b/src/main/java/com/gis3c/ol/service/impl/MapServiceImpl.java index 82890b2..ea428bc 100644 --- a/src/main/java/com/gis3c/ol/service/impl/MapServiceImpl.java +++ b/src/main/java/com/gis3c/ol/service/impl/MapServiceImpl.java @@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; +import java.util.UUID; /** * Created by hukekuan on 2017/12/14. @@ -22,8 +23,8 @@ public class MapServiceImpl implements MapService { } @Override - public List findMapsByByPage(Integer pageSize,Integer currentPage) { - return mapDao.findMapsByByPage(pageSize,currentPage); + public List findMapsByPage(Integer pageSize,Integer currentPage) { + return mapDao.findMapsByPage(pageSize,(currentPage -1)*pageSize); } @Override @@ -38,6 +39,7 @@ public class MapServiceImpl implements MapService { @Override public Integer insertMap(Map map) { + map.setMapId(UUID.randomUUID().toString()); return mapDao.insertMap(map); } } diff --git a/src/main/java/com/gis3c/ol/service/impl/SourceServiceImpl.java b/src/main/java/com/gis3c/ol/service/impl/SourceServiceImpl.java index 4ef05b4..fbb2c6b 100644 --- a/src/main/java/com/gis3c/ol/service/impl/SourceServiceImpl.java +++ b/src/main/java/com/gis3c/ol/service/impl/SourceServiceImpl.java @@ -2,15 +2,12 @@ package com.gis3c.ol.service.impl; import com.gis3c.ol.dao.SourceDao; import com.gis3c.ol.entity.Source; -import com.gis3c.ol.entity.source.TileArcGISRest; -import com.gis3c.ol.entity.source.TileSuperMapRest; -import com.gis3c.ol.entity.source.Vector; -import com.gis3c.ol.entity.source.Wmts; import com.gis3c.ol.service.SourceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; +import java.util.UUID; /** * Created by hukekuan on 2017/12/15. @@ -21,72 +18,28 @@ public class SourceServiceImpl implements SourceService { private SourceDao sourceDao; @Override - public TileArcGISRest findTileArcGISRestById(String sourceId) { - return sourceDao.findTileArcGISRestById(sourceId); + public List findAllList() { + return sourceDao.findAllList(); } @Override - public TileArcGISRest findTileArcGISRestByName(String sourceName) { - return sourceDao.findTileArcGISRestByName(sourceName); + public List findSourcesByPage(Integer pageSize, Integer currentPage) { + return sourceDao.findSourcesByPage(pageSize,(currentPage -1)*pageSize); } @Override - public Integer insertTileArcGISRest(TileArcGISRest tileArcGISRest) { - return sourceDao.insertTileArcGISRest(tileArcGISRest); + public Source findSourceById(String sourceId) { + return sourceDao.findSourceById(sourceId); } @Override - public TileSuperMapRest findTileTileSuperMapRestById(String sourceId) { - return sourceDao.findTileTileSuperMapRestById(sourceId); + public Source findSourceByName(String sourceName) { + return sourceDao.findSourceByName(sourceName); } @Override - public TileSuperMapRest findTileTileSuperMapRestByName(String sourceName) { - return sourceDao.findTileTileSuperMapRestByName(sourceName); - } - - @Override - public Integer insertTileSuperMapRest(TileSuperMapRest tileSuperMapRest) { - return sourceDao.insertTileSuperMapRest(tileSuperMapRest); - } - - @Override - public Vector findVectorById(String sourceId) { - return sourceDao.findVectorById(sourceId); - } - - @Override - public Vector findVectorByName(String sourceName) { - return sourceDao.findVectorByName(sourceName); - } - - @Override - public Integer insertVector(Vector vector) { - return sourceDao.insertVector(vector); - } - - @Override - public Wmts findWmtsById(String sourceId) { - return sourceDao.findWmtsById(sourceId); - } - - @Override - public Wmts findWmtsByName(String sourceName) { - return sourceDao.findWmtsByName(sourceName); - } - - @Override - public Integer insertWmts(Wmts wmts) { - return sourceDao.insertWmts(wmts); - } - - @Override - public List findAllSources() { - return sourceDao.findAllSources(); - } - - @Override - public void insertSource(Source source) { - sourceDao.insertSource(source); + public Integer insertSource(Source source) { + source.setSourceId(UUID.randomUUID().toString()); + return sourceDao.insertSource(source); } } diff --git a/src/test/java/com/gis3c/spatial/App.java b/src/test/java/com/gis3c/spatial/App.java index 13c1c13..5028ff6 100644 --- a/src/test/java/com/gis3c/spatial/App.java +++ b/src/test/java/com/gis3c/spatial/App.java @@ -1,6 +1,7 @@ package com.gis3c.spatial; import com.gis3c.ol.entity.Layer; +import com.gis3c.ol.entity.Source; import com.gis3c.ol.service.LayerService; import com.gis3c.ol.service.MapService; import com.gis3c.ol.service.SourceService; @@ -9,6 +10,8 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import java.io.IOException; +import java.util.HashMap; +import java.util.List; import java.util.UUID; /** @@ -24,25 +27,25 @@ public class App { SourceService sourceService = context.getBean(SourceService.class); LayerService layerService = context.getBean(LayerService.class); MapService mapService = context.getBean(MapService.class); - TestService testService = context.getBean(TestService.class); -// List sources = sourceService.findAllSources(); -// System.out.println(sources.get(0).getParams()); + + + +// Source source = sourceService.findSourceByName("cva"); +// System.out.println(source.getOptions()); // // Source newSource = new Source(); -// newSource.setSourceId("44"); -// newSource.setSourceName("44"); -// newSource.setUrl("444"); +// newSource.setSourceName("sdkqbigdata"); +// newSource.setType("ol.source.TileArcGISRest"); // java.util.Map params = new HashMap<>(); -// params.put("bar","444"); -// params.put("active",true); -// params.put("balance",4.444); -// params.put("center",new Integer[]{1,2}); -// newSource.setParams(params); -// newSource.setDescription("555"); +// params.put("url","http://58.56.98.79:8003/ArcGIS/rest/services/sdkqbigdata1/MapServer"); +// +// newSource.setOptions(params); +// newSource.setDescription("山东省行政区图"); // // sourceService.insertSource(newSource); +// System.out.println("插入成功"); // List mapList = mapService.findMapsByByPage(10,0); @@ -83,13 +86,15 @@ public class App { // System.out.println("插入成功"); //图层接口 - Layer wmtsLayer = new Layer(); - wmtsLayer.setLayerId(UUID.randomUUID().toString()); - wmtsLayer.setLayerName("cva"); - wmtsLayer.setAliasName("全国行政区图层"); - wmtsLayer.setSource("b2729474-5988-410c-b6a0-8834b19d5832"); - wmtsLayer.setType("ol.layer.Tile"); - layerService.insertLayer(wmtsLayer); + Layer layer = new Layer(); + layer.setLayerName("streetmap"); + layer.setAliasName("超图行政区图"); + layer.setSource("d7cb5f6f-ee31-4a6e-b8fd-72603a066c2b"); + layer.setType("ol.layer.Tile"); + java.util.Map options = new HashMap<>(); + options.put("projection","EPSG:4326"); + layer.setOptions(options); + layerService.insertLayer(layer); System.out.println("插入成功"); diff --git a/src/test/resources/mappings/ol/LayerDao.xml b/src/test/resources/mappings/ol/LayerDao.xml index 358dc7c..ef30a96 100644 --- a/src/test/resources/mappings/ol/LayerDao.xml +++ b/src/test/resources/mappings/ol/LayerDao.xml @@ -33,6 +33,18 @@ , description + + - SELECT FROM c3gis_ol_map diff --git a/src/test/resources/mappings/ol/SourceDao.xml b/src/test/resources/mappings/ol/SourceDao.xml index 3d6a564..230fbfa 100644 --- a/src/test/resources/mappings/ol/SourceDao.xml +++ b/src/test/resources/mappings/ol/SourceDao.xml @@ -17,11 +17,32 @@ , description - SELECT FROM c3gis_ol_source; + + + + + INSERT INTO c3gis_ol_source(sourceId , sourceName diff --git a/src/test/resources/mappings/ol/ViewDao.xml b/src/test/resources/mappings/ol/ViewDao.xml deleted file mode 100644 index 844e070..0000000 --- a/src/test/resources/mappings/ol/ViewDao.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - viewid - , v.viewname - , v.center - , v.extent - , v.maxresolution - , v.minresolution - , v.maxzoom - , v.minzoom - , v.zoom - , v.projection - , v.resolution - , v.resolutions - , v.rotation - , v.description - - - - - - - - INSERT INTO c3gis_ol_view( - viewid - , viewname - , center - , extent - , maxresolution - , minresolution - , maxzoom - , minzoom - , zoom - , projection - , resolution - , resolutions - , rotation - , description - ) - VALUES( - #{viewId} - , #{viewName} - , #{center, javaType=ObjectArray} - , #{extent, javaType=ObjectArray} - , #{maxResolution} - , #{minResolution} - , #{maxZoom} - , #{minZoom} - , #{zoom} - , #{projection} - , #{resolution} - , #{resolutions, javaType=ObjectArray} - , #{rotation} - , #{description}); - - \ No newline at end of file