Compare commits
29 Commits
e69eccc82b
...
feat/infer
| Author | SHA1 | Date | |
|---|---|---|---|
| 241c7222d1 | |||
| 52da4dafc3 | |||
| 24d615174d | |||
| 12b0f0867d | |||
| 283d906da6 | |||
| 360b451c38 | |||
| 80e281cb99 | |||
| b07bc38ee8 | |||
| e4c1c76b2b | |||
| 01b64eeca7 | |||
| 516f949a37 | |||
| b6ed3b57ef | |||
| 9eebf23774 | |||
| 4f742edf8b | |||
| 0aa415cf3a | |||
| 884b635585 | |||
| 6861f6b8b6 | |||
| a97af0d4dd | |||
| 9297d19e24 | |||
| 65c38b3083 | |||
| 24dca652f0 | |||
| 193cd449a8 | |||
|
|
0efde4e5bb | ||
|
|
548d82da12 | ||
| 536ff8fc65 | |||
| 1dc1ce741e | |||
| d21ed61666 | |||
| c9a1007c21 | |||
| 413afb0b7c |
@@ -37,7 +37,6 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
// JWT 토큰을 검증하고, 인증된 사용자로 SecurityContext에 등록
|
// JWT 토큰을 검증하고, 인증된 사용자로 SecurityContext에 등록
|
||||||
if (token != null && jwtTokenProvider.isValidToken(token)) {
|
if (token != null && jwtTokenProvider.isValidToken(token)) {
|
||||||
String username = jwtTokenProvider.getSubject(token);
|
String username = jwtTokenProvider.getSubject(token);
|
||||||
|
|
||||||
UserDetails userDetails = userDetailsService.loadUserByUsername(username);
|
UserDetails userDetails = userDetailsService.loadUserByUsername(username);
|
||||||
UsernamePasswordAuthenticationToken authentication =
|
UsernamePasswordAuthenticationToken authentication =
|
||||||
new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
|
new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
|
||||||
|
|||||||
@@ -8,11 +8,13 @@ import jakarta.annotation.PostConstruct;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/** 토큰 생성 */
|
/** 토큰 생성 */
|
||||||
@Component
|
@Component
|
||||||
|
@Log4j2
|
||||||
public class JwtTokenProvider {
|
public class JwtTokenProvider {
|
||||||
|
|
||||||
@Value("${jwt.secret}")
|
@Value("${jwt.secret}")
|
||||||
@@ -34,11 +36,13 @@ public class JwtTokenProvider {
|
|||||||
|
|
||||||
// Access Token 생성
|
// Access Token 생성
|
||||||
public String createAccessToken(String subject) {
|
public String createAccessToken(String subject) {
|
||||||
|
log.info("TOKEN VALIDITY = {}", accessTokenValidityInMs);
|
||||||
return createToken(subject, accessTokenValidityInMs);
|
return createToken(subject, accessTokenValidityInMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh Token 생성
|
// Refresh Token 생성
|
||||||
public String createRefreshToken(String subject) {
|
public String createRefreshToken(String subject) {
|
||||||
|
log.info("REFRESH TOKEN VALIDITY = {}", refreshTokenValidityInMs);
|
||||||
return createToken(subject, refreshTokenValidityInMs);
|
return createToken(subject, refreshTokenValidityInMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public class MenuAuthorizationManager implements AuthorizationManager<RequestAut
|
|||||||
|
|
||||||
for (MenuEntity menu : allowedMenus) {
|
for (MenuEntity menu : allowedMenus) {
|
||||||
String baseUri = menu.getMenuUrl();
|
String baseUri = menu.getMenuUrl();
|
||||||
|
|
||||||
if (baseUri == null || baseUri.isBlank()) {
|
if (baseUri == null || baseUri.isBlank()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|
||||||
// 나머지는 메뉴권한
|
// 나머지는 메뉴권한
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
|||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||||
|
import com.kamco.cd.kamcoback.inference.service.InferenceAsyncService;
|
||||||
import com.kamco.cd.kamcoback.inference.service.InferenceResultService;
|
import com.kamco.cd.kamcoback.inference.service.InferenceResultService;
|
||||||
import com.kamco.cd.kamcoback.log.dto.AuditLogDto;
|
import com.kamco.cd.kamcoback.log.dto.AuditLogDto;
|
||||||
import com.kamco.cd.kamcoback.log.dto.AuditLogDto.DownloadReq;
|
import com.kamco.cd.kamcoback.log.dto.AuditLogDto.DownloadReq;
|
||||||
@@ -55,6 +56,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
public class InferenceResultApiController {
|
public class InferenceResultApiController {
|
||||||
|
|
||||||
private final InferenceResultService inferenceResultService;
|
private final InferenceResultService inferenceResultService;
|
||||||
|
private final InferenceAsyncService inferenceAsyncService;
|
||||||
private final MapSheetMngService mapSheetMngService;
|
private final MapSheetMngService mapSheetMngService;
|
||||||
private final ModelMngService modelMngService;
|
private final ModelMngService modelMngService;
|
||||||
private final RangeDownloadResponder rangeDownloadResponder;
|
private final RangeDownloadResponder rangeDownloadResponder;
|
||||||
@@ -176,7 +178,8 @@ public class InferenceResultApiController {
|
|||||||
})
|
})
|
||||||
@DeleteMapping("/end")
|
@DeleteMapping("/end")
|
||||||
public ApiResponseDto<UUID> getInferenceGeomList() {
|
public ApiResponseDto<UUID> getInferenceGeomList() {
|
||||||
UUID uuid = inferenceResultService.deleteInferenceEnd();
|
// UUID uuid = inferenceResultService.deleteInferenceEnd();
|
||||||
|
UUID uuid = inferenceAsyncService.asyncInferenceEnd();
|
||||||
return ApiResponseDto.ok(uuid);
|
return ApiResponseDto.ok(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public class InferenceResultDto {
|
|||||||
READY("대기"),
|
READY("대기"),
|
||||||
IN_PROGRESS("진행중"),
|
IN_PROGRESS("진행중"),
|
||||||
END("완료"),
|
END("완료"),
|
||||||
|
END_FAIL("종료실패"),
|
||||||
FORCED_END("강제종료");
|
FORCED_END("강제종료");
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
||||||
@@ -683,6 +684,7 @@ public class InferenceResultDto {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class MapSheetFallbackYearDto {
|
public static class MapSheetFallbackYearDto {
|
||||||
|
|
||||||
private String mapSheetNum;
|
private String mapSheetNum;
|
||||||
private Integer mngYyyy;
|
private Integer mngYyyy;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package com.kamco.cd.kamcoback.inference.service;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
||||||
|
import com.kamco.cd.kamcoback.common.inference.service.InferenceCommonService;
|
||||||
|
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
||||||
|
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
||||||
|
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SaveInferenceAiDto;
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Status;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.core.AuditLogCoreService;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.core.ModelMngCoreService;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/** 추론 관리 */
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public class InferenceAsyncService {
|
||||||
|
|
||||||
|
private final InferenceResultCoreService inferenceResultCoreService;
|
||||||
|
private final MapSheetMngCoreService mapSheetMngCoreService;
|
||||||
|
private final ModelMngCoreService modelMngCoreService;
|
||||||
|
private final AuditLogCoreService auditLogCoreService;
|
||||||
|
private final InferenceCommonService inferenceCommonService;
|
||||||
|
|
||||||
|
private final ExternalHttpClient externalHttpClient;
|
||||||
|
private final UserUtil userUtil;
|
||||||
|
|
||||||
|
@Value("${inference.batch-url}")
|
||||||
|
private String batchUrl;
|
||||||
|
|
||||||
|
@Value("${inference.inference-server-name}")
|
||||||
|
private String inferenceServerName;
|
||||||
|
|
||||||
|
@Value("${file.dataset-dir}")
|
||||||
|
private String datasetDir;
|
||||||
|
|
||||||
|
@Value("${spring.profiles.active}")
|
||||||
|
private String activeEnv;
|
||||||
|
|
||||||
|
@Value("${inference.geojson-dir}")
|
||||||
|
private String inferenceDir;
|
||||||
|
|
||||||
|
// 0313
|
||||||
|
@Transactional
|
||||||
|
public UUID asyncInferenceEnd() {
|
||||||
|
SaveInferenceAiDto dto = inferenceResultCoreService.getProcessing();
|
||||||
|
if (dto == null) {
|
||||||
|
throw new CustomApiException("NOT_FOUND", HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.deleteInferenceEndAsync(dto); // 비동기 종료 호출
|
||||||
|
|
||||||
|
return dto.getUuid();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 0313
|
||||||
|
@Async("inferenceEndExecutor")
|
||||||
|
@Transactional
|
||||||
|
public void deleteInferenceEndAsync(SaveInferenceAiDto dto) {
|
||||||
|
Long batchId = dto.getBatchId();
|
||||||
|
String url = batchUrl + "/" + batchId;
|
||||||
|
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
|
||||||
|
|
||||||
|
try {
|
||||||
|
log.info("[추론 종료 비동기 시작] uuid={}, batchId={}", dto.getUuid(), batchId);
|
||||||
|
|
||||||
|
ExternalCallResult<String> result =
|
||||||
|
externalHttpClient.callLong(url, HttpMethod.DELETE, dto, headers, String.class);
|
||||||
|
|
||||||
|
if (!result.success()) {
|
||||||
|
log.error("[추론 종료 실패] 외부 API 호출 실패. uuid={}, batchId={}", dto.getUuid(), batchId);
|
||||||
|
|
||||||
|
SaveInferenceAiDto failRequest = new SaveInferenceAiDto();
|
||||||
|
failRequest.setUuid(dto.getUuid());
|
||||||
|
failRequest.setStatus(Status.END_FAIL.getId()); // TODO: 종료실패 상태 추가하는 게 맞는지?
|
||||||
|
failRequest.setUpdateUid(userUtil.getId());
|
||||||
|
failRequest.setInferEndDttm(ZonedDateTime.now());
|
||||||
|
inferenceResultCoreService.update(failRequest);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveInferenceAiDto request = new SaveInferenceAiDto();
|
||||||
|
request.setStatus(Status.FORCED_END.getId());
|
||||||
|
request.setUuid(dto.getUuid());
|
||||||
|
request.setUpdateUid(userUtil.getId());
|
||||||
|
request.setInferEndDttm(ZonedDateTime.now());
|
||||||
|
inferenceResultCoreService.update(request);
|
||||||
|
|
||||||
|
Long learnId = inferenceResultCoreService.getInferenceLearnIdByUuid(dto.getUuid());
|
||||||
|
inferenceResultCoreService.upsertGeomData(learnId);
|
||||||
|
|
||||||
|
log.info("[추론 종료 비동기 완료] uuid={}, batchId={}", dto.getUuid(), batchId);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("[추론 종료 비동기 예외] uuid={}, batchId={}", dto.getUuid(), batchId, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -157,6 +157,7 @@ public class LabelAllocateService {
|
|||||||
return labelAllocateCoreService.findInferenceDetail(uuid);
|
return labelAllocateCoreService.findInferenceDetail(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public ApiResponseDto.ResponseObj allocateMove(
|
public ApiResponseDto.ResponseObj allocateMove(
|
||||||
Integer totalCnt, String uuid, List<String> targetUsers, String userId) {
|
Integer totalCnt, String uuid, List<String> targetUsers, String userId) {
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ public class AuthController {
|
|||||||
if (refreshToken == null || !jwtTokenProvider.isValidToken(refreshToken)) {
|
if (refreshToken == null || !jwtTokenProvider.isValidToken(refreshToken)) {
|
||||||
throw new AccessDeniedException("만료되었거나 유효하지 않은 리프레시 토큰 입니다.");
|
throw new AccessDeniedException("만료되었거나 유효하지 않은 리프레시 토큰 입니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
String username = jwtTokenProvider.getSubject(refreshToken);
|
String username = jwtTokenProvider.getSubject(refreshToken);
|
||||||
|
|
||||||
// Redis에 저장된 RefreshToken과 일치하는지 확인
|
// Redis에 저장된 RefreshToken과 일치하는지 확인
|
||||||
|
|||||||
@@ -21,6 +21,17 @@ public class AsyncConfig {
|
|||||||
return ex;
|
return ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean(name = "makeShapeFile")
|
||||||
|
public Executor makeShapeFileExecutor() {
|
||||||
|
ThreadPoolTaskExecutor ex = new ThreadPoolTaskExecutor();
|
||||||
|
ex.setCorePoolSize(2);
|
||||||
|
ex.setMaxPoolSize(4);
|
||||||
|
ex.setQueueCapacity(50);
|
||||||
|
ex.setThreadNamePrefix("makeShapeFile-");
|
||||||
|
ex.initialize();
|
||||||
|
return ex;
|
||||||
|
}
|
||||||
|
|
||||||
@Bean(name = "auditLogExecutor")
|
@Bean(name = "auditLogExecutor")
|
||||||
public Executor auditLogExecutor() {
|
public Executor auditLogExecutor() {
|
||||||
ThreadPoolTaskExecutor exec = new ThreadPoolTaskExecutor();
|
ThreadPoolTaskExecutor exec = new ThreadPoolTaskExecutor();
|
||||||
@@ -31,4 +42,16 @@ public class AsyncConfig {
|
|||||||
exec.initialize();
|
exec.initialize();
|
||||||
return exec;
|
return exec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 0313
|
||||||
|
@Bean(name = "inferenceEndExecutor")
|
||||||
|
public Executor inferenceEndExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
executor.setCorePoolSize(5);
|
||||||
|
executor.setMaxPoolSize(10);
|
||||||
|
executor.setQueueCapacity(100);
|
||||||
|
executor.setThreadNamePrefix("inference-async-");
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 생성
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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,19 +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;
|
|
||||||
|
|
||||||
@Hidden
|
|
||||||
@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",
|
||||||
@@ -45,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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ jwt:
|
|||||||
secret: "kamco_token_9b71e778-19a3-4c1d-97bf-2d687de17d5b"
|
secret: "kamco_token_9b71e778-19a3-4c1d-97bf-2d687de17d5b"
|
||||||
access-token-validity-in-ms: 86400000 # 1일
|
access-token-validity-in-ms: 86400000 # 1일
|
||||||
refresh-token-validity-in-ms: 604800000 # 7일
|
refresh-token-validity-in-ms: 604800000 # 7일
|
||||||
#access-token-validity-in-ms: 60000 # 1분
|
#access-token-validity-in-ms: 300000 # 5분
|
||||||
#refresh-token-validity-in-ms: 300000 # 5분
|
#refresh-token-validity-in-ms: 600000 # 10분
|
||||||
|
|
||||||
token:
|
token:
|
||||||
refresh-cookie-name: kamco-dev # 개발용 쿠키 이름
|
refresh-cookie-name: kamco-dev # 개발용 쿠키 이름
|
||||||
|
|||||||
Reference in New Issue
Block a user