This commit is contained in:
2026-03-12 08:08:59 +09:00
parent 413afb0b7c
commit c9a1007c21
6 changed files with 37 additions and 48 deletions

View File

@@ -16,18 +16,17 @@ import org.springframework.stereotype.Component;
// 0312 // 0312
@RequiredArgsConstructor @RequiredArgsConstructor
@Component @Component
public class ExternalJarRunner { public class ExternalJarRunner {
@Value("${spring.profiles.active}") @Value("${spring.profiles.active}")
private String profile; private String profile;
// 0312 // 0312
private final InferenceProperties inferenceProperties; private final InferenceProperties inferenceProperties;
private static final long TIMEOUT_MINUTES = TimeUnit.DAYS.toMinutes(3); private static final long TIMEOUT_MINUTES = TimeUnit.DAYS.toMinutes(3);
// java -jar build/libs/shp-exporter.jar --batch --geoserver.enabled=true
// --converter.inference-id=qq99999 --converter.batch-ids[0]=111
// java -jar build/libs/shp-exporter.jar --batch --geoserver.enabled=true --converter.inference-id=qq99999 --converter.batch-ids[0]=111
// 0312 shp 파일 배치를 통해 생성 // 0312 shp 파일 배치를 통해 생성
public void run(String inferenceLearningId, List<Long> batchIds) { public void run(String inferenceLearningId, List<Long> batchIds) {
// JAR 경로 (shape파일 생성용) // JAR 경로 (shape파일 생성용)
@@ -41,7 +40,6 @@ public class ExternalJarRunner {
execJar(jarPathV2, args); execJar(jarPathV2, args);
} }
/** /**
* shp 파일 생성 * shp 파일 생성
* *
@@ -160,4 +158,3 @@ public class ExternalJarRunner {
return v; return v;
} }
} }

View File

@@ -48,9 +48,7 @@ public class SecurityConfig {
auth auth
// .requestMatchers("/chunk_upload_test.html").authenticated() // .requestMatchers("/chunk_upload_test.html").authenticated()
.requestMatchers("/monitor/health" .requestMatchers("/monitor/health", "/monitor/health/**")
, "/monitor/health/**"
)
.permitAll() .permitAll()
// 맵시트 영역 전체 허용 (우선순위 최상단) // 맵시트 영역 전체 허용 (우선순위 최상단)
@@ -119,8 +117,7 @@ public class SecurityConfig {
"/api/user/**", "/api/user/**",
"/api/my/menus", "/api/my/menus",
"/api/training-data/label/**", "/api/training-data/label/**",
"/api/training-data/review/**" "/api/training-data/review/**")
)
.authenticated() .authenticated()
// 나머지는 메뉴권한 // 나머지는 메뉴권한

View File

@@ -3,7 +3,6 @@ package com.kamco.cd.kamcoback.scheduler.service;
import com.kamco.cd.kamcoback.common.service.ExternalJarRunner; import com.kamco.cd.kamcoback.common.service.ExternalJarRunner;
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService; import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
import com.kamco.cd.kamcoback.scheduler.config.ShpKeyLock; import com.kamco.cd.kamcoback.scheduler.config.ShpKeyLock;
import java.nio.file.Paths;
import java.util.List; import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
@@ -19,7 +18,6 @@ public class ShpPipelineService {
private final ExternalJarRunner externalJarRunner; private final ExternalJarRunner externalJarRunner;
private final ShpKeyLock shpKeyLock; private final ShpKeyLock shpKeyLock;
// 0312 shp 파일 비동기 생성 // 0312 shp 파일 비동기 생성
@Async("makeShapeFile") @Async("makeShapeFile")
public void makeShapeFile(String inferenceId, List<Long> batchIds) { public void makeShapeFile(String inferenceId, List<Long> batchIds) {
@@ -44,7 +42,6 @@ public class ShpPipelineService {
} }
} }
/** /**
* shp 파일 생성 1. merge 생성 2. 생성된 merge shp 파일로 geoserver 등록, 3.도엽별로 shp 생성 * shp 파일 생성 1. merge 생성 2. 생성된 merge shp 파일로 geoserver 등록, 3.도엽별로 shp 생성
* *

View File

@@ -2,13 +2,13 @@ package com.kamco.cd.kamcoback.test;
import com.kamco.cd.kamcoback.config.api.ApiResponseDto; import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
import com.kamco.cd.kamcoback.scheduler.service.ShpPipelineService; import com.kamco.cd.kamcoback.scheduler.service.ShpPipelineService;
import io.swagger.v3.oas.annotations.Hidden;
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;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.ErrorResponse; import org.springframework.web.ErrorResponse;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@@ -16,18 +16,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Tag(name = "test shape api", description = "test shape api") @Tag(name = "test shape api", description = "test shape api")
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/test") @RequestMapping("/api/test")
public class TestShapeApiController { public class TestShapeApiController {
private final ShpPipelineService shpPipelineService; private final ShpPipelineService shpPipelineService;
@Operation(summary = "shapefile 생성 테스트", description = "지정된 inference ID와 batch ID 목록으로 shapefile을 생성합니다.") @Operation(
summary = "shapefile 생성 테스트",
description = "지정된 inference ID와 batch ID 목록으로 shapefile을 생성합니다.")
@ApiResponses({ @ApiResponses({
@ApiResponse( @ApiResponse(
responseCode = "200", responseCode = "200",
@@ -44,8 +43,7 @@ public class TestShapeApiController {
}) })
@GetMapping("/make-shapefile") @GetMapping("/make-shapefile")
public ApiResponseDto<String> makeShapeFile( public ApiResponseDto<String> makeShapeFile(
@RequestParam String inferenceId, @RequestParam String inferenceId, @RequestParam List<Long> batchIds) {
@RequestParam List<Long> batchIds) {
shpPipelineService.makeShapeFile(inferenceId, batchIds); shpPipelineService.makeShapeFile(inferenceId, batchIds);
return ApiResponseDto.ok("Shapefile 생성이 시작되었습니다. inferenceId: " + inferenceId); return ApiResponseDto.ok("Shapefile 생성이 시작되었습니다. inferenceId: " + inferenceId);
} }