변화탐지 API 커밋 cog,count,yearlist
This commit is contained in:
@@ -5,13 +5,14 @@ import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto;
|
||||
import com.kamco.cd.kamcoback.changedetection.service.ChangeDetectionService;
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.transaction.Transactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "변화탐지", description = "변화탐지 API")
|
||||
@@ -34,8 +35,32 @@ public class ChangeDetectionApiController {
|
||||
* PolygonData -> JsonNode 변환 예제
|
||||
* @return
|
||||
*/
|
||||
@Hidden
|
||||
@GetMapping("/json-data")
|
||||
public ApiResponseDto<List<JsonNode>> getPolygonToJson(){
|
||||
return ApiResponseDto.ok(changeDetectionService.getPolygonToJson());
|
||||
}
|
||||
|
||||
@Operation(summary = "변화탐지 분류별 건수", description = "변화탐지 분류별 건수")
|
||||
@GetMapping("/class-count/{id}")
|
||||
public ApiResponseDto<List<ChangeDetectionDto.CountDto>> getChangeDetectionClassCount(
|
||||
@Parameter(description = "변화탐지 년도(차수) /year-list 의 analUid", example = "1") @PathVariable Long id){
|
||||
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionClassCount(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "변화탐지 COG Url", description = "변화탐지 COG Url")
|
||||
@GetMapping("/cog-url")
|
||||
public ApiResponseDto<ChangeDetectionDto.CogUrlDto> getChangeDetectionCogUrl(
|
||||
@Parameter(description = "이전 년도", example = "2023") @RequestParam Integer beforeYear,
|
||||
@Parameter(description = "이후 년도", example = "2024") @RequestParam Integer afterYear,
|
||||
@Parameter(description = "도엽번호(5k)", example = "36809010") @RequestParam String mapSheetNum){
|
||||
ChangeDetectionDto.CogUrlReq req = new ChangeDetectionDto.CogUrlReq(beforeYear, afterYear, mapSheetNum);
|
||||
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionCogUrl(req));
|
||||
}
|
||||
|
||||
@Operation(summary = "변화탐지 년도(차수) 목록", description = "변화탐지 년도(차수) 목록")
|
||||
@GetMapping("/year-list")
|
||||
public ApiResponseDto<List<ChangeDetectionDto.AnalYearList>> getChangeDetectionYearList(){
|
||||
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionYearList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.kamco.cd.kamcoback.changedetection.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -21,6 +22,52 @@ public class ChangeDetectionDto{
|
||||
private Double centroidY;
|
||||
}
|
||||
|
||||
@Schema(name = "CountDto", description = "분류별 탐지 건수")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class CountDto {
|
||||
private String classCd; //영문코드
|
||||
private String className; //한글명
|
||||
private Long count; //건수
|
||||
}
|
||||
|
||||
@Schema(name = "CogUrlReq", description = "COG Url Req")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class CogUrlReq {
|
||||
private Integer beforeYear;
|
||||
private Integer afterYear;
|
||||
private String mapSheetNum;
|
||||
}
|
||||
|
||||
@Schema(name = "CogUrlDto", description = "COG Url 정보")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class CogUrlDto {
|
||||
private String beforeCogUrl;
|
||||
private String afterCogUrl;
|
||||
private JsonNode bbox;
|
||||
}
|
||||
|
||||
@Schema(name = "AnalYearList", description = "년도(차수) 목록")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class AnalYearList {
|
||||
private Long analUid;
|
||||
private String analTitle;
|
||||
private Integer beforeYear;
|
||||
private Integer afterYear;
|
||||
private String baseMapSheetNum;
|
||||
}
|
||||
|
||||
@Schema(name = "PolygonGeometry", description = "폴리곤 리턴 객체")
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -47,16 +94,6 @@ public class ChangeDetectionDto{
|
||||
private Double center_longitude; //폴리곤 중심 경도
|
||||
}
|
||||
|
||||
@Schema(name = "CogURL", description = "COG URL")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class CogURL{
|
||||
private String before_cog_url; //기준 COG URL
|
||||
private String after_cog_url; //비교 COG URL
|
||||
}
|
||||
|
||||
@Schema(name = "PolygonProperties", description = "폴리곤 정보")
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
@@ -20,4 +20,16 @@ public class ChangeDetectionService {
|
||||
public List<JsonNode> getPolygonToJson(){
|
||||
return changeDetectionCoreService.getPolygonToJson();
|
||||
}
|
||||
|
||||
public List<ChangeDetectionDto.CountDto> getChangeDetectionClassCount(Long id) {
|
||||
return changeDetectionCoreService.getChangeDetectionClassCount(id);
|
||||
}
|
||||
|
||||
public ChangeDetectionDto.CogUrlDto getChangeDetectionCogUrl(ChangeDetectionDto.CogUrlReq req) {
|
||||
return changeDetectionCoreService.getChangeDetectionCogUrl(req);
|
||||
}
|
||||
|
||||
public List<ChangeDetectionDto.AnalYearList> getChangeDetectionYearList() {
|
||||
return changeDetectionCoreService.getChangeDetectionYearList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user