[KC-168] 라벨링 툴 - 목록, 상세 API 나누기
This commit is contained in:
@@ -3,6 +3,7 @@ package com.kamco.cd.kamcoback.trainingdata;
|
||||
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto;
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto;
|
||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto.LabelingGeometryInfo;
|
||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto.LabelingListDto;
|
||||
import com.kamco.cd.kamcoback.trainingdata.service.TrainingDataLabelService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -49,4 +50,23 @@ public class TrainingDataLabelApiController {
|
||||
return ApiResponseDto.ok(
|
||||
trainingDataLabelService.findLabelingAssignedList(searchReq, userId, status));
|
||||
}
|
||||
|
||||
@Operation(summary = "상세 Geometry 조회", description = "라벨 할당 상세 Geometry 조회")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "조회 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = CommonCodeDto.Basic.class))),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/geom-info")
|
||||
public ApiResponseDto<LabelingGeometryInfo> findLabelingAssignedGeom(
|
||||
@RequestParam(defaultValue = "4f9ebc8b-6635-4177-b42f-7efc9c7b4c02") String assignmentUid) {
|
||||
return ApiResponseDto.ok(trainingDataLabelService.findLabelingAssignedGeom(assignmentUid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,10 +29,15 @@ public class TrainingDataLabelDto {
|
||||
private String mapSheetNum;
|
||||
private String mapIdNm;
|
||||
private Long pnu;
|
||||
@JsonIgnore private String geom_data; // json string
|
||||
private JsonNode geom;
|
||||
private String beforeCogUrl;
|
||||
private String afterCogUrl;
|
||||
|
||||
// @JsonIgnore
|
||||
// private String geomData; // json string
|
||||
// private JsonNode geom;
|
||||
// private String beforeCogUrl;
|
||||
// private String afterCogUrl;
|
||||
// @JsonIgnore
|
||||
// private String mapBboxString; //json string
|
||||
// private JsonNode mapBbox;
|
||||
|
||||
public LabelingListDto(
|
||||
UUID assignmentUid,
|
||||
@@ -41,10 +46,7 @@ public class TrainingDataLabelDto {
|
||||
String workState,
|
||||
String mapSheetNum,
|
||||
String mapIdNm,
|
||||
Long pnu,
|
||||
String geom_data,
|
||||
String beforeCogUrl,
|
||||
String afterCogUrl) {
|
||||
Long pnu) {
|
||||
this.assignmentUid = assignmentUid;
|
||||
this.inferenceGeomUid = inferenceGeomUid;
|
||||
this.workerUid = workerUid;
|
||||
@@ -52,18 +54,48 @@ public class TrainingDataLabelDto {
|
||||
this.mapSheetNum = mapSheetNum;
|
||||
this.mapIdNm = mapIdNm;
|
||||
this.pnu = pnu;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "LabelingGeometryInfo", description = "LabelingGeometryInfo")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public static class LabelingGeometryInfo {
|
||||
|
||||
private UUID assignmentUid;
|
||||
private Long inferenceGeomUid;
|
||||
@JsonIgnore private String geomData; // json string
|
||||
private JsonNode geom;
|
||||
private String beforeCogUrl;
|
||||
private String afterCogUrl;
|
||||
@JsonIgnore private String mapBboxString; // json string
|
||||
private JsonNode mapBbox;
|
||||
|
||||
public LabelingGeometryInfo(
|
||||
UUID assignmentUid,
|
||||
Long inferenceGeomUid,
|
||||
String geomData,
|
||||
String beforeCogUrl,
|
||||
String afterCogUrl,
|
||||
String mapBboxString) {
|
||||
this.assignmentUid = assignmentUid;
|
||||
this.inferenceGeomUid = inferenceGeomUid;
|
||||
this.beforeCogUrl = beforeCogUrl;
|
||||
this.afterCogUrl = afterCogUrl;
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode geomJson;
|
||||
JsonNode mapBboxJson;
|
||||
try {
|
||||
geomJson = mapper.readTree(geom_data);
|
||||
geomJson = mapper.readTree(geomData);
|
||||
mapBboxJson = mapper.readTree(mapBboxString);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
this.geom = geomJson;
|
||||
|
||||
this.beforeCogUrl = beforeCogUrl;
|
||||
this.afterCogUrl = afterCogUrl;
|
||||
this.geom = geomJson;
|
||||
this.mapBbox = mapBboxJson;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kamco.cd.kamcoback.trainingdata.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.core.TrainingDataLabelCoreService;
|
||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto.LabelingGeometryInfo;
|
||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto.LabelingListDto;
|
||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataLabelDto.searchReq;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -19,4 +20,8 @@ public class TrainingDataLabelService {
|
||||
searchReq searchReq, String userId, String status) {
|
||||
return trainingDataLabelCoreService.findLabelingAssignedList(searchReq, userId, status);
|
||||
}
|
||||
|
||||
public LabelingGeometryInfo findLabelingAssignedGeom(String assignmentUid) {
|
||||
return trainingDataLabelCoreService.findLabelingAssignedGeom(assignmentUid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user