Rviewer add

This commit is contained in:
DanielLee
2026-01-14 09:42:08 +09:00
parent 56e7866d4f
commit b918ad14c4
16 changed files with 13017 additions and 8 deletions

View File

@@ -182,4 +182,163 @@ public class TrainingDataLabelApiController {
return ApiResponseDto.ok(
trainingDataLabelService.getDefaultPagingNumber(userId, size, assignmentUid));
}
@Operation(
summary = "새로운 polygon(들) 추가 저장",
description = "탐지결과 외 새로운 polygon을 추가로 저장합니다. 단일 또는 여러 개를 저장할 수 있습니다.")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "저장 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseObj.class))),
@ApiResponse(responseCode = "400", description = "잘못된 요청", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PostMapping("/new-polygon")
public ApiResponseDto<ResponseObj> saveNewPolygon(
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "새로운 polygon 저장 요청",
required = true,
content =
@Content(
mediaType = "application/json",
schema =
@Schema(implementation = TrainingDataLabelDto.NewPolygonRequest.class),
examples = {
@io.swagger.v3.oas.annotations.media.ExampleObject(
name = "1개 polygon 저장",
value =
"""
{
"assignmentUid": "4f9ebc8b-6635-4177-b42f-7efc9c7b4c02",
"analUid": 53,
"mapSheetNum": "35905086",
"compareYyyy": 2023,
"targetYyyy": 2024,
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[126.663, 34.588],
[126.662, 34.587],
[126.664, 34.589],
[126.663, 34.588]
]
]
},
"properties": {
"beforeClass": "WASTE",
"afterClass": "LAND"
}
}
]
}
"""),
@io.swagger.v3.oas.annotations.media.ExampleObject(
name = "3개 polygon 저장",
value =
"""
{
"assignmentUid": "4f9ebc8b-6635-4177-b42f-7efc9c7b4c02",
"analUid": 53,
"mapSheetNum": "35905086",
"compareYyyy": 2023,
"targetYyyy": 2024,
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[126.663, 34.588],
[126.662, 34.587],
[126.664, 34.589],
[126.663, 34.588]
]
]
},
"properties": {
"beforeClass": "WASTE",
"afterClass": "LAND"
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[126.665, 34.590],
[126.664, 34.589],
[126.666, 34.591],
[126.665, 34.590]
]
]
},
"properties": {
"beforeClass": "FOREST",
"afterClass": "BUILDING"
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[126.667, 34.592],
[126.666, 34.591],
[126.668, 34.593],
[126.667, 34.592]
]
]
},
"properties": {
"beforeClass": "FARMLAND",
"afterClass": "SOLAR_PANEL"
}
}
]
}
""")
}))
@RequestBody
TrainingDataLabelDto.NewPolygonRequest request) {
return ApiResponseDto.okObject(trainingDataLabelService.saveNewPolygon(request));
}
@Operation(summary = "COG 이미지 URL 조회", description = "변화 전/후 COG 이미지 URL을 함께 조회합니다")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "조회 성공",
content =
@Content(
mediaType = "application/json",
schema =
@Schema(implementation = TrainingDataLabelDto.CogImageResponse.class))),
@ApiResponse(responseCode = "404", description = "이미지를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@GetMapping("/cog-image")
public ApiResponseDto<TrainingDataLabelDto.CogImageResponse> getCogImageUrl(
@Parameter(description = "도엽번호", required = true, example = "35905086") @RequestParam
String mapSheetNum,
@Parameter(description = "변화 전 년도", required = true, example = "2023") @RequestParam
Integer beforeYear,
@Parameter(description = "변화 후 년도", required = true, example = "2024") @RequestParam
Integer afterYear) {
return ApiResponseDto.ok(
trainingDataLabelService.getCogImageUrl(mapSheetNum, beforeYear, afterYear));
}
}