추론실행 수정

This commit is contained in:
2026-01-29 10:27:08 +09:00
parent 0f8261b20b
commit f793042927
20 changed files with 1378 additions and 101 deletions

View File

@@ -1,11 +1,11 @@
package com.kamco.cd.kamcoback.layer;
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
import com.kamco.cd.kamcoback.layer.dto.WmtsDto.WmtsAddReqDto;
import com.kamco.cd.kamcoback.layer.dto.WmtsLayerInfo;
import com.kamco.cd.kamcoback.layer.service.WmtsService;
import com.kamco.cd.kamcoback.layer.dto.LayerDto;
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;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -13,11 +13,16 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "레이어 관리", description = "레이어 관리 API")
@@ -26,7 +31,126 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/layer")
public class LayerApiController {
private final WmtsService wmtsService;
private final LayerService layerService;
@Operation(summary = "지도 레이어 관리 목록", description = "지도 레이어 관리 목록 api")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "검색 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = LayerDto.Basic.class))),
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@GetMapping("/list")
public ApiResponseDto<List<LayerDto.Basic>> getLayers(
@RequestParam(required = false) String tag) {
LayerDto.SearchReq searchReq = new SearchReq();
searchReq.setTag(tag);
List<LayerDto.Basic> layers = layerService.getLayers(searchReq);
return ApiResponseDto.ok(layers);
}
/**
* 레이어 등록
*
* @param layerType
* @param dto
* @return
*/
@Operation(summary = "레이어 등록", description = "레이어 등록 api")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "201",
description = "등록 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = UUID.class))),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PostMapping("/save/{layerType}")
public ApiResponseDto<UUID> save(
@PathVariable String layerType, @RequestBody LayerDto.AddReq dto) {
return ApiResponseDto.ok(layerService.saveLayers(layerType, dto));
}
@PutMapping("/order")
public ApiResponseDto<Void> updateOrder(@RequestBody List<OrderReq> dto) {
layerService.orderUpdate(dto);
return ApiResponseDto.ok(null);
}
@Operation(summary = "상세 조회", description = "상세 조회 api")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "검색 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = LayerDto.Detail.class))),
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@GetMapping("/detail/{uuid}")
public ApiResponseDto<LayerDto.Detail> getDetail(@PathVariable UUID uuid) {
return ApiResponseDto.ok(layerService.getDetail(uuid));
}
/**
* 레이어 삭제
*
* @param uuid
* @return
*/
@Operation(summary = "레이어 삭제", description = "레이어 삭제 api")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "201",
description = "삭제 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Void.class))),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@DeleteMapping("/delete/{uuid}")
public ApiResponseDto<Void> delete(@PathVariable UUID uuid) {
layerService.delete(uuid);
return ApiResponseDto.ok(null);
}
/**
* 레이어 수정
*
* @param uuid
* @return
*/
@Operation(summary = "레이어 수정", description = "레이어 수정 api")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "201",
description = "수정 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Void.class))),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PutMapping("/update/{uuid}")
public ApiResponseDto<Void> update(@PathVariable UUID uuid, @RequestBody LayerDto.Detail dto) {
layerService.update(uuid, dto);
return ApiResponseDto.ok(null);
}
@Operation(summary = "wmts tile 조회", description = "wmts tile 조회 api")
@ApiResponses(
@@ -43,10 +167,10 @@ public class LayerApiController {
})
@GetMapping("/wmts/tile")
public ApiResponseDto<List<String>> getWmtsTile() {
return ApiResponseDto.ok(wmtsService.getTile());
return ApiResponseDto.ok(layerService.getWmtsTile());
}
@Operation(summary = "wmts tile 상세 조회", description = "wmts tile 상세 조회 api")
@Operation(summary = "wms tile 조회", description = "wms tile 조회 api")
@ApiResponses(
value = {
@ApiResponse(
@@ -55,16 +179,12 @@ public class LayerApiController {
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = WmtsLayerInfo.class))),
array = @ArraySchema(schema = @Schema(implementation = String.class)))),
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PostMapping("/wmts")
public ApiResponseDto<Void> getWmtsTileDetail(
@Parameter(description = "선택한 tile", example = "959022EFCAA448D1A325FA7B8ABEA10D")
@RequestBody
WmtsAddReqDto dto) {
wmtsService.save(dto);
return ApiResponseDto.ok(null);
@GetMapping("/wms/tile")
public ApiResponseDto<List<String>> getWmsTile() {
return ApiResponseDto.ok(layerService.getWmsTitle());
}
}