레이어 관리 api 추가
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
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 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;
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "레이어 관리", description = "레이어 관리 API")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/layer")
|
||||
public class LayerApiController {
|
||||
|
||||
private final WmtsService wmtsService;
|
||||
|
||||
@Operation(summary = "wmts tile 조회", description = "wmts tile 조회 api")
|
||||
@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("/wmts/tile")
|
||||
public ApiResponseDto<List<String>> getWmtsTile() {
|
||||
return ApiResponseDto.ok(wmtsService.getTile());
|
||||
}
|
||||
|
||||
@Operation(summary = "wmts tile 상세 조회", description = "wmts tile 상세 조회 api")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "검색 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = WmtsLayerInfo.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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user