변화탐지 API 커밋 cog,count,yearlist

This commit is contained in:
2025-11-27 18:01:15 +09:00
parent 9d32c85fd0
commit 675d2f2ed1
11 changed files with 343 additions and 16 deletions

View File

@@ -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());
}
}