shp 수동등록 반영
This commit is contained in:
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.inference;
|
|||||||
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto;
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto.CreateShpRequest;
|
||||||
import com.kamco.cd.kamcoback.inference.service.InferenceResultShpService;
|
import com.kamco.cd.kamcoback.inference.service.InferenceResultShpService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
@@ -12,8 +13,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@Tag(name = "추론결과 데이터 생성", description = "추론결과 데이터 생성 API")
|
@Tag(name = "추론결과 데이터 생성", description = "추론결과 데이터 생성 API")
|
||||||
@@ -47,11 +48,8 @@ public class InferenceResultShpApiController {
|
|||||||
@Operation(summary = "추론결과 shp 생성", description = "추론결과 shp 생성")
|
@Operation(summary = "추론결과 shp 생성", description = "추론결과 shp 생성")
|
||||||
@PostMapping("/shp/{uid}")
|
@PostMapping("/shp/{uid}")
|
||||||
public ApiResponseDto<Void> createShp(
|
public ApiResponseDto<Void> createShp(
|
||||||
@PathVariable String uid,
|
@PathVariable String uid, @RequestBody CreateShpRequest req) {
|
||||||
@RequestParam Long m1BatchId,
|
inferenceResultShpService.createShp(uid, req);
|
||||||
@RequestParam Long m2BatchId,
|
|
||||||
@RequestParam Long m3BatchId) {
|
|
||||||
inferenceResultShpService.createShp(uid, m1BatchId, m2BatchId, m3BatchId);
|
|
||||||
return ApiResponseDto.createOK(null);
|
return ApiResponseDto.createOK(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,4 +102,12 @@ public class InferenceResultShpDto {
|
|||||||
@Schema(description = "geojson 파일 생성 수 (덮어쓰기 포함)", example = "120")
|
@Schema(description = "geojson 파일 생성 수 (덮어쓰기 포함)", example = "120")
|
||||||
private int geojson;
|
private int geojson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public static class CreateShpRequest {
|
||||||
|
|
||||||
|
private Long m1BatchId;
|
||||||
|
private Long m2BatchId;
|
||||||
|
private Long m3BatchId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.kamco.cd.kamcoback.inference.service;
|
package com.kamco.cd.kamcoback.inference.service;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto;
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto.CreateShpRequest;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultsTestingDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultsTestingDto;
|
||||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultShpCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.InferenceResultShpCoreService;
|
||||||
@@ -36,11 +37,17 @@ public class InferenceResultShpService {
|
|||||||
return coreService.buildInferenceData(id);
|
return coreService.buildInferenceData(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createShp(String uid, Long m1BatchId, Long m2BatchId, Long m3BatchId) {
|
/**
|
||||||
|
* shp 파일 수동생성
|
||||||
|
*
|
||||||
|
* @param uid
|
||||||
|
* @param req
|
||||||
|
*/
|
||||||
|
public void createShp(String uid, CreateShpRequest req) {
|
||||||
List<Long> batchIds = new ArrayList<>();
|
List<Long> batchIds = new ArrayList<>();
|
||||||
batchIds.add(m1BatchId);
|
batchIds.add(req.getM1BatchId());
|
||||||
batchIds.add(m2BatchId);
|
batchIds.add(req.getM2BatchId());
|
||||||
batchIds.add(m3BatchId);
|
batchIds.add(req.getM3BatchId());
|
||||||
|
|
||||||
List<InferenceResultsTestingDto.ShpDto> resultList =
|
List<InferenceResultsTestingDto.ShpDto> resultList =
|
||||||
inferenceResultCoreService.getInferenceResults(batchIds);
|
inferenceResultCoreService.getInferenceResults(batchIds);
|
||||||
@@ -58,7 +65,7 @@ public class InferenceResultShpService {
|
|||||||
}
|
}
|
||||||
inferenceId = uid;
|
inferenceId = uid;
|
||||||
String mapIds = sb.toString();
|
String mapIds = sb.toString();
|
||||||
String batchId = m1BatchId + "," + m2BatchId + "," + m3BatchId;
|
String batchId = req.getM1BatchId() + "," + req.getM2BatchId() + "," + req.getM3BatchId();
|
||||||
|
|
||||||
// shp 파일 비동기 생성
|
// shp 파일 비동기 생성
|
||||||
shpPipelineService.runPipeline(jarPath, datasetDir, batchId, inferenceId, mapIds);
|
shpPipelineService.runPipeline(jarPath, datasetDir, batchId, inferenceId, mapIds);
|
||||||
|
|||||||
Reference in New Issue
Block a user