레이어관리 - 변화지도,라벨링툴 맵 리스트
This commit is contained in:
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.layer;
|
||||
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto;
|
||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto.LayerMapDto;
|
||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto.OrderReq;
|
||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto.SearchReq;
|
||||
import com.kamco.cd.kamcoback.layer.service.LayerService;
|
||||
@@ -187,4 +188,40 @@ public class LayerApiController {
|
||||
public ApiResponseDto<List<String>> getWmsTile() {
|
||||
return ApiResponseDto.ok(layerService.getWmsTitle());
|
||||
}
|
||||
|
||||
@Operation(summary = "변화지도 레이어 조회", description = "변화지도 레이어 조회")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "검색 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
array = @ArraySchema(schema = @Schema(implementation = String.class)))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/map/change-detection")
|
||||
public ApiResponseDto<List<LayerMapDto>> changeDetectionMap() {
|
||||
return ApiResponseDto.ok(layerService.findLayerMapList("change-detection"));
|
||||
}
|
||||
|
||||
@Operation(summary = "라벨링 툴 레이어 조회", description = "라벨링 툴 레이어 조회")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "검색 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
array = @ArraySchema(schema = @Schema(implementation = String.class)))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/map/labeling")
|
||||
public ApiResponseDto<List<LayerMapDto>> labelingMap() {
|
||||
return ApiResponseDto.ok(layerService.findLayerMapList("labeling"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.kamco.cd.kamcoback.layer.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.math.BigDecimal;
|
||||
@@ -17,6 +21,7 @@ public class LayerDto {
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "LayerBasic")
|
||||
public static class Basic {
|
||||
|
||||
@Schema(description = "uuid")
|
||||
private UUID uuid;
|
||||
|
||||
@@ -48,6 +53,7 @@ public class LayerDto {
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "LayerDetail")
|
||||
public static class Detail {
|
||||
|
||||
@Schema(description = "uuid")
|
||||
private UUID uuid;
|
||||
|
||||
@@ -153,6 +159,7 @@ public class LayerDto {
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class SearchReq {
|
||||
|
||||
private String tag;
|
||||
private String layerType;
|
||||
}
|
||||
@@ -162,6 +169,7 @@ public class LayerDto {
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class TileAddReqDto {
|
||||
|
||||
@Schema(description = "설명", example = "배경지도 입니다.")
|
||||
private String description;
|
||||
|
||||
@@ -189,4 +197,89 @@ public class LayerDto {
|
||||
@Schema(description = "zoom max", example = "18")
|
||||
private Short max;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(name = "LayerMapDto")
|
||||
public static class LayerMapDto {
|
||||
|
||||
@Schema(example = "WMTS", description = "유형 (TILE/GEOJSON/WMTS/WMS)")
|
||||
private String layerType;
|
||||
|
||||
@Schema(description = "title")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "설명")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "태그")
|
||||
private String tag;
|
||||
|
||||
@Schema(description = "순서")
|
||||
private Long sortOrder;
|
||||
|
||||
@Schema(description = "url")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "좌측상단 경도", example = "126.0")
|
||||
private BigDecimal minLon;
|
||||
|
||||
@Schema(description = "좌측상단 위도", example = "34.0")
|
||||
private BigDecimal minLat;
|
||||
|
||||
@Schema(description = "우측하단 경도", example = "130.0")
|
||||
private BigDecimal maxLon;
|
||||
|
||||
@Schema(description = "우측하단 위도", example = "38.5")
|
||||
private BigDecimal maxLat;
|
||||
|
||||
@Schema(description = "zoom min", example = "5")
|
||||
private Short minZoom;
|
||||
|
||||
@Schema(description = "zoom max", example = "18")
|
||||
private Short maxZoom;
|
||||
|
||||
@Schema(description = "bbox")
|
||||
private JsonNode bbox;
|
||||
|
||||
@JsonIgnore private String bboxGeometry;
|
||||
|
||||
public LayerMapDto(
|
||||
String layerType,
|
||||
String tag,
|
||||
Long sortOrder,
|
||||
String url,
|
||||
BigDecimal minLon,
|
||||
BigDecimal minLat,
|
||||
BigDecimal maxLon,
|
||||
BigDecimal maxLat,
|
||||
Short minZoom,
|
||||
Short maxZoom,
|
||||
String bboxGeometry) {
|
||||
this.layerType = layerType;
|
||||
this.tag = tag;
|
||||
this.sortOrder = sortOrder;
|
||||
this.url = url;
|
||||
this.minLon = minLon;
|
||||
this.minLat = minLat;
|
||||
this.maxLon = maxLon;
|
||||
this.maxLat = maxLat;
|
||||
this.minZoom = minZoom;
|
||||
this.maxZoom = maxZoom;
|
||||
this.bboxGeometry = bboxGeometry;
|
||||
|
||||
JsonNode geoJson = null;
|
||||
|
||||
if (bboxGeometry != null) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
try {
|
||||
geoJson = mapper.readTree(bboxGeometry);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
this.bbox = geoJson;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.kamco.cd.kamcoback.common.enums.LayerType;
|
||||
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto;
|
||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto.Basic;
|
||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto.LayerMapDto;
|
||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto.OrderReq;
|
||||
import com.kamco.cd.kamcoback.layer.dto.WmsDto.WmsAddDto;
|
||||
import com.kamco.cd.kamcoback.layer.dto.WmsDto.WmsAddReqDto;
|
||||
@@ -159,4 +160,8 @@ public class LayerService {
|
||||
addDto.setTag(dto.getTag());
|
||||
return mapLayerCoreService.saveWms(addDto);
|
||||
}
|
||||
|
||||
public List<LayerMapDto> findLayerMapList(String type) {
|
||||
return mapLayerCoreService.findLayerMapList(type);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user