레이어명 추가

This commit is contained in:
2026-02-06 15:59:56 +09:00
parent 57a2ec8367
commit 4e3e2a0181
7 changed files with 33 additions and 19 deletions

View File

@@ -31,6 +31,9 @@ public class LayerDto {
@Schema(description = "uuid") @Schema(description = "uuid")
private UUID uuid; private UUID uuid;
@Schema(description = "레이어명")
private String layerName;
@Schema(example = "WMTS", description = "유형 (TILE/GEOJSON/WMTS/WMS)") @Schema(example = "WMTS", description = "유형 (TILE/GEOJSON/WMTS/WMS)")
private String layerType; private String layerType;
@@ -63,6 +66,9 @@ public class LayerDto {
@Schema(description = "uuid") @Schema(description = "uuid")
private UUID uuid; private UUID uuid;
@Schema(description = "레이어명")
private String layerName;
@Schema(description = "유형 (TILE/GEOJSON/WMTS/WMS)") @Schema(description = "유형 (TILE/GEOJSON/WMTS/WMS)")
private String layerType; private String layerType;
@@ -119,6 +125,9 @@ public class LayerDto {
@Schema(name = "LayerAddReq") @Schema(name = "LayerAddReq")
public static class AddReq { public static class AddReq {
@Schema(description = "레이어명")
private String layerName;
@Schema(description = "title WMS, WMTS 선택한 tile") @Schema(description = "title WMS, WMTS 선택한 tile")
private String title; private String title;
@@ -215,6 +224,9 @@ public class LayerDto {
@Schema(name = "LayerMapDto") @Schema(name = "LayerMapDto")
public static class LayerMapDto { public static class LayerMapDto {
@Schema(description = "레이어명")
private String layerName;
@Schema(example = "WMTS", description = "유형 (TILE/GEOJSON/WMTS/WMS)") @Schema(example = "WMTS", description = "유형 (TILE/GEOJSON/WMTS/WMS)")
private String layerType; private String layerType;
@@ -268,6 +280,7 @@ public class LayerDto {
private String crs; private String crs;
public LayerMapDto( public LayerMapDto(
String layerName,
String layerType, String layerType,
String tag, String tag,
Long sortOrder, Long sortOrder,
@@ -282,6 +295,7 @@ public class LayerDto {
UUID uuid, UUID uuid,
String rawJsonString, String rawJsonString,
String crs) { String crs) {
this.layerName = layerName;
this.layerType = layerType; this.layerType = layerType;
this.tag = tag; this.tag = tag;
this.sortOrder = sortOrder; this.sortOrder = sortOrder;

View File

@@ -26,5 +26,6 @@ public class WmsDto {
private String title; private String title;
private String description; private String description;
private String tag; private String tag;
private String layerName;
} }
} }

View File

@@ -26,5 +26,6 @@ public class WmtsDto {
private String title; private String title;
private String description; private String description;
private String tag; private String tag;
private String layerName;
} }
} }

View File

@@ -9,7 +9,6 @@ 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.OrderReq;
import com.kamco.cd.kamcoback.layer.dto.LayerDto.TileUrlDto; import com.kamco.cd.kamcoback.layer.dto.LayerDto.TileUrlDto;
import com.kamco.cd.kamcoback.layer.dto.WmsDto.WmsAddDto; import com.kamco.cd.kamcoback.layer.dto.WmsDto.WmsAddDto;
import com.kamco.cd.kamcoback.layer.dto.WmsDto.WmsAddReqDto;
import com.kamco.cd.kamcoback.layer.dto.WmsLayerInfo; import com.kamco.cd.kamcoback.layer.dto.WmsLayerInfo;
import com.kamco.cd.kamcoback.layer.dto.WmtsDto.WmtsAddDto; import com.kamco.cd.kamcoback.layer.dto.WmtsDto.WmtsAddDto;
import com.kamco.cd.kamcoback.layer.dto.WmtsLayerInfo; import com.kamco.cd.kamcoback.layer.dto.WmtsLayerInfo;
@@ -79,6 +78,7 @@ public class LayerService {
addDto.setDescription(dto.getDescription()); addDto.setDescription(dto.getDescription());
addDto.setTitle(dto.getTitle()); addDto.setTitle(dto.getTitle());
addDto.setTag(dto.getTag()); addDto.setTag(dto.getTag());
addDto.setLayerName(dto.getLayerName());
return mapLayerCoreService.saveWmts(addDto); return mapLayerCoreService.saveWmts(addDto);
} }
@@ -89,6 +89,7 @@ public class LayerService {
addDto.setDescription(dto.getDescription()); addDto.setDescription(dto.getDescription());
addDto.setTitle(dto.getTitle()); addDto.setTitle(dto.getTitle());
addDto.setTag(dto.getTag()); addDto.setTag(dto.getTag());
addDto.setLayerName(dto.getLayerName());
return mapLayerCoreService.saveWms(addDto); return mapLayerCoreService.saveWms(addDto);
} }
@@ -165,24 +166,6 @@ public class LayerService {
return wmsService.getTile(); return wmsService.getTile();
} }
/**
* wms 저장
*
* @param dto
* @return
*/
@Transactional
public UUID saveWms(WmsAddReqDto dto) {
// 선택한 tile 상세정보 조회
WmsLayerInfo info = wmsService.getDetail(dto.getTitle());
WmsAddDto addDto = new WmsAddDto();
addDto.setWmsLayerInfo(info);
addDto.setDescription(dto.getDescription());
addDto.setTitle(dto.getTitle());
addDto.setTag(dto.getTag());
return mapLayerCoreService.saveWms(addDto);
}
public List<LayerMapDto> findLayerMapList(String type) { public List<LayerMapDto> findLayerMapList(String type) {
List<LayerMapDto> layerMapDtoList = mapLayerCoreService.findLayerMapList(type); List<LayerMapDto> layerMapDtoList = mapLayerCoreService.findLayerMapList(type);
layerMapDtoList.forEach( layerMapDtoList.forEach(

View File

@@ -87,6 +87,10 @@ public class MapLayerCoreService {
entity.setDescription(dto.getDescription()); entity.setDescription(dto.getDescription());
} }
if (dto.getLayerName() != null) {
entity.setLayerName(dto.getLayerName());
}
if (dto.getUrl() != null) { if (dto.getUrl() != null) {
entity.setUrl(dto.getUrl()); entity.setUrl(dto.getUrl());
} }
@@ -213,6 +217,7 @@ public class MapLayerCoreService {
Long order = mapLayerRepository.findSortOrderDesc(); Long order = mapLayerRepository.findSortOrderDesc();
MapLayerEntity mapLayerEntity = new MapLayerEntity(); MapLayerEntity mapLayerEntity = new MapLayerEntity();
mapLayerEntity.setLayerName(dto.getLayerName());
mapLayerEntity.setDescription(dto.getDescription()); mapLayerEntity.setDescription(dto.getDescription());
mapLayerEntity.setUrl(dto.getUrl()); mapLayerEntity.setUrl(dto.getUrl());
mapLayerEntity.setTag(dto.getTag()); mapLayerEntity.setTag(dto.getTag());
@@ -243,6 +248,7 @@ public class MapLayerCoreService {
Long order = mapLayerRepository.findSortOrderDesc(); Long order = mapLayerRepository.findSortOrderDesc();
MapLayerEntity mapLayerEntity = new MapLayerEntity(); MapLayerEntity mapLayerEntity = new MapLayerEntity();
mapLayerEntity.setLayerName(addDto.getLayerName());
mapLayerEntity.setDescription(addDto.getDescription()); mapLayerEntity.setDescription(addDto.getDescription());
mapLayerEntity.setUrl(addDto.getUrl()); mapLayerEntity.setUrl(addDto.getUrl());
mapLayerEntity.setTag(addDto.getTag()); mapLayerEntity.setTag(addDto.getTag());
@@ -273,6 +279,7 @@ public class MapLayerCoreService {
} }
MapLayerEntity mapLayerEntity = new MapLayerEntity(); MapLayerEntity mapLayerEntity = new MapLayerEntity();
mapLayerEntity.setLayerName(addDto.getLayerName());
mapLayerEntity.setTitle(addDto.getTitle()); mapLayerEntity.setTitle(addDto.getTitle());
mapLayerEntity.setDescription(addDto.getDescription()); mapLayerEntity.setDescription(addDto.getDescription());
mapLayerEntity.setCreatedUid(userUtil.getId()); mapLayerEntity.setCreatedUid(userUtil.getId());
@@ -305,6 +312,7 @@ public class MapLayerCoreService {
} }
MapLayerEntity mapLayerEntity = new MapLayerEntity(); MapLayerEntity mapLayerEntity = new MapLayerEntity();
mapLayerEntity.setLayerName(addDto.getLayerName());
mapLayerEntity.setTitle(addDto.getTitle()); mapLayerEntity.setTitle(addDto.getTitle());
mapLayerEntity.setDescription(addDto.getDescription()); mapLayerEntity.setDescription(addDto.getDescription());
mapLayerEntity.setCreatedUid(userUtil.getId()); mapLayerEntity.setCreatedUid(userUtil.getId());

View File

@@ -43,6 +43,10 @@ public class MapLayerEntity {
@Column(name = "title", length = 200) @Column(name = "title", length = 200)
private String title; private String title;
@Size(max = 255)
@Column(name = "layer_name")
private String layerName;
@Column(name = "description", length = Integer.MAX_VALUE) @Column(name = "description", length = Integer.MAX_VALUE)
private String description; private String description;
@@ -109,6 +113,7 @@ public class MapLayerEntity {
public LayerDto.Detail toDto() { public LayerDto.Detail toDto() {
return new LayerDto.Detail( return new LayerDto.Detail(
this.uuid, this.uuid,
this.layerName,
this.layerType, this.layerType,
this.title, this.title,
this.description, this.description,

View File

@@ -58,6 +58,7 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
Projections.constructor( Projections.constructor(
LayerDto.Basic.class, LayerDto.Basic.class,
mapLayerEntity.uuid, mapLayerEntity.uuid,
mapLayerEntity.layerName,
mapLayerEntity.layerType, mapLayerEntity.layerType,
mapLayerEntity.description, mapLayerEntity.description,
mapLayerEntity.tag, mapLayerEntity.tag,
@@ -102,6 +103,7 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
.select( .select(
Projections.constructor( Projections.constructor(
LayerMapDto.class, LayerMapDto.class,
mapLayerEntity.layerName,
mapLayerEntity.layerType, mapLayerEntity.layerType,
mapLayerEntity.tag, mapLayerEntity.tag,
mapLayerEntity.order, mapLayerEntity.order,