初始化
This commit is contained in:
parent
f5e4172d01
commit
2b25289e0e
@ -4,6 +4,7 @@ import com.gis3c.common.persistence.annotation.C3olDao;
|
||||
import com.gis3c.ol.entity.Source;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ -18,6 +19,7 @@ public interface SourceDao {
|
||||
@Param("currentPage") Integer currentPage);
|
||||
public Source findSourceById(String sourceId);
|
||||
public Source findSourceByName(String sourceName);
|
||||
public List<Source> findSourceByType(String[] sourceTypes);
|
||||
public Integer insertSource(Source source);
|
||||
|
||||
public Integer deleteSourcesById(Set<String> sourceIds);
|
||||
|
||||
@ -126,5 +126,27 @@ public class Layer {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String[] PossibleSourceType(){
|
||||
String[] sourceTypeArray = null;
|
||||
switch (this.getType()){
|
||||
case "ol.layer.Tile":
|
||||
sourceTypeArray = new String[]{"ol.source.TileSuperMapRest","ol.source.WMTS","ol.source.TileArcGISRest"};
|
||||
break;
|
||||
case "ol.layer.Image":
|
||||
sourceTypeArray = new String[]{"ol.source.Image"};
|
||||
break;
|
||||
case "ol.layer.Vector":
|
||||
case "ol.layer.Heatmap":
|
||||
sourceTypeArray = new String[]{"ol.source.Vector"};
|
||||
break;
|
||||
case "ol.layer.VectorTile":
|
||||
sourceTypeArray = new String[]{"ol.source.VectorTile"};
|
||||
break;
|
||||
default:
|
||||
sourceTypeArray = new String[]{};
|
||||
break;
|
||||
}
|
||||
|
||||
return sourceTypeArray;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.gis3c.ol.service;
|
||||
|
||||
import com.gis3c.ol.entity.Source;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ -12,6 +14,9 @@ public interface SourceService {
|
||||
public List<java.util.Map<String,Object>> findSourcesByPage(Integer pageSize,Integer currentPage);
|
||||
public Source findSourceById(String sourceId);
|
||||
public Source findSourceByName(String sourceName);
|
||||
public List<Source> findSourceByType(String[] sourceTypes);
|
||||
|
||||
|
||||
public Integer insertSource(Source source);
|
||||
|
||||
public Integer deleteSourcesById(Set<String> sourceIds);
|
||||
|
||||
@ -9,10 +9,7 @@ import com.gis3c.ol.service.SourceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Created by hukekuan on 2017/12/15.
|
||||
@ -51,6 +48,11 @@ public class SourceServiceImpl implements SourceService {
|
||||
return sourceDao.findSourceByName(sourceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Source> findSourceByType(String[] sourceTypes) {
|
||||
return sourceDao.findSourceByType(sourceTypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer insertSource(Source source) {
|
||||
source.setSourceId(UUID.randomUUID().toString());
|
||||
|
||||
@ -29,9 +29,35 @@ public class App {
|
||||
MapService mapService = context.getBean(MapService.class);
|
||||
TestService testService = context.getBean(TestService.class);
|
||||
|
||||
List<String> list = Arrays.asList(new String[]{"a","b","c"});
|
||||
|
||||
Layer layer = layerService.findeLayerById("d804360f-eb5f-4e29-94ab-fdafbf224e02");
|
||||
System.out.println(layer.getExtent());
|
||||
list.stream().forEach(u -> {
|
||||
if("a".equals(u)){
|
||||
System.out.println(u.toUpperCase());
|
||||
}else {
|
||||
System.out.println(u);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// List<Source> sourceList = sourceService.findSourceByType(new String[]{"a","b","c"});
|
||||
|
||||
// System.out.println(sourceList);
|
||||
// sourceList.forEach(u -> System.out.println(u));
|
||||
|
||||
// String source = Optional
|
||||
// .ofNullable(layerService.findeLayerById("d804360f"))
|
||||
// .map(layer -> layer.getSource())
|
||||
// .orElse("");
|
||||
//
|
||||
// System.out.println("".equals(source));
|
||||
|
||||
|
||||
|
||||
|
||||
// Layer layer = layerService.findeLayerById("d804360f-eb5f-4e29-94ab-fdafbf224e02");
|
||||
// System.out.println(layer.getExtent());
|
||||
|
||||
// Source source = sourceService.findSourceByName("cva");
|
||||
// System.out.println(source.getOptions());
|
||||
|
||||
@ -42,6 +42,16 @@
|
||||
FROM c3gis_ol_source
|
||||
WHERE sourceName = #{sourceName, javaType=java.lang.String};
|
||||
</select>
|
||||
<select id="findSourceByType" resultMap="sourceResult" parameterType="java.util.Set">
|
||||
SELECT
|
||||
<include refid="sourceColumns"/>
|
||||
FROM c3gis_ol_source
|
||||
WHERE type in
|
||||
<foreach collection ="array" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item, javaType=java.lang.String}
|
||||
</foreach>
|
||||
ORDER BY type;
|
||||
</select>
|
||||
|
||||
<insert id="insertSource" parameterType="com.gis3c.ol.entity.Source">
|
||||
INSERT INTO c3gis_ol_source(sourceId
|
||||
|
||||
Loading…
Reference in New Issue
Block a user