diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..c3f502a --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 디폴트 무시된 파일 +/shelf/ +/workspace.xml +# 에디터 기반 HTTP 클라이언트 요청 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/kamco-cd-cron.iml b/.idea/kamco-cd-cron.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/kamco-cd-cron.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..39dbf16 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..b25cc63 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/label/label-to-review/.gitkeep b/label/label-to-review/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/label/label-to-review/.gradle/8.14/checksums/checksums.lock b/label/label-to-review/.gradle/8.14/checksums/checksums.lock new file mode 100644 index 0000000..f939e90 Binary files /dev/null and b/label/label-to-review/.gradle/8.14/checksums/checksums.lock differ diff --git a/label/label-to-review/.gradle/8.14/executionHistory/executionHistory.bin b/label/label-to-review/.gradle/8.14/executionHistory/executionHistory.bin new file mode 100644 index 0000000..b5d8d77 Binary files /dev/null and b/label/label-to-review/.gradle/8.14/executionHistory/executionHistory.bin differ diff --git a/label/label-to-review/.gradle/8.14/executionHistory/executionHistory.lock b/label/label-to-review/.gradle/8.14/executionHistory/executionHistory.lock new file mode 100644 index 0000000..5370e61 Binary files /dev/null and b/label/label-to-review/.gradle/8.14/executionHistory/executionHistory.lock differ diff --git a/label/label-to-review/.gradle/8.14/fileChanges/last-build.bin b/label/label-to-review/.gradle/8.14/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/label/label-to-review/.gradle/8.14/fileChanges/last-build.bin differ diff --git a/label/label-to-review/.gradle/8.14/fileHashes/fileHashes.bin b/label/label-to-review/.gradle/8.14/fileHashes/fileHashes.bin new file mode 100644 index 0000000..c2db215 Binary files /dev/null and b/label/label-to-review/.gradle/8.14/fileHashes/fileHashes.bin differ diff --git a/label/label-to-review/.gradle/8.14/fileHashes/fileHashes.lock b/label/label-to-review/.gradle/8.14/fileHashes/fileHashes.lock new file mode 100644 index 0000000..0030c93 Binary files /dev/null and b/label/label-to-review/.gradle/8.14/fileHashes/fileHashes.lock differ diff --git a/label/label-to-review/.gradle/8.14/fileHashes/resourceHashesCache.bin b/label/label-to-review/.gradle/8.14/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..6502d3c Binary files /dev/null and b/label/label-to-review/.gradle/8.14/fileHashes/resourceHashesCache.bin differ diff --git a/label/label-to-review/.gradle/8.14/gc.properties b/label/label-to-review/.gradle/8.14/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/label/label-to-review/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/label/label-to-review/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..a00c62f Binary files /dev/null and b/label/label-to-review/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/label/label-to-review/.gradle/buildOutputCleanup/cache.properties b/label/label-to-review/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..fddf220 --- /dev/null +++ b/label/label-to-review/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Mon Feb 02 19:50:45 KST 2026 +gradle.version=8.14 diff --git a/label/label-to-review/.gradle/buildOutputCleanup/outputFiles.bin b/label/label-to-review/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..acd82ad Binary files /dev/null and b/label/label-to-review/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/label/label-to-review/.gradle/file-system.probe b/label/label-to-review/.gradle/file-system.probe new file mode 100644 index 0000000..2dea263 Binary files /dev/null and b/label/label-to-review/.gradle/file-system.probe differ diff --git a/label/label-to-review/.gradle/vcs-1/gc.properties b/label/label-to-review/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/label/label-to-review/CODE_STYLE_SETUP.md b/label/label-to-review/CODE_STYLE_SETUP.md new file mode 100644 index 0000000..2c07ff5 --- /dev/null +++ b/label/label-to-review/CODE_STYLE_SETUP.md @@ -0,0 +1,112 @@ +# Code Style 설정 가이드 + +이 문서는 프로젝트에서 Google Java Style을 자동으로 적용하기 위한 설정 가이드입니다. + +## 자동 포맷팅 구성 + +### 1. 커밋 시점 자동 포맷팅 (Git Pre-commit Hook) + +커밋 전에 자동으로 코드를 포맷팅하고 스테이징합니다. + +**설정 완료:** `.git/hooks/pre-commit` 파일이 자동으로 실행됩니다. + +**동작 방식:** +- 커밋 시도 시 `./gradlew spotlessApply` 자동 실행 +- 스테이징된 Java 파일을 자동으로 포맷팅 +- 포맷팅된 파일을 자동으로 다시 스테이징 +- 포맷팅이 완료되면 커밋 진행 + +**장점:** +- 수동으로 `spotlessApply`를 실행할 필요 없음 +- 항상 일관된 코드 스타일 유지 +- 포맷팅 누락 방지 + +### 2. IntelliJ IDEA 저장 시점 자동 포맷팅 + +#### 방법 1: Code Style 설정 임포트 (권장) + +1. **IntelliJ IDEA 열기** +2. **Settings/Preferences** (Mac: `⌘,` / Windows: `Ctrl+Alt+S`) +3. **Editor > Code Style > Java** +4. **⚙️ (톱니바퀴)** 클릭 > **Import Scheme > IntelliJ IDEA code style XML** +5. 프로젝트 루트의 `intellij-java-google-style.xml` 파일 선택 +6. **OK** 클릭 + +#### 방법 2: 저장 시 자동 포맷팅 활성화 + + +**Option A: Actions on Save 설정** + +1. **Settings/Preferences** > **Tools > Actions on Save** +2. 다음 옵션들을 활성화: + - ✅ **Reformat code** + - ✅ **Optimize imports** + - ✅ **Rearrange code** (선택사항) +3. **Changed lines** 또는 **Whole file** 선택 +4. **OK** 클릭 + +**Option B: Save Actions Plugin 사용 (더 많은 옵션)** + +1. **Settings/Preferences** > **Plugins** +2. **Marketplace**에서 "Save Actions" 검색 및 설치 +3. **Settings/Preferences** > **Other Settings > Save Actions** +4. 다음 옵션 활성화: + - ✅ **Activate save actions on save** + - ✅ **Reformat file** + - ✅ **Optimize imports** + - ✅ **Rearrange fields and methods** (선택사항) + +### 3. Gradle Spotless Plugin 수동 실행 + +#### 코드 포맷팅 체크 +```bash +# 포맷팅 문제 확인만 (수정하지 않음) +./gradlew spotlessCheck +``` + +#### 코드 자동 포맷팅 +```bash +# 모든 Java 파일 자동 포맷팅 적용 +./gradlew spotlessApply +``` + +#### 빌드 시 자동 체크 +```bash +# 빌드 전에 자동으로 spotlessCheck 실행됨 +./gradlew build +``` + +## 코드 스타일 규칙 + +프로젝트는 **Google Java Style Guide** 기반으로 다음 규칙을 따릅니다: + +- **Indentation**: 2 spaces (탭 아님) +- **Line Length**: 180 characters +- **Line Endings**: LF (Unix-style) +- **Charset**: UTF-8 +- **Import Order**: Static imports → 빈 줄 → Regular imports +- **Braces**: 모든 if, for, while, do 문에 중괄호 필수 + +## 문제 해결 + +### Pre-commit hook이 실행되지 않는 경우 +```bash +# 실행 권한 확인 및 부여 +chmod +x .git/hooks/pre-commit +``` + +### Spotless 플러그인이 동작하지 않는 경우 +```bash +# Gradle 의존성 다시 다운로드 +./gradlew clean build --refresh-dependencies +``` + +### IntelliJ 포맷팅이 다르게 적용되는 경우 +1. `intellij-java-google-style.xml` 다시 임포트 +2. **File > Invalidate Caches** > **Invalidate and Restart** + +## 추가 정보 + +- **Google Java Style Guide**: https://google.github.io/styleguide/javaguide.html +- **Spotless Plugin**: https://github.com/diffplug/spotless +- **IntelliJ Code Style**: https://www.jetbrains.com/help/idea/code-style.html diff --git a/label/label-to-review/COMMON_CODE_CACHE_REDIS.md b/label/label-to-review/COMMON_CODE_CACHE_REDIS.md new file mode 100644 index 0000000..fbff1ee --- /dev/null +++ b/label/label-to-review/COMMON_CODE_CACHE_REDIS.md @@ -0,0 +1,282 @@ +# 공통코드 Redis 캐시 시스템 - DanielLee + +## 요구사항 검토 + +### 1. **API를 통해 공통코드 제공** +- **구현 완료**: `CommonCodeApiController`에서 전체 공통코드 조회 API 제공 + ``` + GET /api/code + → 모든 공통코드 조회 + ``` +- **추가 구현**: 캐시 갱신 및 상태 확인 API + ``` + POST /api/code/cache/refresh → 캐시 갱신 + GET /api/code/cache/status → 캐시 상태 확인 + ``` + +--- + +### 2. **애플리케이션 로딩시 Redis 캐시에 올리기** +- **구현 완료**: `CommonCodeCacheManager` 클래스 생성 + +#### 초기화 메커니즘 +```java +@Component +@RequiredArgsConstructor +public class CommonCodeCacheManager { + + @EventListener(ApplicationReadyEvent.class) + public void initializeCommonCodeCache() { + // 애플리케이션 완전히 시작된 후 공통코드를 Redis에 미리 로드 + List allCommonCodes = commonCodeService.getFindAll(); + // @Cacheable이 자동으로 Redis에 캐시함 + } +} +``` + +#### 동작 흐름 +1. 애플리케이션 시작 +2. Spring이 모든 Bean 생성 완료 (`ApplicationReadyEvent` 발생) +3. `CommonCodeCacheManager.initializeCommonCodeCache()` 실행 +4. `commonCodeService.getFindAll()` 호출 (DB에서 조회) +5. `@Cacheable(value = "commonCodes")` 에노테이션이 결과를 Redis에 저장 + +--- + +### 3. **공통코드 변경시 데이터 갱신** + +#### 자동 갱신 +- **등록 (CREATE)**: `@CacheEvict` → 캐시 전체 삭제 +- **수정 (UPDATE)**: `@CacheEvict` → 캐시 전체 삭제 +- **삭제 (DELETE)**: `@CacheEvict` → 캐시 전체 삭제 +- **순서 변경**: `@CacheEvict` → 캐시 전체 삭제 + +```java +@CacheEvict(value = "commonCodes", allEntries = true) +public ResponseObj save(CommonCodeDto.AddReq req) { + // 공통코드 저장 + // ↓ + // 캐시 전체 삭제 (다음 조회 시 DB에서 새로 로드) +} +``` + +#### 수동 갱신 (관리자) +```java +POST /api/code/cache/refresh +``` +- 공통코드 설정이 변경된 후 API를 호출하여 캐시를 강제 갱신 + +#### 캐시 상태 모니터링 +```java +GET /api/code/cache/status +→ 응답: { "data": 150 } // 캐시된 공통코드 150개 +``` + +--- + +## 전체 아키텍처 + +``` +┌─────────────────────────────────────────────────────────┐ +│ 클라이언트 요청 │ +└──────────────────┬──────────────────────────────────────┘ + │ + ┌──────────▼──────────┐ + │ CommonCodeApiController + └──────────┬──────────┘ + │ + ┌─────────┴──────────┐ + │ │ + ┌────▼─────┐ ┌──────▼────────────┐ + │ 조회 API │ │ 캐시 관리 API │ + │ (GET) │ │(POST, GET) │ + └────┬─────┘ └──────┬────────────┘ + │ │ + │ ┌────────▼──────────┐ + │ │CommonCodeCacheManager + │ │(캐시 초기화/갱신) │ + │ └────────┬──────────┘ + │ │ + ┌────▼─────────────────┬─▼────┐ + │ CommonCodeService │ │ + │ (@Cacheable) │ │ + │ (@CacheEvict) │ │ + └────┬──────────────────┴──────┘ + │ + ┌────▼──────────┐ + │ Redis 캐시 │ + │ (공통코드) │ + └────┬──────────┘ + │ + ┌────▼──────────┐ + │ PostgreSQL DB │ + │ (공통코드) │ + └───────────────┘ +``` + +--- + +## API 명세 + +### 1. 공통코드 조회 (캐시됨) +``` +GET /api/code + +응답: +{ + "data": [ + { + "id": 1, + "code": "STATUS", + "name": "상태", + "description": "상태 공통코드", + "used": true, + ... + }, + ... + ] +} +``` + +### 2. 공통코드 캐시 갱신 +``` +POST /api/code/cache/refresh + +응답: +{ + "data": "공통코드 캐시가 갱신되었습니다." +} +``` + +### 3. 캐시 상태 확인 +``` +GET /api/code/cache/status + +응답: +{ + "data": 150 // Redis에 캐시된 공통코드 개수 +} +``` + +--- + +## 캐시 갱신 흐름 + +### 자동 갱신 (CRUD 작업) +``` +관리자가 공통코드 등록/수정/삭제 + ↓ +CommonCodeService.save() / update() / removeCode() +(@CacheEvict 실행) + ↓ +Redis 캐시 전체 삭제 + ↓ +다음 조회 시 DB에서 새로 로드 +``` + +### 수동 갱신 (API 호출) +``` +관리자: POST /api/code/cache/refresh + ↓ +CommonCodeCacheManager.refreshCommonCodeCache() + ↓ +캐시 정리 + 새로운 데이터 로드 + ↓ +Redis 캐시 업데이트 완료 +``` + +--- + +## 성능 최적화 효과 + +| 항목 | 개선 전 | 개선 후 | +|------|--------|--------| +| **조회 속도** | DB 직접 조회 (10-100ms) | Redis 캐시 (1-5ms) | +| **DB 부하** | 매번 조회 | 캐시 미스시만 조회 | +| **네트워크 대역폭** | 높음 (DB 왕복) | 낮음 (로컬 캐시) | +| **응답 시간** | 변동적 | 일정 (캐시) | + +--- + +## 추가 기능 + +### CommonCodeUtil - 전역 공통코드 조회 +```java +@Component +public class CommonCodeUtil { + // 모든 공통코드 조회 (캐시 활용) + public List getAllCommonCodes() + + // 특정 코드로 조회 + public List getCommonCodesByCode(String code) + + // ID로 단건 조회 + public Optional getCommonCodeById(Long id) + + // 코드명 조회 + public Optional getCodeName(String parentCode, String childCode) + + // 하위 코드 조회 + public List getChildCodesByParentCode(String parentCode) + + // 코드 사용 가능 여부 확인 + public boolean isCodeAvailable(Long parentId, String code) +} +``` + +### 사용 예시 +```java +@RequiredArgsConstructor +@RestController +public class SomeController { + + private final CommonCodeUtil commonCodeUtil; + + @GetMapping("/example") + public void example() { + // 1. 모든 공통코드 조회 (캐시됨) + List allCodes = commonCodeUtil.getAllCommonCodes(); + + // 2. 특정 코드 조회 + Optional name = commonCodeUtil.getCodeName("PARENT", "CHILD"); + + // 3. 코드 사용 가능 여부 확인 + boolean available = commonCodeUtil.isCodeAvailable(1L, "NEW_CODE"); + } +} +``` + +--- + +## 완료 체크리스트 + +- Redis 캐싱 어노테이션 적용 (@Cacheable, @CacheEvict) +- 애플리케이션 로딩시 캐시 초기화 +- CRUD 작업시 자동 캐시 갱신 +- 수동 캐시 갱신 API 제공 +- 캐시 상태 모니터링 API +- 전역 공통코드 조회 유틸리티 +- 포괄적인 유닛 테스트 (12개) + +--- + +## 모니터링 + +캐시 상태를 주기적으로 모니터링: +```bash +# 캐시 상태 확인 +curl http://localhost:8080/api/code/cache/status + +# 캐시 갱신 +curl -X POST http://localhost:8080/api/code/cache/refresh +``` + +로그 확인: +``` +=== 공통코드 캐시 초기화 시작 === +✓ 공통코드 150개가 Redis 캐시에 로드되었습니다. + - [STATUS] 상태 (ID: 1) + - [TYPE] 타입 (ID: 2) + ... +=== 공통코드 캐시 초기화 완료 === +``` diff --git a/label/label-to-review/Dockerfile-dev b/label/label-to-review/Dockerfile-dev new file mode 100644 index 0000000..994ea58 --- /dev/null +++ b/label/label-to-review/Dockerfile-dev @@ -0,0 +1,29 @@ +# Stage 1: Build stage (gradle build는 Jenkins에서 이미 수행) +FROM eclipse-temurin:21-jre-jammy + +# GDAL 설치 +RUN apt-get update && apt-get install -y \ + gdal-bin \ + libgdal-dev \ + && rm -rf /var/lib/apt/lists/* + +ARG UID=1000 +ARG GID=1000 + +RUN groupadd -g ${GID} manager01 \ + && useradd -u ${UID} -g ${GID} -m manager01 + +USER manager01 + +# 작업 디렉토리 설정 +WORKDIR /app + +# JAR 파일 복사 (Jenkins에서 빌드된 ROOT.jar) +COPY build/libs/ROOT.jar app.jar + +# 포트 노출 +EXPOSE 8080 + +# 애플리케이션 실행 +# dev 프로파일로 실행 +ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=dev", "app.jar"] diff --git a/label/label-to-review/Jenkinsfile-dev b/label/label-to-review/Jenkinsfile-dev new file mode 100644 index 0000000..e018a11 --- /dev/null +++ b/label/label-to-review/Jenkinsfile-dev @@ -0,0 +1,94 @@ +pipeline { + agent any + tools { + jdk 'jdk21' + } + environment { + BRANCH = 'develop' + GIT_REPO = 'https://10.100.0.10:3210/dabeeo/kamco-dabeeo-backoffice.git' + } + + + stages { + stage('Checkout') { + steps { + checkout([ + $class: 'GitSCM', + branches: [[name: "${env.BRANCH}"]], + userRemoteConfigs: [[ + url: "${env.GIT_REPO}", + credentialsId: 'jenkins-dev-token' + ]] + ]) + } + } + stage('Get Commit Hash') { + steps { + script { + env.COMMIT_HASH = sh(script: "git rev-parse --short HEAD", returnStdout: true).trim() + echo "Current commit hash: ${env.COMMIT_HASH}" + } + } + } + + stage('Build') { + steps { + sh "./gradlew clean build -x test" + } + } + + stage('Docker Build & Deploy') { + steps { + script { + echo "Building Docker image with tag: ${env.COMMIT_HASH}" + + // IMAGE_TAG 환경변수 설정 후 docker-compose로 빌드 및 배포 + sh """ + export IMAGE_TAG=${env.COMMIT_HASH} + + # 기존 컨테이너 중지 및 제거 + docker-compose -f docker-compose-dev.yml down || true + + # 새 이미지 빌드 + docker-compose -f docker-compose-dev.yml build + + # latest 태그도 추가 + docker tag kamco-changedetection-api:${env.COMMIT_HASH} kamco-changedetection-api:latest + + # 컨테이너 시작 + docker-compose -f docker-compose-dev.yml up -d + """ + + // 헬스체크 대기 + echo "Waiting for application to be ready..." + sh """ + for i in {1..30}; do + if docker exec kamco-changedetection-api curl -f http://localhost:8080/monitor/health > /dev/null 2>&1; then + echo "✅ Application is healthy!" + docker-compose -f docker-compose-dev.yml ps + exit 0 + fi + echo "⏳ Waiting for application... (\$i/30)" + sleep 2 + done + echo "⚠️ Warning: Health check timeout, checking container status..." + docker-compose -f docker-compose-dev.yml ps + """ + } + } + } + + stage('Cleanup Old Images') { + steps { + script { + echo "Cleaning up old Docker images..." + sh """ + # Keep latest 5 images, remove older ones + docker images kamco-changedetection-api --format "{{.ID}} {{.Tag}}" | \ + grep -v latest | tail -n +6 | awk '{print \$1}' | xargs -r docker rmi || true + """ + } + } + } + } +} diff --git a/label/label-to-review/README.md b/label/label-to-review/README.md new file mode 100644 index 0000000..bcef71a --- /dev/null +++ b/label/label-to-review/README.md @@ -0,0 +1,26 @@ +# IMAGERY MAKE DATASET + +> 어제 라벨링 완료된 것 검수할당 schedule + +## 📋 프로젝트 소개 + +**label-to-review**는 어제 라벨링 완료된 것을 검수 할당하는 schedule 입니다. + +## 🚀 시작하기 +TrainingDataLabelJobService 의 assignReviewerYesterdayLabelComplete 메소드가 매일 00:00분에 schedule 실행됨 + +```bash +./gradlew spotlessApply +``` +```bash +./gradlew clean build +``` +```bash +Java -jar label-to-review.jar \ +``` +### 필수 요구사항 + +- Java 21 (JDK 21) +- PostgreSQL 12+ (PostGIS 확장 필요) +- Gradle 8.x (또는 Gradle Wrapper 사용) +- Docker & Docker Compose (선택사항) \ No newline at end of file diff --git a/label/label-to-review/build.gradle b/label/label-to-review/build.gradle new file mode 100644 index 0000000..ab0dbc0 --- /dev/null +++ b/label/label-to-review/build.gradle @@ -0,0 +1,110 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '3.5.7' + id 'io.spring.dependency-management' version '1.1.7' + id 'com.diffplug.spotless' version '6.25.0' +} + +group = 'com.kamco.cd' +version = '0.0.1-SNAPSHOT' +description = 'label-to-review' + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } +} + +bootJar { + archiveFileName = "label-to-review.jar" +} + +jar { + enabled = false // plain.jar 안 만들기(혼동 방지) +} + +configurations { + compileOnly { + extendsFrom annotationProcessor + } +} + +repositories { + mavenCentral() + maven { url "https://repo.osgeo.org/repository/release/" } +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.springframework.boot:spring-boot-starter-web' + compileOnly 'org.projectlombok:lombok' + runtimeOnly 'org.postgresql:postgresql' + annotationProcessor 'org.projectlombok:lombok' + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + implementation 'org.springframework.boot:spring-boot-starter-validation' + + //geometry + implementation 'com.fasterxml.jackson.core:jackson-databind' + implementation "org.geotools:gt-shapefile:30.0" + implementation "org.geotools:gt-referencing:30.0" + implementation "org.geotools:gt-geojson:30.0" + implementation 'org.locationtech.jts.io:jts-io-common:1.20.0' + implementation 'org.locationtech.jts:jts-core:1.19.0' + implementation 'org.hibernate:hibernate-spatial:6.2.7.Final' + implementation 'org.geotools:gt-main:30.0' + implementation("org.geotools:gt-geotiff:30.0") { + exclude group: "javax.media", module: "jai_core" + } + implementation 'org.geotools:gt-epsg-hsql:30.0' + + // QueryDSL JPA + implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' + + // Q클래스 생성용 annotationProcessor + annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta' + annotationProcessor 'jakarta.annotation:jakarta.annotation-api' + annotationProcessor 'jakarta.persistence:jakarta.persistence-api' + + // actuator + implementation 'org.springframework.boot:spring-boot-starter-actuator' + + // Redis + implementation 'org.springframework.boot:spring-boot-starter-data-redis' + + // SpringDoc OpenAPI (Swagger) + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0' + + // Apache Commons Compress for archive handling + implementation 'org.apache.commons:commons-compress:1.26.0' + + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' + implementation 'org.reflections:reflections:0.10.2' + + + implementation 'org.locationtech.jts:jts-core:1.19.0' + implementation 'org.locationtech.jts.io:jts-io-common:1.19.0' +} + +configurations.configureEach { + exclude group: 'javax.media', module: 'jai_core' +} + +tasks.named('test') { + useJUnitPlatform() +} + +// Spotless configuration for code formatting (2-space indent) +spotless { + java { + target 'src/**/*.java' + googleJavaFormat('1.19.2') // Default Google Style = 2 spaces (NO .aosp()!) + trimTrailingWhitespace() + endWithNewline() + } +} + +// Run spotlessCheck before build +tasks.named('build') { + dependsOn 'spotlessCheck' +} diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/KamcoBackApplication.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/KamcoBackApplication.class new file mode 100644 index 0000000..b6f1b43 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/KamcoBackApplication.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$AddReq.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$AddReq.class new file mode 100644 index 0000000..d0e2837 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$AddReq.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$Basic.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$Basic.class new file mode 100644 index 0000000..c7e3a9b Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$Basic.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$Clazzes.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$Clazzes.class new file mode 100644 index 0000000..a61b41f Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$Clazzes.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$CodeDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$CodeDto.class new file mode 100644 index 0000000..a7c39e0 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$CodeDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$ModifyReq.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$ModifyReq.class new file mode 100644 index 0000000..e2be397 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$ModifyReq.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$OrderReq.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$OrderReq.class new file mode 100644 index 0000000..95bbce9 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$OrderReq.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$SearchReq.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$SearchReq.class new file mode 100644 index 0000000..04e4c14 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto$SearchReq.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto.class new file mode 100644 index 0000000..7eea8d4 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/code/dto/CommonCodeDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/CodeDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/CodeDto.class new file mode 100644 index 0000000..53388dd Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/CodeDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/CodeExpose.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/CodeExpose.class new file mode 100644 index 0000000..14a8a8f Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/CodeExpose.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/CodeHidden.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/CodeHidden.class new file mode 100644 index 0000000..c9e70a0 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/CodeHidden.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/EnumType.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/EnumType.class new file mode 100644 index 0000000..f0d43c6 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/EnumType.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/EnumValidator.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/EnumValidator.class new file mode 100644 index 0000000..1363221 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/EnumValidator.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/Enums.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/Enums.class new file mode 100644 index 0000000..62ea942 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/Enums.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/ImageryFitStatus.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/ImageryFitStatus.class new file mode 100644 index 0000000..48c08ea Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/enums/ImageryFitStatus.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.class new file mode 100644 index 0000000..11f0ebf Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/html/HtmlUnescapeSerializer.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/html/HtmlUnescapeSerializer.class new file mode 100644 index 0000000..fc3bca1 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/html/HtmlUnescapeSerializer.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/interfaces/EnumValid.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/interfaces/EnumValid.class new file mode 100644 index 0000000..156efdb Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/interfaces/EnumValid.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/interfaces/JsonFormatDttm.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/interfaces/JsonFormatDttm.class new file mode 100644 index 0000000..63b5489 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/common/utils/interfaces/JsonFormatDttm.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/config/QuerydslConfig.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/config/QuerydslConfig.class new file mode 100644 index 0000000..11f1c1a Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/config/QuerydslConfig.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto$ApiResponseCode.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto$ApiResponseCode.class new file mode 100644 index 0000000..18effd2 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto$ApiResponseCode.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto$Error.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto$Error.class new file mode 100644 index 0000000..4aec570 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto$Error.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto$ResponseObj.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto$ResponseObj.class new file mode 100644 index 0000000..b60f2a2 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto$ResponseObj.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto.class new file mode 100644 index 0000000..7e26f32 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/dto/ApiResponseDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/ApiConfigEnum$EnumDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/ApiConfigEnum$EnumDto.class new file mode 100644 index 0000000..aff3c11 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/ApiConfigEnum$EnumDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/ApiConfigEnum.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/ApiConfigEnum.class new file mode 100644 index 0000000..fad51ec Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/ApiConfigEnum.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/CodeDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/CodeDto.class new file mode 100644 index 0000000..b0b057c Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/CodeDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/CommonUseStatus.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/CommonUseStatus.class new file mode 100644 index 0000000..6e2f34e Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/CommonUseStatus.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/Enums.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/Enums.class new file mode 100644 index 0000000..6b9ca97 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/Enums.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/MngStateType.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/MngStateType.class new file mode 100644 index 0000000..0e02cb7 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/MngStateType.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/SyncStateType.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/SyncStateType.class new file mode 100644 index 0000000..95c1408 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/enums/SyncStateType.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/DetectionClassification.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/DetectionClassification.class new file mode 100644 index 0000000..3fbb835 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/DetectionClassification.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$AnalResList.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$AnalResList.class new file mode 100644 index 0000000..9777979 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$AnalResList.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$AnalResSummary.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$AnalResSummary.class new file mode 100644 index 0000000..55c29d2 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$AnalResSummary.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$AnalResultInfo.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$AnalResultInfo.class new file mode 100644 index 0000000..d861d3a Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$AnalResultInfo.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Basic.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Basic.class new file mode 100644 index 0000000..d2940c2 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Basic.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$BboxPointDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$BboxPointDto.class new file mode 100644 index 0000000..de5efd3 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$BboxPointDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Clazz.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Clazz.class new file mode 100644 index 0000000..c8f8e05 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Clazz.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Clazzes.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Clazzes.class new file mode 100644 index 0000000..e5d81f2 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Clazzes.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Coordinate.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Coordinate.class new file mode 100644 index 0000000..d800dfb Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Coordinate.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Dashboard.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Dashboard.class new file mode 100644 index 0000000..d476642 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Dashboard.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Detail.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Detail.class new file mode 100644 index 0000000..c12694d Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Detail.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$DetailListEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$DetailListEntity.class new file mode 100644 index 0000000..9d5a16f Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$DetailListEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Geom.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Geom.class new file mode 100644 index 0000000..3f065da Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Geom.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$InferenceBatchSheet.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$InferenceBatchSheet.class new file mode 100644 index 0000000..f63eb56 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$InferenceBatchSheet.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$MapSheet.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$MapSheet.class new file mode 100644 index 0000000..b76f82a Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$MapSheet.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Scene.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Scene.class new file mode 100644 index 0000000..05ec255 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Scene.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$SearchGeoReq.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$SearchGeoReq.class new file mode 100644 index 0000000..934dcb9 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$SearchGeoReq.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$SearchReq.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$SearchReq.class new file mode 100644 index 0000000..b7ba811 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$SearchReq.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Uid.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Uid.class new file mode 100644 index 0000000..3a64879 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto$Uid.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto.class new file mode 100644 index 0000000..439019d Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$DetectOption.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$DetectOption.class new file mode 100644 index 0000000..e739976 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$DetectOption.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceLearnDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceLearnDto.class new file mode 100644 index 0000000..cde5541 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceLearnDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceServerStatusDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceServerStatusDto.class new file mode 100644 index 0000000..1c4db81 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceServerStatusDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceStatusDetailDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceStatusDetailDto.class new file mode 100644 index 0000000..8bc99f5 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceStatusDetailDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceStatusDetailDto2.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceStatusDetailDto2.class new file mode 100644 index 0000000..05019a9 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$InferenceStatusDetailDto2.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$MapSheetNumDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$MapSheetNumDto.class new file mode 100644 index 0000000..2adecaa Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$MapSheetNumDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$MapSheetScope.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$MapSheetScope.class new file mode 100644 index 0000000..6691bb1 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$MapSheetScope.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$RegReq.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$RegReq.class new file mode 100644 index 0000000..ac8df42 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$RegReq.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$ResultList.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$ResultList.class new file mode 100644 index 0000000..4d4b02b Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$ResultList.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$SaveInferenceAiDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$SaveInferenceAiDto.class new file mode 100644 index 0000000..a7469ea Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$SaveInferenceAiDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$SearchListReq.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$SearchListReq.class new file mode 100644 index 0000000..c58e061 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$SearchListReq.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$ServerStatus.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$ServerStatus.class new file mode 100644 index 0000000..05e10cc Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$ServerStatus.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$Status.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$Status.class new file mode 100644 index 0000000..f893367 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto$Status.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.class new file mode 100644 index 0000000..83380fa Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/CodeExpose.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/CodeExpose.class new file mode 100644 index 0000000..c5c9cc2 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/CodeExpose.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/CodeHidden.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/CodeHidden.class new file mode 100644 index 0000000..ea41d29 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/CodeHidden.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/EnumType.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/EnumType.class new file mode 100644 index 0000000..6700ff7 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/EnumType.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/JsonFormatDttm.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/JsonFormatDttm.class new file mode 100644 index 0000000..190dc12 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/inferface/JsonFormatDttm.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$AllocateDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$AllocateDto.class new file mode 100644 index 0000000..a553955 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$AllocateDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$AllocateInfoDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$AllocateInfoDto.class new file mode 100644 index 0000000..b3249df Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$AllocateInfoDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$AllocateMoveDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$AllocateMoveDto.class new file mode 100644 index 0000000..57115ff Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$AllocateMoveDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$Basic.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$Basic.class new file mode 100644 index 0000000..ee396af Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$Basic.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$InferenceDetail.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$InferenceDetail.class new file mode 100644 index 0000000..9f2c136 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$InferenceDetail.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$InspectState.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$InspectState.class new file mode 100644 index 0000000..10a85d5 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$InspectState.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelMngState.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelMngState.class new file mode 100644 index 0000000..d8f3a01 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelMngState.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelState.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelState.class new file mode 100644 index 0000000..dc99b29 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelState.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelerDetail.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelerDetail.class new file mode 100644 index 0000000..6af39b2 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelerDetail.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelingStatDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelingStatDto.class new file mode 100644 index 0000000..c6e7a6a Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$LabelingStatDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$MoveInfo.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$MoveInfo.class new file mode 100644 index 0000000..1acd221 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$MoveInfo.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$MoveUserList.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$MoveUserList.class new file mode 100644 index 0000000..663dcb7 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$MoveUserList.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$TargetInspector.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$TargetInspector.class new file mode 100644 index 0000000..98634ad Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$TargetInspector.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$TargetUser.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$TargetUser.class new file mode 100644 index 0000000..53dee8e Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$TargetUser.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$UserList.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$UserList.class new file mode 100644 index 0000000..7b4c74f Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$UserList.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$WorkHistoryDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$WorkHistoryDto.class new file mode 100644 index 0000000..56f3cef Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$WorkHistoryDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$searchReq.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$searchReq.class new file mode 100644 index 0000000..555a40d Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto$searchReq.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto.class new file mode 100644 index 0000000..3aeced1 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto$Basic.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto$Basic.class new file mode 100644 index 0000000..1801b99 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto$Basic.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto.class new file mode 100644 index 0000000..6e3b61d Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelLabelerDto$Basic.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelLabelerDto$Basic.class new file mode 100644 index 0000000..be9ec1e Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelLabelerDto$Basic.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelLabelerDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelLabelerDto.class new file mode 100644 index 0000000..5a1b01d Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/label/dto/LabelLabelerDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/core/TrainingDataLabelJobCoreService.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/core/TrainingDataLabelJobCoreService.class new file mode 100644 index 0000000..93e52d0 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/core/TrainingDataLabelJobCoreService.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/CommonDateEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/CommonDateEntity.class new file mode 100644 index 0000000..e3895f9 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/CommonDateEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/LabelingAssignmentEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/LabelingAssignmentEntity.class new file mode 100644 index 0000000..a2dba9c Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/LabelingAssignmentEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.class new file mode 100644 index 0000000..4018c4d Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/MapInkx50kEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/MapInkx50kEntity.class new file mode 100644 index 0000000..b910f80 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/MapInkx50kEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/MapInkx5kEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/MapInkx5kEntity.class new file mode 100644 index 0000000..487388e Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/MapInkx5kEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataInferenceGeomEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataInferenceGeomEntity.class new file mode 100644 index 0000000..7294a45 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataInferenceGeomEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QCommonDateEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QCommonDateEntity.class new file mode 100644 index 0000000..bc26791 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QCommonDateEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingAssignmentEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingAssignmentEntity.class new file mode 100644 index 0000000..da2e512 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingAssignmentEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingInspectorEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingInspectorEntity.class new file mode 100644 index 0000000..44a88a7 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingInspectorEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx50kEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx50kEntity.class new file mode 100644 index 0000000..c263e81 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx50kEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx5kEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx5kEntity.class new file mode 100644 index 0000000..fe95f6f Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx5kEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapSheetAnalDataInferenceGeomEntity.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapSheetAnalDataInferenceGeomEntity.class new file mode 100644 index 0000000..399463e Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapSheetAnalDataInferenceGeomEntity.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/repository/scheduler/TrainingDataLabelJobRepository.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/repository/scheduler/TrainingDataLabelJobRepository.class new file mode 100644 index 0000000..1817150 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/repository/scheduler/TrainingDataLabelJobRepository.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/repository/scheduler/TrainingDataLabelJobRepositoryCustom.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/repository/scheduler/TrainingDataLabelJobRepositoryCustom.class new file mode 100644 index 0000000..189c11f Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/repository/scheduler/TrainingDataLabelJobRepositoryCustom.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/repository/scheduler/TrainingDataLabelJobRepositoryImpl.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/repository/scheduler/TrainingDataLabelJobRepositoryImpl.class new file mode 100644 index 0000000..05cec56 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/postgres/repository/scheduler/TrainingDataLabelJobRepositoryImpl.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$AnalCntInfo.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$AnalCntInfo.class new file mode 100644 index 0000000..fe3de82 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$AnalCntInfo.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$AnalMapSheetList.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$AnalMapSheetList.class new file mode 100644 index 0000000..6ca71b7 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$AnalMapSheetList.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$CompleteLabelData$GeoJsonFeature.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$CompleteLabelData$GeoJsonFeature.class new file mode 100644 index 0000000..749ef9b Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$CompleteLabelData$GeoJsonFeature.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$CompleteLabelData$Properties.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$CompleteLabelData$Properties.class new file mode 100644 index 0000000..47ab502 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$CompleteLabelData$Properties.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$CompleteLabelData.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$CompleteLabelData.class new file mode 100644 index 0000000..8a837d3 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$CompleteLabelData.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$FeatureCollection.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$FeatureCollection.class new file mode 100644 index 0000000..75f80b3 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$FeatureCollection.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$InspectorPendingDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$InspectorPendingDto.class new file mode 100644 index 0000000..131c4ee Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$InspectorPendingDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$Tasks.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$Tasks.class new file mode 100644 index 0000000..7e4f989 Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto$Tasks.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto.class new file mode 100644 index 0000000..78177dd Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/dto/TrainingDataReviewJobDto.class differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.class new file mode 100644 index 0000000..106e71d Binary files /dev/null and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.class differ diff --git a/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QCommonDateEntity.java b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QCommonDateEntity.java new file mode 100644 index 0000000..2bb519c --- /dev/null +++ b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QCommonDateEntity.java @@ -0,0 +1,39 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import static com.querydsl.core.types.PathMetadataFactory.*; + +import com.querydsl.core.types.dsl.*; + +import com.querydsl.core.types.PathMetadata; +import javax.annotation.processing.Generated; +import com.querydsl.core.types.Path; + + +/** + * QCommonDateEntity is a Querydsl query type for CommonDateEntity + */ +@Generated("com.querydsl.codegen.DefaultSupertypeSerializer") +public class QCommonDateEntity extends EntityPathBase { + + private static final long serialVersionUID = 1355779051L; + + public static final QCommonDateEntity commonDateEntity = new QCommonDateEntity("commonDateEntity"); + + public final DateTimePath createdDate = createDateTime("createdDate", java.time.ZonedDateTime.class); + + public final DateTimePath modifiedDate = createDateTime("modifiedDate", java.time.ZonedDateTime.class); + + public QCommonDateEntity(String variable) { + super(CommonDateEntity.class, forVariable(variable)); + } + + public QCommonDateEntity(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QCommonDateEntity(PathMetadata metadata) { + super(CommonDateEntity.class, metadata); + } + +} + diff --git a/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingAssignmentEntity.java b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingAssignmentEntity.java new file mode 100644 index 0000000..52939cb --- /dev/null +++ b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingAssignmentEntity.java @@ -0,0 +1,67 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import static com.querydsl.core.types.PathMetadataFactory.*; + +import com.querydsl.core.types.dsl.*; + +import com.querydsl.core.types.PathMetadata; +import javax.annotation.processing.Generated; +import com.querydsl.core.types.Path; + + +/** + * QLabelingAssignmentEntity is a Querydsl query type for LabelingAssignmentEntity + */ +@Generated("com.querydsl.codegen.DefaultEntitySerializer") +public class QLabelingAssignmentEntity extends EntityPathBase { + + private static final long serialVersionUID = -1647165171L; + + public static final QLabelingAssignmentEntity labelingAssignmentEntity = new QLabelingAssignmentEntity("labelingAssignmentEntity"); + + public final QCommonDateEntity _super = new QCommonDateEntity(this); + + public final NumberPath analUid = createNumber("analUid", Long.class); + + public final StringPath assignGroupId = createString("assignGroupId"); + + public final ComparablePath assignmentUid = createComparable("assignmentUid", java.util.UUID.class); + + //inherited + public final DateTimePath createdDate = _super.createdDate; + + public final NumberPath inferenceGeomUid = createNumber("inferenceGeomUid", Long.class); + + public final StringPath inspectorUid = createString("inspectorUid"); + + public final DateTimePath inspectStatDttm = createDateTime("inspectStatDttm", java.time.ZonedDateTime.class); + + public final StringPath inspectState = createString("inspectState"); + + public final NumberPath learnGeomUid = createNumber("learnGeomUid", Long.class); + + //inherited + public final DateTimePath modifiedDate = _super.modifiedDate; + + public final ComparablePath stagnationYn = createComparable("stagnationYn", Character.class); + + public final StringPath workerUid = createString("workerUid"); + + public final DateTimePath workStatDttm = createDateTime("workStatDttm", java.time.ZonedDateTime.class); + + public final StringPath workState = createString("workState"); + + public QLabelingAssignmentEntity(String variable) { + super(LabelingAssignmentEntity.class, forVariable(variable)); + } + + public QLabelingAssignmentEntity(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QLabelingAssignmentEntity(PathMetadata metadata) { + super(LabelingAssignmentEntity.class, metadata); + } + +} + diff --git a/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingInspectorEntity.java b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingInspectorEntity.java new file mode 100644 index 0000000..d85c9e5 --- /dev/null +++ b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QLabelingInspectorEntity.java @@ -0,0 +1,49 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import static com.querydsl.core.types.PathMetadataFactory.*; + +import com.querydsl.core.types.dsl.*; + +import com.querydsl.core.types.PathMetadata; +import javax.annotation.processing.Generated; +import com.querydsl.core.types.Path; + + +/** + * QLabelingInspectorEntity is a Querydsl query type for LabelingInspectorEntity + */ +@Generated("com.querydsl.codegen.DefaultEntitySerializer") +public class QLabelingInspectorEntity extends EntityPathBase { + + private static final long serialVersionUID = -1575073251L; + + public static final QLabelingInspectorEntity labelingInspectorEntity = new QLabelingInspectorEntity("labelingInspectorEntity"); + + public final QCommonDateEntity _super = new QCommonDateEntity(this); + + public final NumberPath analUid = createNumber("analUid", Long.class); + + //inherited + public final DateTimePath createdDate = _super.createdDate; + + public final StringPath inspectorUid = createString("inspectorUid"); + + //inherited + public final DateTimePath modifiedDate = _super.modifiedDate; + + public final ComparablePath operatorUid = createComparable("operatorUid", java.util.UUID.class); + + public QLabelingInspectorEntity(String variable) { + super(LabelingInspectorEntity.class, forVariable(variable)); + } + + public QLabelingInspectorEntity(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QLabelingInspectorEntity(PathMetadata metadata) { + super(LabelingInspectorEntity.class, metadata); + } + +} + diff --git a/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx50kEntity.java b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx50kEntity.java new file mode 100644 index 0000000..471c2eb --- /dev/null +++ b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx50kEntity.java @@ -0,0 +1,53 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import static com.querydsl.core.types.PathMetadataFactory.*; + +import com.querydsl.core.types.dsl.*; + +import com.querydsl.core.types.PathMetadata; +import javax.annotation.processing.Generated; +import com.querydsl.core.types.Path; + + +/** + * QMapInkx50kEntity is a Querydsl query type for MapInkx50kEntity + */ +@Generated("com.querydsl.codegen.DefaultEntitySerializer") +public class QMapInkx50kEntity extends EntityPathBase { + + private static final long serialVersionUID = 1410103956L; + + public static final QMapInkx50kEntity mapInkx50kEntity = new QMapInkx50kEntity("mapInkx50kEntity"); + + public final QCommonDateEntity _super = new QCommonDateEntity(this); + + //inherited + public final DateTimePath createdDate = _super.createdDate; + + public final NumberPath fid = createNumber("fid", Integer.class); + + public final ComparablePath geom = createComparable("geom", org.locationtech.jts.geom.Geometry.class); + + public final StringPath mapidcdNo = createString("mapidcdNo"); + + public final StringPath mapidNm = createString("mapidNm"); + + public final StringPath mapidNo = createString("mapidNo"); + + //inherited + public final DateTimePath modifiedDate = _super.modifiedDate; + + public QMapInkx50kEntity(String variable) { + super(MapInkx50kEntity.class, forVariable(variable)); + } + + public QMapInkx50kEntity(Path path) { + super(path.getType(), path.getMetadata()); + } + + public QMapInkx50kEntity(PathMetadata metadata) { + super(MapInkx50kEntity.class, metadata); + } + +} + diff --git a/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx5kEntity.java b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx5kEntity.java new file mode 100644 index 0000000..be5ad05 --- /dev/null +++ b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapInkx5kEntity.java @@ -0,0 +1,67 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import static com.querydsl.core.types.PathMetadataFactory.*; + +import com.querydsl.core.types.dsl.*; + +import com.querydsl.core.types.PathMetadata; +import javax.annotation.processing.Generated; +import com.querydsl.core.types.Path; +import com.querydsl.core.types.dsl.PathInits; + + +/** + * QMapInkx5kEntity is a Querydsl query type for MapInkx5kEntity + */ +@Generated("com.querydsl.codegen.DefaultEntitySerializer") +public class QMapInkx5kEntity extends EntityPathBase { + + private static final long serialVersionUID = 372911320L; + + private static final PathInits INITS = PathInits.DIRECT2; + + public static final QMapInkx5kEntity mapInkx5kEntity = new QMapInkx5kEntity("mapInkx5kEntity"); + + public final QCommonDateEntity _super = new QCommonDateEntity(this); + + //inherited + public final DateTimePath createdDate = _super.createdDate; + + public final NumberPath fid = createNumber("fid", Integer.class); + + public final ComparablePath geom = createComparable("geom", org.locationtech.jts.geom.Geometry.class); + + public final StringPath mapidcdNo = createString("mapidcdNo"); + + public final StringPath mapidNm = createString("mapidNm"); + + public final QMapInkx50kEntity mapInkx50k; + + //inherited + public final DateTimePath modifiedDate = _super.modifiedDate; + + public final EnumPath useInference = createEnum("useInference", com.kamco.cd.kamcoback.enums.CommonUseStatus.class); + + public QMapInkx5kEntity(String variable) { + this(MapInkx5kEntity.class, forVariable(variable), INITS); + } + + public QMapInkx5kEntity(Path path) { + this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); + } + + public QMapInkx5kEntity(PathMetadata metadata) { + this(metadata, PathInits.getFor(metadata, INITS)); + } + + public QMapInkx5kEntity(PathMetadata metadata, PathInits inits) { + this(MapInkx5kEntity.class, metadata, inits); + } + + public QMapInkx5kEntity(Class type, PathMetadata metadata, PathInits inits) { + super(type, metadata, inits); + this.mapInkx50k = inits.isInitialized("mapInkx50k") ? new QMapInkx50kEntity(forProperty("mapInkx50k")) : null; + } + +} + diff --git a/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapSheetAnalDataInferenceGeomEntity.java b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapSheetAnalDataInferenceGeomEntity.java new file mode 100644 index 0000000..82eac7d --- /dev/null +++ b/label/label-to-review/build/generated/sources/annotationProcessor/java/main/com/kamco/cd/kamcoback/postgres/entity/QMapSheetAnalDataInferenceGeomEntity.java @@ -0,0 +1,125 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import static com.querydsl.core.types.PathMetadataFactory.*; + +import com.querydsl.core.types.dsl.*; + +import com.querydsl.core.types.PathMetadata; +import javax.annotation.processing.Generated; +import com.querydsl.core.types.Path; +import com.querydsl.core.types.dsl.PathInits; + + +/** + * QMapSheetAnalDataInferenceGeomEntity is a Querydsl query type for MapSheetAnalDataInferenceGeomEntity + */ +@Generated("com.querydsl.codegen.DefaultEntitySerializer") +public class QMapSheetAnalDataInferenceGeomEntity extends EntityPathBase { + + private static final long serialVersionUID = -1600559932L; + + private static final PathInits INITS = PathInits.DIRECT2; + + public static final QMapSheetAnalDataInferenceGeomEntity mapSheetAnalDataInferenceGeomEntity = new QMapSheetAnalDataInferenceGeomEntity("mapSheetAnalDataInferenceGeomEntity"); + + public final NumberPath area = createNumber("area", Double.class); + + public final ComparablePath beforeGeom = createComparable("beforeGeom", org.locationtech.jts.geom.Geometry.class); + + public final NumberPath cdProb = createNumber("cdProb", Double.class); + + public final StringPath classAfterCd = createString("classAfterCd"); + + public final NumberPath classAfterProb = createNumber("classAfterProb", Double.class); + + public final StringPath classBeforeCd = createString("classBeforeCd"); + + public final NumberPath classBeforeProb = createNumber("classBeforeProb", Double.class); + + public final NumberPath compareYyyy = createNumber("compareYyyy", Integer.class); + + public final DateTimePath createdDttm = createDateTime("createdDttm", java.time.ZonedDateTime.class); + + public final NumberPath createdUid = createNumber("createdUid", Long.class); + + public final NumberPath dataUid = createNumber("dataUid", Long.class); + + public final DateTimePath fileCreatedDttm = createDateTime("fileCreatedDttm", java.time.ZonedDateTime.class); + + public final BooleanPath fileCreatedYn = createBoolean("fileCreatedYn"); + + public final StringPath fitState = createString("fitState"); + + public final StringPath fitStateCmmnt = createString("fitStateCmmnt"); + + public final DateTimePath fitStateDttm = createDateTime("fitStateDttm", java.time.ZonedDateTime.class); + + public final ComparablePath geom = createComparable("geom", org.locationtech.jts.geom.Geometry.class); + + public final ComparablePath geomCenter = createComparable("geomCenter", org.locationtech.jts.geom.Geometry.class); + + public final NumberPath geomCnt = createNumber("geomCnt", Long.class); + + public final StringPath geoType = createString("geoType"); + + public final NumberPath geoUid = createNumber("geoUid", Long.class); + + public final NumberPath labelerUid = createNumber("labelerUid", Long.class); + + public final DateTimePath labelSendDttm = createDateTime("labelSendDttm", java.time.ZonedDateTime.class); + + public final StringPath labelState = createString("labelState"); + + public final DateTimePath labelStateDttm = createDateTime("labelStateDttm", java.time.ZonedDateTime.class); + + public final StringPath lockYn = createString("lockYn"); + + public final QMapInkx5kEntity map5k; + + public final NumberPath mapSheetNum = createNumber("mapSheetNum", Long.class); + + public final NumberPath pnu = createNumber("pnu", Long.class); + + public final NumberPath refMapSheetNum = createNumber("refMapSheetNum", Long.class); + + public final StringPath resultUid = createString("resultUid"); + + public final NumberPath stage = createNumber("stage", Integer.class); + + public final NumberPath targetYyyy = createNumber("targetYyyy", Integer.class); + + public final NumberPath testerUid = createNumber("testerUid", Long.class); + + public final StringPath testState = createString("testState"); + + public final DateTimePath testStateDttm = createDateTime("testStateDttm", java.time.ZonedDateTime.class); + + public final DateTimePath updatedDttm = createDateTime("updatedDttm", java.time.ZonedDateTime.class); + + public final NumberPath updatedUid = createNumber("updatedUid", Long.class); + + public final ComparablePath uuid = createComparable("uuid", java.util.UUID.class); + + public QMapSheetAnalDataInferenceGeomEntity(String variable) { + this(MapSheetAnalDataInferenceGeomEntity.class, forVariable(variable), INITS); + } + + public QMapSheetAnalDataInferenceGeomEntity(Path path) { + this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); + } + + public QMapSheetAnalDataInferenceGeomEntity(PathMetadata metadata) { + this(metadata, PathInits.getFor(metadata, INITS)); + } + + public QMapSheetAnalDataInferenceGeomEntity(PathMetadata metadata, PathInits inits) { + this(MapSheetAnalDataInferenceGeomEntity.class, metadata, inits); + } + + public QMapSheetAnalDataInferenceGeomEntity(Class type, PathMetadata metadata, PathInits inits) { + super(type, metadata, inits); + this.map5k = inits.isInitialized("map5k") ? new QMapInkx5kEntity(forProperty("map5k"), inits.get("map5k")) : null; + } + +} + diff --git a/label/label-to-review/build/libs/label-to-review.jar b/label/label-to-review/build/libs/label-to-review.jar new file mode 100644 index 0000000..c0415ea Binary files /dev/null and b/label/label-to-review/build/libs/label-to-review.jar differ diff --git a/label/label-to-review/build/reports/problems/problems-report.html b/label/label-to-review/build/reports/problems/problems-report.html new file mode 100644 index 0000000..d55fb85 --- /dev/null +++ b/label/label-to-review/build/reports/problems/problems-report.html @@ -0,0 +1,663 @@ + + + + + + + + + + + + + Gradle Configuration Cache + + + +
+ +
+ Loading... +
+ + + + + + diff --git a/label/label-to-review/build/resolvedMainClassName b/label/label-to-review/build/resolvedMainClassName new file mode 100644 index 0000000..d27cb6f --- /dev/null +++ b/label/label-to-review/build/resolvedMainClassName @@ -0,0 +1 @@ +com.kamco.cd.kamcoback.KamcoBackApplication \ No newline at end of file diff --git a/label/label-to-review/build/resources/main/application.yml b/label/label-to-review/build/resources/main/application.yml new file mode 100644 index 0000000..5d1aadc --- /dev/null +++ b/label/label-to-review/build/resources/main/application.yml @@ -0,0 +1,4 @@ +server: + port: 9080 + + diff --git a/label/label-to-review/build/resources/main/application_dev.yml b/label/label-to-review/build/resources/main/application_dev.yml new file mode 100644 index 0000000..a5bc4d9 --- /dev/null +++ b/label/label-to-review/build/resources/main/application_dev.yml @@ -0,0 +1,67 @@ +server: + port: 9080 + +spring: + application: + name: label-to-review + profiles: + active: dev # 사용할 프로파일 지정 (ex. dev, prod, test) + + datasource: + url: jdbc:postgresql://192.168.2.127:15432/kamco_cds + #url: jdbc:postgresql://localhost:5432/kamco_cds + username: kamco_cds + password: kamco_cds_Q!W@E#R$ + hikari: + minimum-idle: 1 + maximum-pool-size: 5 + + jpa: + hibernate: + ddl-auto: update # 테이블이 없으면 생성, 있으면 업데이트 + properties: + hibernate: + jdbc: + batch_size: 50 + default_batch_fetch_size: 100 +logging: + level: + root: INFO + org.springframework.web: DEBUG + org.springframework.security: DEBUG + + # 헬스체크 노이즈 핵심만 다운 + org.springframework.security.web.FilterChainProxy: INFO + org.springframework.security.web.authentication.AnonymousAuthenticationFilter: INFO + org.springframework.security.web.authentication.Http403ForbiddenEntryPoint: INFO + org.springframework.web.servlet.DispatcherServlet: INFO +# actuator +management: + health: + readinessstate: + enabled: true + livenessstate: + enabled: true + endpoint: + health: + probes: + enabled: true + show-details: always + endpoints: + jmx: + exposure: + exclude: "*" + web: + base-path: /monitor + exposure: + include: + - "health" + +file: + #sync-root-dir: D:/kamco-nfs/images/ + sync-root-dir: /kamco-nfs/images/ + sync-tmp-dir: ${file.sync-root-dir}/tmp + sync-file-extention: tfw,tif + sync-auto-exception-start-year: 2025 + sync-auto-exception-before-year-cnt: 3 + diff --git a/label/label-to-review/build/resources/main/application_local.yml b/label/label-to-review/build/resources/main/application_local.yml new file mode 100644 index 0000000..328045e --- /dev/null +++ b/label/label-to-review/build/resources/main/application_local.yml @@ -0,0 +1,67 @@ +server: + port: 9080 + +spring: + application: + name: imagery-make-dataset + profiles: + active: local # 사용할 프로파일 지정 (ex. dev, prod, test) + + datasource: + url: jdbc:postgresql://192.168.2.127:15432/kamco_cds + #url: jdbc:postgresql://localhost:5432/kamco_cds + username: kamco_cds + password: kamco_cds_Q!W@E#R$ + hikari: + minimum-idle: 1 + maximum-pool-size: 5 + + jpa: + hibernate: + ddl-auto: update # 테이블이 없으면 생성, 있으면 업데이트 + properties: + hibernate: + jdbc: + batch_size: 50 + default_batch_fetch_size: 100 +logging: + level: + root: INFO + org.springframework.web: DEBUG + org.springframework.security: DEBUG + + # 헬스체크 노이즈 핵심만 다운 + org.springframework.security.web.FilterChainProxy: INFO + org.springframework.security.web.authentication.AnonymousAuthenticationFilter: INFO + org.springframework.security.web.authentication.Http403ForbiddenEntryPoint: INFO + org.springframework.web.servlet.DispatcherServlet: INFO +# actuator +management: + health: + readinessstate: + enabled: true + livenessstate: + enabled: true + endpoint: + health: + probes: + enabled: true + show-details: always + endpoints: + jmx: + exposure: + exclude: "*" + web: + base-path: /monitor + exposure: + include: + - "health" + +file: + #sync-root-dir: D:/kamco-nfs/images/ + sync-root-dir: /kamco-nfs/images/ + sync-tmp-dir: ${file.sync-root-dir}/tmp + sync-file-extention: tfw,tif + sync-auto-exception-start-year: 2025 + sync-auto-exception-before-year-cnt: 3 + diff --git a/label/label-to-review/build/resources/main/application_prod.yml b/label/label-to-review/build/resources/main/application_prod.yml new file mode 100644 index 0000000..1282d26 --- /dev/null +++ b/label/label-to-review/build/resources/main/application_prod.yml @@ -0,0 +1,67 @@ +server: + port: 9080 + +spring: + application: + name: imagery-make-dataset + profiles: + active: prod # 사용할 프로파일 지정 (ex. dev, prod, test) + + datasource: + url: jdbc:postgresql://192.168.2.127:15432/kamco_cds + #url: jdbc:postgresql://localhost:5432/kamco_cds + username: kamco_cds + password: kamco_cds_Q!W@E#R$ + hikari: + minimum-idle: 1 + maximum-pool-size: 5 + + jpa: + hibernate: + ddl-auto: update # 테이블이 없으면 생성, 있으면 업데이트 + properties: + hibernate: + jdbc: + batch_size: 50 + default_batch_fetch_size: 100 +logging: + level: + root: INFO + org.springframework.web: DEBUG + org.springframework.security: DEBUG + + # 헬스체크 노이즈 핵심만 다운 + org.springframework.security.web.FilterChainProxy: INFO + org.springframework.security.web.authentication.AnonymousAuthenticationFilter: INFO + org.springframework.security.web.authentication.Http403ForbiddenEntryPoint: INFO + org.springframework.web.servlet.DispatcherServlet: INFO +# actuator +management: + health: + readinessstate: + enabled: true + livenessstate: + enabled: true + endpoint: + health: + probes: + enabled: true + show-details: always + endpoints: + jmx: + exposure: + exclude: "*" + web: + base-path: /monitor + exposure: + include: + - "health" + +file: + #sync-root-dir: D:/kamco-nfs/images/ + sync-root-dir: /kamco-nfs/images/ + sync-tmp-dir: ${file.sync-root-dir}/tmp + sync-file-extention: tfw,tif + sync-auto-exception-start-year: 2025 + sync-auto-exception-before-year-cnt: 3 + diff --git a/label/label-to-review/build/resources/main/static/chunk_upload_test.html b/label/label-to-review/build/resources/main/static/chunk_upload_test.html new file mode 100644 index 0000000..2c331d4 --- /dev/null +++ b/label/label-to-review/build/resources/main/static/chunk_upload_test.html @@ -0,0 +1,137 @@ + + + + + Chunk Upload Test + + +

대용량 파일 청크 업로드 테스트

+ +* Chunk 테스트 사이즈 10M (10 * 1024 * 1024) - 성능에 따라 변경가능

+ +* 업로드 API선택

+ +

+* 파일첨부

+

+ +



+* 업로드시 업로드 이력을 추적하기 위해 UUID생성해서 전달(파일병합시 사용)(script 예제참고)

+UUID :

+ +* API 호출시 파일정보 추출해서 자동 할당해야 함.(script 예제참고)

+chunkIndex :

+chunkTotalIndex :

+ +* API 호출시 파일정보 추출해서 자동 할당해야 함.(script 예제참고)

+fileSize :

+ + + +

+* 진행율(%)

+
+

+* 결과메세지

+
+ + + + diff --git a/label/label-to-review/build/tmp/bootJar/MANIFEST.MF b/label/label-to-review/build/tmp/bootJar/MANIFEST.MF new file mode 100644 index 0000000..21c8aaa --- /dev/null +++ b/label/label-to-review/build/tmp/bootJar/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Main-Class: org.springframework.boot.loader.launch.JarLauncher +Start-Class: com.kamco.cd.kamcoback.KamcoBackApplication +Spring-Boot-Version: 3.5.7 +Spring-Boot-Classes: BOOT-INF/classes/ +Spring-Boot-Lib: BOOT-INF/lib/ +Spring-Boot-Classpath-Index: BOOT-INF/classpath.idx +Spring-Boot-Layers-Index: BOOT-INF/layers.idx +Build-Jdk-Spec: 21 +Implementation-Title: kamco-label-to-review-job +Implementation-Version: 0.0.1-SNAPSHOT + diff --git a/label/label-to-review/build/tmp/compileJava/previous-compilation-data.bin b/label/label-to-review/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..de6142c Binary files /dev/null and b/label/label-to-review/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/label/label-to-review/build/tmp/spotless-register-dependencies b/label/label-to-review/build/tmp/spotless-register-dependencies new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/label/label-to-review/build/tmp/spotless-register-dependencies @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/label/label-to-review/dev.backup b/label/label-to-review/dev.backup new file mode 100644 index 0000000..e69de29 diff --git a/label/label-to-review/docker-compose-dev.yml b/label/label-to-review/docker-compose-dev.yml new file mode 100644 index 0000000..40b4346 --- /dev/null +++ b/label/label-to-review/docker-compose-dev.yml @@ -0,0 +1,35 @@ +services: + kamco-changedetection-api: + build: + context: . + dockerfile: Dockerfile-dev + args: + UID: 1000 # manager01 UID + GID: 1000 # manager01 GID + image: kamco-changedetection-api:${IMAGE_TAG:-latest} + container_name: kamco-changedetection-api + user: "1000:1000" + ports: + - "7100:8080" + environment: + - SPRING_PROFILES_ACTIVE=dev + - TZ=Asia/Seoul + volumes: + - /mnt/nfs_share/images:/app/original-images + - /mnt/nfs_share/model_output:/app/model-outputs + - /mnt/nfs_share/train_dataset:/app/train-dataset + - /mnt/nfs_share/tmp:/app/tmp + - /kamco-nfs:/kamco-nfs + networks: + - kamco-cds + restart: unless-stopped + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8080/monitor/health" ] + interval: 10s + timeout: 5s + retries: 5 + start_period: 40s + +networks: + kamco-cds: + external: true diff --git a/label/label-to-review/gradle/wrapper/gradle-wrapper.jar b/label/label-to-review/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..1b33c55 Binary files /dev/null and b/label/label-to-review/gradle/wrapper/gradle-wrapper.jar differ diff --git a/label/label-to-review/gradle/wrapper/gradle-wrapper.properties b/label/label-to-review/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ca025c8 --- /dev/null +++ b/label/label-to-review/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/label/label-to-review/gradlew b/label/label-to-review/gradlew new file mode 100644 index 0000000..23d15a9 --- /dev/null +++ b/label/label-to-review/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/label/label-to-review/gradlew.bat b/label/label-to-review/gradlew.bat new file mode 100644 index 0000000..db3a6ac --- /dev/null +++ b/label/label-to-review/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/label/label-to-review/http/CommonCode.http b/label/label-to-review/http/CommonCode.http new file mode 100644 index 0000000..6083e22 --- /dev/null +++ b/label/label-to-review/http/CommonCode.http @@ -0,0 +1,4 @@ +### GET getByCodeId +GET http://localhost:8080/api/code/1 +Content-Type: application/json +### diff --git a/label/label-to-review/intellij-java-google-style.xml b/label/label-to-review/intellij-java-google-style.xml new file mode 100644 index 0000000..d63d731 --- /dev/null +++ b/label/label-to-review/intellij-java-google-style.xml @@ -0,0 +1,598 @@ + + + + + + diff --git a/label/label-to-review/pack_offline_bundle_airgap_macos.sh b/label/label-to-review/pack_offline_bundle_airgap_macos.sh new file mode 100644 index 0000000..1a34086 --- /dev/null +++ b/label/label-to-review/pack_offline_bundle_airgap_macos.sh @@ -0,0 +1,571 @@ +#!/bin/bash +# pack_offline_bundle_airgap_macos.sh +# ============================================================================ +# Gradle Offline Bundle Packer (macOS) +# ============================================================================ +# Version: 4.0 +# +# WORKFLOW: +# 1. [ONLINE] Build project (./gradlew bootJar) - downloads all deps +# 2. [ONLINE] Test run (./gradlew bootRun) - verify app works +# 3. [OFFLINE TEST] Verify offline build works +# 4. Create bundle with all cached dependencies +# +# REQUIREMENTS: +# - Internet connection (for initial build) +# - Project with gradlew +# - macOS 10.13+ (High Sierra or later) +# ============================================================================ + +set -e + +# ============================================================================ +# Configuration +# ============================================================================ +WRAPPER_SEED_PATH="wrapper_jar_seed" +OFFLINE_HOME_NAME="_offline_gradle_home" +BOOTRUN_TIMEOUT_SECONDS=60 + +# Color codes +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +CYAN='\033[0;36m' +GRAY='\033[0;90m' +WHITE='\033[1;37m' +NC='\033[0m' # No Color + +echo "" +echo -e "${CYAN}============================================================${NC}" +echo -e "${CYAN} Gradle Offline Bundle Packer v4.0 (macOS)${NC}" +echo -e "${CYAN}============================================================${NC}" +echo "" +echo -e "${WHITE} This script will:${NC}" +echo -e "${GRAY} 1. Build project with internet (download dependencies)${NC}" +echo -e "${GRAY} 2. Test run application (verify it works)${NC}" +echo -e "${GRAY} 3. Test offline build (verify cache is complete)${NC}" +echo -e "${GRAY} 4. Create offline bundle for air-gapped environment${NC}" +echo "" +echo -e "${CYAN}============================================================${NC}" +echo "" + +# ============================================================================ +# [1/20] Check Current Directory +# ============================================================================ +echo -e "${YELLOW}==[1/20] Check Current Directory ==${NC}" +ROOT="$(pwd)" +echo "ROOT_DIR: $ROOT" +echo "" + +# ============================================================================ +# [2/20] Check Required Files +# ============================================================================ +echo -e "${YELLOW}==[2/20] Check Required Files ==${NC}" + +if [ ! -f "./gradlew" ]; then + echo -e "${RED}ERROR: gradlew not found. Run from project root.${NC}" + exit 1 +fi +chmod +x ./gradlew +echo -e "${GREEN}[OK] gradlew${NC}" + +BUILD_FILE="" +if [ -f "./build.gradle" ]; then + BUILD_FILE="build.gradle" +elif [ -f "./build.gradle.kts" ]; then + BUILD_FILE="build.gradle.kts" +else + echo -e "${RED}ERROR: build.gradle(.kts) not found.${NC}" + exit 1 +fi +echo -e "${GREEN}[OK] $BUILD_FILE${NC}" + +SETTINGS_FILE="" +if [ -f "./settings.gradle" ]; then + SETTINGS_FILE="settings.gradle" + echo -e "${GREEN}[OK] $SETTINGS_FILE${NC}" +elif [ -f "./settings.gradle.kts" ]; then + SETTINGS_FILE="settings.gradle.kts" + echo -e "${GREEN}[OK] $SETTINGS_FILE${NC}" +fi +echo "" + +# ============================================================================ +# [3/20] Check Gradle Wrapper +# ============================================================================ +echo -e "${YELLOW}==[3/20] Check Gradle Wrapper ==${NC}" + +WRAPPER_DIR="$ROOT/gradle/wrapper" +WRAPPER_JAR="$WRAPPER_DIR/gradle-wrapper.jar" +WRAPPER_PROP="$WRAPPER_DIR/gradle-wrapper.properties" + +mkdir -p "$WRAPPER_DIR" + +if [ ! -f "$WRAPPER_PROP" ]; then + echo -e "${RED}ERROR: gradle-wrapper.properties not found.${NC}" + exit 1 +fi + +if [ ! -f "$WRAPPER_JAR" ]; then + SEED_JAR="$ROOT/$WRAPPER_SEED_PATH/gradle-wrapper.jar" + if [ -f "$SEED_JAR" ]; then + cp "$SEED_JAR" "$WRAPPER_JAR" + echo -e "${GREEN}[OK] Wrapper jar injected from seed${NC}" + else + echo -e "${RED}ERROR: gradle-wrapper.jar missing${NC}" + exit 1 + fi +else + echo -e "${GREEN}[OK] gradle-wrapper.jar exists${NC}" +fi + +# Create seed backup +SEED_DIR="$ROOT/$WRAPPER_SEED_PATH" +if [ ! -d "$SEED_DIR" ]; then + mkdir -p "$SEED_DIR" + cp "$WRAPPER_JAR" "$SEED_DIR/gradle-wrapper.jar" +fi +echo "" + +# ============================================================================ +# [4/20] Set GRADLE_USER_HOME (Project Local) +# ============================================================================ +echo -e "${YELLOW}==[4/20] Set GRADLE_USER_HOME ==${NC}" + +OFFLINE_HOME="$ROOT/$OFFLINE_HOME_NAME" +mkdir -p "$OFFLINE_HOME" +export GRADLE_USER_HOME="$OFFLINE_HOME" + +echo -e "${CYAN}GRADLE_USER_HOME = $GRADLE_USER_HOME${NC}" +echo -e "${GRAY}[INFO] All dependencies will be cached in project folder${NC}" +echo "" + +# ============================================================================ +# [5/20] Check Internet Connection +# ============================================================================ +echo -e "${YELLOW}==[5/20] Check Internet Connection ==${NC}" + +HAS_INTERNET=false +TEST_HOSTS=("plugins.gradle.org" "repo.maven.apache.org" "repo1.maven.org") + +for TEST_HOST in "${TEST_HOSTS[@]}"; do + # macOS ping doesn't have -W, use -t instead + if ping -c 1 -t 3 "$TEST_HOST" &>/dev/null; then + HAS_INTERNET=true + echo -e "${GREEN}[OK] Connected to $TEST_HOST${NC}" + break + fi +done + +if [ "$HAS_INTERNET" = false ]; then + # Try DNS resolution as fallback + if nslookup google.com &>/dev/null || host google.com &>/dev/null; then + HAS_INTERNET=true + echo -e "${GREEN}[OK] Internet available (DNS)${NC}" + fi +fi + +if [ "$HAS_INTERNET" = false ]; then + echo "" + echo -e "${RED}============================================================${NC}" + echo -e "${RED} ERROR: No Internet Connection!${NC}" + echo -e "${RED}============================================================${NC}" + echo "" + echo -e "${YELLOW}This script requires internet for initial build.${NC}" + echo -e "${YELLOW}Please connect to internet and run again.${NC}" + echo "" + exit 1 +fi +echo "" + +# ============================================================================ +# [6/20] Initial Gradle Setup +# ============================================================================ +echo -e "${YELLOW}==[6/20] Initial Gradle Setup ==${NC}" +echo -e "${GRAY}[INFO] Downloading Gradle distribution...${NC}" + +if ./gradlew --version &>/dev/null; then + GRADLE_VERSION=$(./gradlew --version 2>&1 | grep "^Gradle" | awk '{print $2}') + echo -e "${GREEN}[OK] Gradle $GRADLE_VERSION${NC}" +else + echo -e "${RED}[ERROR] Gradle setup failed${NC}" + exit 1 +fi +echo "" + +# ============================================================================ +# [7/20] ONLINE BUILD - bootJar (Download All Dependencies) +# ============================================================================ +echo -e "${YELLOW}==[7/20] ONLINE BUILD - bootJar ==${NC}" +echo "" +echo -e "${CYAN}============================================================${NC}" +echo -e "${CYAN} ONLINE BUILD (with Internet)${NC}" +echo -e "${CYAN} Downloading all dependencies to local cache${NC}" +echo -e "${CYAN}============================================================${NC}" +echo "" + +BUILD_SUCCESS=false + +./gradlew clean bootJar --no-daemon +if [ $? -eq 0 ]; then + BUILD_SUCCESS=true + echo "" + echo -e "${GREEN}============================================================${NC}" + echo -e "${GREEN} ONLINE BUILD SUCCESS!${NC}" + echo -e "${GREEN}============================================================${NC}" + echo "" + + if [ -d "./build/libs" ]; then + echo -e "${CYAN}JAR files:${NC}" + ls -lh ./build/libs/*.jar 2>/dev/null | awk '{print " " $9 " (" $5 ")"}' + fi +else + echo "" + echo -e "${RED}============================================================${NC}" + echo -e "${RED} BUILD FAILED!${NC}" + echo -e "${RED}============================================================${NC}" + echo "" + echo -e "${YELLOW}Build failed. Cannot continue.${NC}" + exit 1 +fi +echo "" + +# ============================================================================ +# [8/20] Stop Daemons +# ============================================================================ +echo -e "${YELLOW}==[8/20] Stop Daemons ==${NC}" + +./gradlew --stop &>/dev/null || true +sleep 2 +echo -e "${GREEN}[OK] Daemons stopped${NC}" +echo "" + +# ============================================================================ +# [9/20] ONLINE TEST - bootRun (Verify Application Works) +# ============================================================================ +echo -e "${YELLOW}==[9/20] ONLINE TEST - bootRun ==${NC}" +echo "" +echo -e "${CYAN}============================================================${NC}" +echo -e "${CYAN} Testing application startup (timeout: ${BOOTRUN_TIMEOUT_SECONDS}s)${NC}" +echo -e "${CYAN} Will automatically stop after successful startup${NC}" +echo -e "${CYAN}============================================================${NC}" +echo "" + +BOOTRUN_SUCCESS=false + +# macOS uses gtimeout if available, otherwise perl-based timeout +if command -v gtimeout &>/dev/null; then + gtimeout ${BOOTRUN_TIMEOUT_SECONDS}s ./gradlew bootRun --no-daemon & +else + # Fallback: start in background and kill after timeout + ./gradlew bootRun --no-daemon & +fi +BOOTRUN_PID=$! + +sleep 10 + +if ps -p $BOOTRUN_PID &>/dev/null; then + BOOTRUN_SUCCESS=true + echo "" + echo -e "${GREEN}[OK] Application started successfully${NC}" + kill $BOOTRUN_PID &>/dev/null || true + sleep 2 +else + echo "" + echo -e "${YELLOW}[WARN] Application may not have started properly${NC}" +fi + +# Cleanup - macOS process cleanup +pkill -f "gradle.*bootRun" &>/dev/null || true +sleep 2 +echo "" + +# ============================================================================ +# [10/20] Stop Daemons Again +# ============================================================================ +echo -e "${YELLOW}==[10/20] Stop Daemons Again ==${NC}" + +./gradlew --stop &>/dev/null || true +sleep 2 +echo -e "${GREEN}[OK] Daemons stopped${NC}" +echo "" + +# ============================================================================ +# [11/20] OFFLINE BUILD TEST (Verify Cache Completeness) +# ============================================================================ +echo -e "${YELLOW}==[11/20] OFFLINE BUILD TEST ==${NC}" +echo "" +echo -e "${CYAN}============================================================${NC}" +echo -e "${CYAN} OFFLINE BUILD TEST (--offline flag)${NC}" +echo -e "${CYAN} Verifying all dependencies are cached${NC}" +echo -e "${CYAN}============================================================${NC}" +echo "" + +OFFLINE_SUCCESS=false + +./gradlew clean bootJar --offline --no-daemon +if [ $? -eq 0 ]; then + OFFLINE_SUCCESS=true + echo "" + echo -e "${GREEN}============================================================${NC}" + echo -e "${GREEN} OFFLINE BUILD TEST PASSED!${NC}" + echo -e "${GREEN}============================================================${NC}" + echo "" + echo -e "${GREEN}[OK] All dependencies are cached${NC}" +else + echo "" + echo -e "${RED}============================================================${NC}" + echo -e "${RED} OFFLINE BUILD TEST FAILED!${NC}" + echo -e "${RED}============================================================${NC}" + echo "" + echo -e "${YELLOW}Some dependencies may be missing from cache.${NC}" + echo -e "${YELLOW}The bundle may not work in air-gapped environment.${NC}" + echo "" + + read -p "Continue anyway? (y/N): " -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + exit 1 + fi +fi +echo "" + +# ============================================================================ +# [12/20] Stop Daemons Before Archive +# ============================================================================ +echo -e "${YELLOW}==[12/20] Stop Daemons Before Archive ==${NC}" + +./gradlew --stop &>/dev/null || true +sleep 2 +echo -e "${GREEN}[OK] Daemons stopped${NC}" +echo "" + +# ============================================================================ +# [13/20] Verify settings.gradle for Offline +# ============================================================================ +echo -e "${YELLOW}==[13/20] Verify settings.gradle ==${NC}" + +if [ -n "$SETTINGS_FILE" ]; then + if grep -q "mavenLocal()" "$SETTINGS_FILE" && grep -q "pluginManagement" "$SETTINGS_FILE"; then + echo -e "${GREEN}[OK] settings.gradle configured for offline${NC}" + else + echo -e "${YELLOW}[WARN] settings.gradle may need offline configuration${NC}" + echo -e "${GRAY}[INFO] Consider adding mavenLocal() to pluginManagement and repositories${NC}" + fi +else + echo -e "${GRAY}[INFO] No settings.gradle found${NC}" +fi +echo "" + +# ============================================================================ +# [14/20] Create Helper Scripts +# ============================================================================ +echo -e "${YELLOW}==[14/20] Create Helper Scripts ==${NC}" + +# run_offline_build.sh +cat > "$ROOT/run_offline_build.sh" << 'EOF' +#!/bin/bash +# run_offline_build.sh - Build JAR offline +export GRADLE_USER_HOME="$(pwd)/_offline_gradle_home" +echo "GRADLE_USER_HOME = $GRADLE_USER_HOME" +echo "" +./gradlew --offline bootJar --no-daemon +if [ $? -eq 0 ]; then + echo "" + echo "BUILD SUCCESS!" + echo "" + echo "JAR files:" + ls -lh ./build/libs/*.jar 2>/dev/null | awk '{print " " $9}' +else + echo "BUILD FAILED" +fi +EOF +chmod +x "$ROOT/run_offline_build.sh" +echo -e "${GREEN}[OK] run_offline_build.sh${NC}" + +# run_offline_bootrun.sh +cat > "$ROOT/run_offline_bootrun.sh" << 'EOF' +#!/bin/bash +# run_offline_bootrun.sh - Run application offline +export GRADLE_USER_HOME="$(pwd)/_offline_gradle_home" +echo "GRADLE_USER_HOME = $GRADLE_USER_HOME" +echo "" +echo "Starting application (Ctrl+C to stop)..." +echo "" +./gradlew --offline bootRun --no-daemon +EOF +chmod +x "$ROOT/run_offline_bootrun.sh" +echo -e "${GREEN}[OK] run_offline_bootrun.sh${NC}" +echo "" + +# ============================================================================ +# [15/20] Final Daemon Cleanup +# ============================================================================ +echo -e "${YELLOW}==[15/20] Final Daemon Cleanup ==${NC}" + +./gradlew --stop &>/dev/null || true +sleep 2 +echo -e "${GREEN}[OK] Daemons stopped${NC}" +echo "" + +# ============================================================================ +# [16/20] Clean Lock Files +# ============================================================================ +echo -e "${YELLOW}==[16/20] Clean Lock Files ==${NC}" + +DAEMON_DIR="$OFFLINE_HOME/daemon" +if [ -d "$DAEMON_DIR" ]; then + rm -rf "$DAEMON_DIR" 2>/dev/null || true +fi + +find "$OFFLINE_HOME" -type f \( -name "*.lock" -o -name "*.log" -o -name "*.tmp" \) -delete 2>/dev/null || true + +echo -e "${GREEN}[OK] Lock files cleaned${NC}" +echo "" + +# ============================================================================ +# [17/20] Calculate Cache Size +# ============================================================================ +echo -e "${YELLOW}==[17/20] Cache Summary ==${NC}" + +CACHES_DIR="$OFFLINE_HOME/caches" +WRAPPER_DISTS="$OFFLINE_HOME/wrapper/dists" + +TOTAL_SIZE=0 + +if [ -d "$CACHES_DIR" ]; then + # macOS uses different options for du + if du -k "$CACHES_DIR" &>/dev/null; then + SIZE=$(du -sk "$CACHES_DIR" 2>/dev/null | cut -f1) + SIZE=$((SIZE * 1024)) # Convert to bytes + else + SIZE=0 + fi + TOTAL_SIZE=$((TOTAL_SIZE + SIZE)) + SIZE_MB=$(awk "BEGIN {printf \"%.2f\", $SIZE / 1048576}") + echo -e "${CYAN}[INFO] Dependencies: ${SIZE_MB} MB${NC}" +fi + +if [ -d "$WRAPPER_DISTS" ]; then + if du -k "$WRAPPER_DISTS" &>/dev/null; then + SIZE=$(du -sk "$WRAPPER_DISTS" 2>/dev/null | cut -f1) + SIZE=$((SIZE * 1024)) + else + SIZE=0 + fi + TOTAL_SIZE=$((TOTAL_SIZE + SIZE)) + SIZE_MB=$(awk "BEGIN {printf \"%.2f\", $SIZE / 1048576}") + echo -e "${CYAN}[INFO] Gradle dist: ${SIZE_MB} MB${NC}" +fi + +TOTAL_MB=$(awk "BEGIN {printf \"%.2f\", $TOTAL_SIZE / 1048576}") +echo -e "${CYAN}[INFO] Total cache: ${TOTAL_MB} MB${NC}" +echo "" + +# ============================================================================ +# [18/20] Create Archive +# ============================================================================ +echo -e "${YELLOW}==[18/20] Create Archive ==${NC}" + +BASE_NAME=$(basename "$ROOT") +TIMESTAMP=$(date +"%Y%m%d_%H%M%S") +PARENT=$(dirname "$ROOT") +ARCHIVE_PATH="${PARENT}/${BASE_NAME}_offline_bundle_${TIMESTAMP}.tar.gz" + +echo "Archive: $ARCHIVE_PATH" +echo -e "${GRAY}[INFO] Creating archive (this may take several minutes)...${NC}" + +# macOS tar with BSD options +tar -czf "$ARCHIVE_PATH" \ + --exclude=".git" \ + --exclude=".idea" \ + --exclude=".DS_Store" \ + --exclude="*.log" \ + --exclude="*.lock" \ + --exclude="_offline_gradle_home/daemon" \ + --exclude="_offline_gradle_home/native" \ + --exclude="_offline_gradle_home/jdks" \ + --exclude="build" \ + --exclude="out" \ + --exclude=".gradle" \ + -C "$ROOT" . + +if [ $? -ne 0 ]; then + echo -e "${RED}ERROR: tar failed${NC}" + exit 1 +fi + +# macOS stat command +ARCHIVE_SIZE=$(stat -f%z "$ARCHIVE_PATH" 2>/dev/null) +ARCHIVE_SIZE_MB=$(awk "BEGIN {printf \"%.2f\", $ARCHIVE_SIZE / 1048576}") +echo -e "${GREEN}[OK] Archive created: ${ARCHIVE_SIZE_MB} MB${NC}" +echo "" + +# ============================================================================ +# [19/20] Verify Archive +# ============================================================================ +echo -e "${YELLOW}==[19/20] Verify Archive ==${NC}" + +CHECKS=( + "gradle/wrapper/gradle-wrapper.jar" + "gradlew" + "_offline_gradle_home/caches" + "run_offline_build.sh" +) + +for CHECK in "${CHECKS[@]}"; do + if tar -tzf "$ARCHIVE_PATH" | grep -q "$CHECK"; then + echo -e " ${GREEN}[OK] $CHECK${NC}" + else + echo -e " ${YELLOW}[WARN] $CHECK${NC}" + fi +done +echo "" + +# ============================================================================ +# [20/20] Complete +# ============================================================================ +echo -e "${GREEN}============================================================${NC}" +echo -e "${GREEN} BUNDLE CREATION COMPLETE!${NC}" +echo -e "${GREEN}============================================================${NC}" +echo "" +echo -e "${CYAN}Archive: $ARCHIVE_PATH${NC}" +echo -e "${CYAN}Size: ${ARCHIVE_SIZE_MB} MB${NC}" +echo "" + +echo -e "${CYAN}============================================================${NC}" +echo -e "${CYAN} Test Results${NC}" +echo -e "${CYAN}============================================================${NC}" +if [ "$BUILD_SUCCESS" = true ]; then + echo -e " Online build (bootJar): ${GREEN}PASSED${NC}" +else + echo -e " Online build (bootJar): ${RED}FAILED${NC}" +fi +if [ "$BOOTRUN_SUCCESS" = true ]; then + echo -e " Online test (bootRun): ${GREEN}PASSED${NC}" +else + echo -e " Online test (bootRun): ${YELLOW}SKIPPED${NC}" +fi +if [ "$OFFLINE_SUCCESS" = true ]; then + echo -e " Offline build test: ${GREEN}PASSED${NC}" +else + echo -e " Offline build test: ${RED}FAILED${NC}" +fi +echo "" + +echo -e "${YELLOW}============================================================${NC}" +echo -e "${YELLOW} Usage in Air-gapped Environment${NC}" +echo -e "${YELLOW}============================================================${NC}" +echo "" +echo -e "${WHITE}Option 1: Use unpack script${NC}" +echo -e "${GRAY} ./unpack_and_offline_build_airgap.sh${NC}" +echo "" +echo -e "${WHITE}Option 2: Manual extraction${NC}" +echo -e "${GRAY} tar -xzf .tar.gz${NC}" +echo -e "${GRAY} cd ${NC}" +echo -e "${GRAY} ./run_offline_build.sh${NC}" +echo "" +echo -e "${WHITE}Option 3: Direct commands${NC}" +echo -e "${GRAY} export GRADLE_USER_HOME=\"./_offline_gradle_home\"${NC}" +echo -e "${GRAY} ./gradlew --offline bootJar --no-daemon${NC}" +echo "" diff --git a/label/label-to-review/settings.gradle b/label/label-to-review/settings.gradle new file mode 100644 index 0000000..23e87e5 --- /dev/null +++ b/label/label-to-review/settings.gradle @@ -0,0 +1,6 @@ +pluginManagement { + plugins { + id 'org.jetbrains.kotlin.jvm' version '2.2.20' + } +} +rootProject.name = 'kamco-label-to-review-job' diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/KamcoBackApplication.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/KamcoBackApplication.java new file mode 100644 index 0000000..c6b1ae0 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/KamcoBackApplication.java @@ -0,0 +1,14 @@ +package com.kamco.cd.kamcoback; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; + +@SpringBootApplication +@EnableScheduling +public class KamcoBackApplication { + + public static void main(String[] args) { + SpringApplication.run(KamcoBackApplication.class, args); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/code/dto/CommonCodeDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/code/dto/CommonCodeDto.java new file mode 100644 index 0000000..baa9fdc --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/code/dto/CommonCodeDto.java @@ -0,0 +1,189 @@ +package com.kamco.cd.kamcoback.code.dto; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.kamco.cd.kamcoback.common.utils.html.HtmlEscapeDeserializer; +import com.kamco.cd.kamcoback.common.utils.html.HtmlUnescapeSerializer; +import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import java.time.ZonedDateTime; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; + +public class CommonCodeDto { + + @Schema(name = "CodeAddReq", description = "공통코드 저장 정보") + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class AddReq { + + @NotEmpty private String code; + @NotEmpty private String name; + private String description; + private int order; + private boolean used; + private Long parentId; + + @JsonDeserialize(using = HtmlEscapeDeserializer.class) + private String props1; + + @JsonDeserialize(using = HtmlEscapeDeserializer.class) + private String props2; + + @JsonDeserialize(using = HtmlEscapeDeserializer.class) + private String props3; + } + + @Schema(name = "CodeModifyReq", description = "공통코드 수정 정보") + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class ModifyReq { + + @NotEmpty private String name; + private String description; + private boolean used; + + @JsonDeserialize(using = HtmlEscapeDeserializer.class) + private String props1; + + @JsonDeserialize(using = HtmlEscapeDeserializer.class) + private String props2; + + @JsonDeserialize(using = HtmlEscapeDeserializer.class) + private String props3; + } + + @Schema(name = "CodeOrderReq", description = "공통코드 순서 변경 정보") + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class OrderReq { + + @NotNull private Long id; + @NotNull private Integer order; + } + + @Schema(name = "CommonCode Basic", description = "공통코드 기본 정보") + @Getter + public static class Basic { + + private Long id; + private String code; + private String description; + private String name; + private Integer order; + private Boolean used; + private Boolean deleted; + private List children; + + @JsonFormatDttm private ZonedDateTime createdDttm; + + @JsonFormatDttm private ZonedDateTime updatedDttm; + + @JsonSerialize(using = HtmlUnescapeSerializer.class) + private String props1; + + @JsonSerialize(using = HtmlUnescapeSerializer.class) + private String props2; + + @JsonSerialize(using = HtmlUnescapeSerializer.class) + private String props3; + + @JsonFormatDttm private ZonedDateTime deletedDttm; + + public Basic( + Long id, + String code, + String description, + String name, + Integer order, + Boolean used, + Boolean deleted, + List children, + ZonedDateTime createdDttm, + ZonedDateTime updatedDttm, + String props1, + String props2, + String props3, + ZonedDateTime deletedDttm) { + this.id = id; + this.code = code; + this.description = description; + this.name = name; + this.order = order; + this.used = used; + this.deleted = deleted; + this.children = children; + this.createdDttm = createdDttm; + this.updatedDttm = updatedDttm; + this.props1 = props1; + this.props2 = props2; + this.props3 = props3; + this.deletedDttm = deletedDttm; + } + } + + @Schema(name = "SearchReq", description = "검색 요청") + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class SearchReq { + + // 검색 조건 + private String name; + + // 페이징 파라미터 + private int page = 0; + private int size = 20; + private String sort; + + public Pageable toPageable() { + if (sort != null && !sort.isEmpty()) { + String[] sortParams = sort.split(","); + String property = sortParams[0]; + Sort.Direction direction = + sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC; + return PageRequest.of(page, size, Sort.by(direction, property)); + } + return PageRequest.of(page, size); + } + } + + @Getter + public static class Clazzes { + + private String code; + private String name; + private Integer order; + private String color; + + public Clazzes(String code, String name, Integer order, String color) { + this.code = code; + this.name = name; + this.order = order; + this.color = color; + } + } + + @Getter + @AllArgsConstructor + public static class CodeDto { + + private String code; + private String name; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/CodeDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/CodeDto.java new file mode 100644 index 0000000..c77d1a2 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/CodeDto.java @@ -0,0 +1,20 @@ +package com.kamco.cd.kamcoback.common.utils.enums; + +public class CodeDto { + + private String code; + private String name; + + public CodeDto(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/CodeExpose.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/CodeExpose.java new file mode 100644 index 0000000..425e1f8 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/CodeExpose.java @@ -0,0 +1,10 @@ +package com.kamco.cd.kamcoback.common.utils.enums; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface CodeExpose {} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/CodeHidden.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/CodeHidden.java new file mode 100644 index 0000000..ad320cd --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/CodeHidden.java @@ -0,0 +1,10 @@ +package com.kamco.cd.kamcoback.common.utils.enums; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface CodeHidden {} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/EnumType.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/EnumType.java new file mode 100644 index 0000000..22761bb --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/EnumType.java @@ -0,0 +1,8 @@ +package com.kamco.cd.kamcoback.common.utils.enums; + +public interface EnumType { + + String getId(); + + String getText(); +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/EnumValidator.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/EnumValidator.java new file mode 100644 index 0000000..344fb02 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/EnumValidator.java @@ -0,0 +1,26 @@ +package com.kamco.cd.kamcoback.common.utils.enums; + +import com.kamco.cd.kamcoback.common.utils.interfaces.EnumValid; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; +import java.util.Arrays; +import java.util.Set; +import java.util.stream.Collectors; + +public class EnumValidator implements ConstraintValidator { + + private Set acceptedValues; + + @Override + public void initialize(EnumValid constraintAnnotation) { + acceptedValues = + Arrays.stream(constraintAnnotation.enumClass().getEnumConstants()) + .map(Enum::name) + .collect(Collectors.toSet()); + } + + @Override + public boolean isValid(String value, ConstraintValidatorContext context) { + return value != null && acceptedValues.contains(value); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/Enums.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/Enums.java new file mode 100644 index 0000000..97f2b3f --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/Enums.java @@ -0,0 +1,84 @@ +package com.kamco.cd.kamcoback.common.utils.enums; + +import com.kamco.cd.kamcoback.code.dto.CommonCodeDto.CodeDto; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.reflections.Reflections; + +public class Enums { + + private static final String BASE_PACKAGE = "com.kamco.cd.kamcoback"; + + /** 노출 가능한 enum만 모아둔 맵 key: enum simpleName (예: RoleType) value: enum Class */ + private static final Map>> exposedEnumMap = scanExposedEnumMap(); + + // code로 enum 찾기 + public static & EnumType> E fromId(Class enumClass, String id) { + if (id == null) { + return null; + } + + for (E e : enumClass.getEnumConstants()) { + if (id.equalsIgnoreCase(e.getId())) { + return e; + } + } + return null; + } + + // enum -> CodeDto list + public static List toList(Class> enumClass) { + Object[] enums = enumClass.getEnumConstants(); + + return Arrays.stream(enums) + .map(e -> (EnumType) e) + .filter(e -> !isHidden(enumClass, (Enum) e)) + .map(e -> new CodeDto(e.getId(), e.getText())) + .toList(); + } + + private static boolean isHidden(Class> enumClass, Enum e) { + try { + return enumClass.getField(e.name()).isAnnotationPresent(CodeHidden.class); + } catch (NoSuchFieldException ex) { + return false; + } + } + + /** 특정 타입(enum)만 조회 /codes/{type} -> type = RoleType 같은 값 */ + public static List getCodes(String type) { + Class> enumClass = exposedEnumMap.get(type); + if (enumClass == null) { + throw new IllegalArgumentException("지원하지 않는 코드 타입: " + type); + } + return toList(enumClass); + } + + /** 전체 enum 코드 조회 */ + public static Map> getAllCodes() { + Map> result = new HashMap<>(); + for (Map.Entry>> e : exposedEnumMap.entrySet()) { + result.put(e.getKey(), toList(e.getValue())); + } + return result; + } + + /** CodeExpose + EnumType 인 enum만 스캔해서 Map 구성 */ + private static Map>> scanExposedEnumMap() { + Reflections reflections = new Reflections(BASE_PACKAGE); + + Set> types = reflections.getTypesAnnotatedWith(CodeExpose.class); + + Map>> result = new HashMap<>(); + + for (Class clazz : types) { + if (clazz.isEnum() && EnumType.class.isAssignableFrom(clazz)) { + result.put(clazz.getSimpleName(), (Class>) clazz); + } + } + return result; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/ImageryFitStatus.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/ImageryFitStatus.java new file mode 100644 index 0000000..777c31f --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/enums/ImageryFitStatus.java @@ -0,0 +1,41 @@ +package com.kamco.cd.kamcoback.common.utils.enums; + +import java.util.Arrays; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@CodeExpose +@Getter +@AllArgsConstructor +public enum ImageryFitStatus implements EnumType { + FIT("적합"), + UNFIT("부적합"); + + private final String desc; + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } + + public static ImageryFitStatus fromCode(String code) { + if (code == null) { + return null; + } + String c = code.trim(); + return Arrays.stream(values()) + .filter(v -> v.name().equalsIgnoreCase(c)) + .findFirst() + .orElse(null); + } + + public static String getDescByCode(String code) { + ImageryFitStatus status = fromCode(code); + return status != null ? status.getDesc() : null; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.java new file mode 100644 index 0000000..df1c8a3 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlEscapeDeserializer.java @@ -0,0 +1,18 @@ +package com.kamco.cd.kamcoback.common.utils.html; + +import com.fasterxml.jackson.core.JacksonException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import java.io.IOException; +import org.springframework.web.util.HtmlUtils; + +public class HtmlEscapeDeserializer extends JsonDeserializer { + + @Override + public Object deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) + throws IOException, JacksonException { + String value = jsonParser.getValueAsString(); + return value == null ? null : HtmlUtils.htmlEscape(value); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlUnescapeSerializer.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlUnescapeSerializer.java new file mode 100644 index 0000000..181a0ef --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/html/HtmlUnescapeSerializer.java @@ -0,0 +1,20 @@ +package com.kamco.cd.kamcoback.common.utils.html; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; +import org.springframework.web.util.HtmlUtils; + +public class HtmlUnescapeSerializer extends JsonSerializer { + @Override + public void serialize( + String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) + throws IOException { + if (value == null) { + jsonGenerator.writeNull(); + } else { + jsonGenerator.writeString(HtmlUtils.htmlUnescape(value)); + } + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/interfaces/EnumValid.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/interfaces/EnumValid.java new file mode 100644 index 0000000..5033df9 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/interfaces/EnumValid.java @@ -0,0 +1,23 @@ +package com.kamco.cd.kamcoback.common.utils.interfaces; + +import com.kamco.cd.kamcoback.common.utils.enums.EnumValidator; +import jakarta.validation.Constraint; +import jakarta.validation.Payload; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +@Constraint(validatedBy = EnumValidator.class) +public @interface EnumValid { + + String message() default "올바르지 않은 값입니다."; + + Class[] groups() default {}; + + Class[] payload() default {}; + + Class> enumClass(); +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/interfaces/JsonFormatDttm.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/interfaces/JsonFormatDttm.java new file mode 100644 index 0000000..6145980 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/common/utils/interfaces/JsonFormatDttm.java @@ -0,0 +1,15 @@ +package com.kamco.cd.kamcoback.common.utils.interfaces; + +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.lang.annotation.*; + +@Target({ElementType.FIELD, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@JacksonAnnotationsInside +@JsonFormat( + shape = JsonFormat.Shape.STRING, + pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", + timezone = "Asia/Seoul") +public @interface JsonFormatDttm {} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/config/QuerydslConfig.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/config/QuerydslConfig.java new file mode 100644 index 0000000..7db36f4 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/config/QuerydslConfig.java @@ -0,0 +1,18 @@ +package com.kamco.cd.kamcoback.config; + +import com.querydsl.jpa.impl.JPAQueryFactory; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class QuerydslConfig { + + @PersistenceContext private EntityManager entityManager; + + @Bean + public JPAQueryFactory jpaQueryFactory() { + return new JPAQueryFactory(entityManager); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/ApiResponseDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/ApiResponseDto.java new file mode 100644 index 0000000..56313e3 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/ApiResponseDto.java @@ -0,0 +1,223 @@ +package com.kamco.cd.kamcoback.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.kamco.cd.kamcoback.inferface.EnumType; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.ToString; +import org.springframework.http.HttpStatus; + +@Getter +@ToString +public class ApiResponseDto { + + private T data; + + @JsonInclude(JsonInclude.Include.NON_NULL) + private Error error; + + @JsonInclude(JsonInclude.Include.NON_NULL) + private T errorData; + + @JsonIgnore private HttpStatus httpStatus; + + @JsonIgnore private Long errorLogUid; + + public ApiResponseDto(T data) { + this.data = data; + } + + private ApiResponseDto(T data, HttpStatus httpStatus) { + this.data = data; + this.httpStatus = httpStatus; + } + + public ApiResponseDto(ApiResponseCode code) { + this.error = new Error(code.getId(), code.getMessage()); + } + + public ApiResponseDto(ApiResponseCode code, String message) { + this.error = new Error(code.getId(), message); + } + + public ApiResponseDto(ApiResponseCode code, String message, HttpStatus httpStatus) { + this.error = new Error(code.getId(), message); + this.httpStatus = httpStatus; + } + + public ApiResponseDto( + ApiResponseCode code, String message, HttpStatus httpStatus, Long errorLogUid) { + this.error = new Error(code.getId(), message); + this.httpStatus = httpStatus; + this.errorLogUid = errorLogUid; + } + + public ApiResponseDto(ApiResponseCode code, String message, T errorData) { + this.error = new Error(code.getId(), message); + this.errorData = errorData; + } + + // HTTP 상태 코드가 내장된 ApiResponseDto 반환 메서드들 + public static ApiResponseDto createOK(T data) { + return new ApiResponseDto<>(data, HttpStatus.CREATED); + } + + public static ApiResponseDto ok(T data) { + return new ApiResponseDto<>(data, HttpStatus.OK); + } + + public static ApiResponseDto okObject(ResponseObj data) { + if (data.getCode().equals(ApiResponseCode.OK)) { + return new ApiResponseDto<>(data, HttpStatus.NO_CONTENT); + } else { + return new ApiResponseDto<>(data.getCode(), data.getMessage(), HttpStatus.CONFLICT); + } + } + + public static ApiResponseDto deleteOk(T data) { + return new ApiResponseDto<>(data, HttpStatus.NO_CONTENT); + } + + public static ApiResponseDto createException(ApiResponseCode code) { + return new ApiResponseDto<>(code); + } + + public static ApiResponseDto createException(ApiResponseCode code, String message) { + return new ApiResponseDto<>(code, message); + } + + public static ApiResponseDto createException( + ApiResponseCode code, String message, HttpStatus httpStatus) { + return new ApiResponseDto<>(code, message, httpStatus); + } + + public static ApiResponseDto createException( + ApiResponseCode code, String message, HttpStatus httpStatus, Long errorLogUid) { + return new ApiResponseDto<>(code, message, httpStatus, errorLogUid); + } + + public static ApiResponseDto createException( + ApiResponseCode code, String message, T data) { + return new ApiResponseDto<>(code, message, data); + } + + @Getter + public static class Error { + + private final String code; + private final String message; + + public Error(String code, String message) { + this.code = code; + this.message = message; + } + } + + /** Error가 아닌 Business상 성공이거나 실패인 경우, 메세지 함께 전달하기 위한 object */ + @Getter + public static class ResponseObj { + + private final ApiResponseCode code; + private final String message; + + public ResponseObj(ApiResponseCode code, String message) { + this.code = code; + this.message = message; + } + } + + @Getter + @RequiredArgsConstructor + public enum ApiResponseCode implements EnumType { + + // @formatter:off + OK("요청이 성공하였습니다."), + BAD_REQUEST("요청 파라미터가 잘못되었습니다."), + BAD_GATEWAY("네트워크 상태가 불안정합니다."), + ALREADY_EXIST_MALL("이미 등록된 쇼핑센터입니다."), + NOT_FOUND_MAP("지도를 찾을 수 없습니다."), + UNAUTHORIZED("권한이 없습니다."), + CONFLICT("이미 등록된 컨텐츠입니다."), + NOT_FOUND("Resource를 찾을 수 없습니다."), + NOT_FOUND_DATA("데이터를 찾을 수 없습니다."), + NOT_FOUND_WEATHER_DATA("날씨 데이터를 찾을 수 없습니다."), + FAIL_SEND_MESSAGE("메시지를 전송하지 못했습니다."), + TOO_MANY_CONNECTED_MACHINES("연결된 기기가 너무 많습니다."), + UNAUTHENTICATED("인증에 실패하였습니다."), + INVALID_TOKEN("잘못된 토큰입니다."), + EXPIRED_TOKEN("만료된 토큰입니다."), + INTERNAL_SERVER_ERROR("서버에 문제가 발생 하였습니다."), + FORBIDDEN("권한을 확인해주세요."), + INVALID_PASSWORD("잘못된 비밀번호 입니다."), + NOT_FOUND_CAR_IN("입차정보가 없습니다."), + WRONG_STATUS("잘못된 상태입니다."), + FAIL_VERIFICATION("인증에 실패하였습니다."), + INVALID_EMAIL("잘못된 형식의 이메일입니다."), + REQUIRED_EMAIL("이메일은 필수 항목입니다."), + WRONG_PASSWORD("잘못된 패스워드입니다."), + DUPLICATE_EMAIL("이미 가입된 이메일입니다."), + DUPLICATE_DATA("이미 등록되어 있습니다."), + DATA_INTEGRITY_ERROR("데이터 무결성이 위반되어 요청을 처리할수 없습니다."), + FOREIGN_KEY_ERROR("참조 중인 데이터가 있어 삭제할 수 없습니다."), + DUPLICATE_EMPLOYEEID("이미 가입된 사번입니다."), + NOT_FOUND_USER_FOR_EMAIL("이메일로 유저를 찾을 수 없습니다."), + NOT_FOUND_USER("사용자를 찾을 수 없습니다."), + UNPROCESSABLE_ENTITY("이 데이터는 삭제할 수 없습니다."), + LOGIN_ID_NOT_FOUND("아이디를 잘못 입력하셨습니다."), + LOGIN_PASSWORD_MISMATCH("비밀번호를 잘못 입력하셨습니다."), + LOGIN_PASSWORD_EXCEEDED("비밀번호 오류 횟수를 초과하여 이용하실 수 없습니다.\n로그인 오류에 대해 관리자에게 문의하시기 바랍니다."), + INACTIVE_ID("사용할 수 없는 계정입니다."), + INVALID_EMAIL_TOKEN( + "You can only reset your password within 24 hours from when the email was sent.\n" + + "To reset your password again, please submit a new request through \"Forgot" + + " Password.\""), + PAYLOAD_TOO_LARGE("업로드 용량 제한을 초과했습니다."), + NOT_FOUND_TARGET_YEAR("기준년도 도엽을 찾을 수 없습니다."), + NOT_FOUND_COMPARE_YEAR("비교년도 도엽을 찾을 수 없습니다."), + FAIL_SAVE_MAP_SHEET("도엽 저장 중 오류가 발생했습니다."), + FAIL_CREATE_MAP_SHEET_FILE("도엽 설정파일 생성 중 오류가 발생했습니다."), + ; + // @formatter:on + private final String message; + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return message; + } + + public static ApiResponseCode getCode(String name) { + return ApiResponseCode.valueOf(name.toUpperCase()); + } + + public static String getMessage(String name) { + return ApiResponseCode.valueOf(name.toUpperCase()).getText(); + } + + public static ApiResponseCode from(String codeName, HttpStatus status) { + + if (codeName != null && !codeName.isBlank()) { + try { + return ApiResponseCode.valueOf(codeName.toUpperCase()); + } catch (IllegalArgumentException ignore) { + // fallback + } + } + + if (status != null) { + try { + return ApiResponseCode.valueOf(status.name()); + } catch (IllegalArgumentException ignore) { + // fallback + } + } + + return INTERNAL_SERVER_ERROR; + } + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/LabelAllocateDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/LabelAllocateDto.java new file mode 100644 index 0000000..f07f34c --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/LabelAllocateDto.java @@ -0,0 +1,362 @@ +package com.kamco.cd.kamcoback.label.dto; + +import com.kamco.cd.kamcoback.common.utils.enums.CodeExpose; +import com.kamco.cd.kamcoback.common.utils.enums.EnumType; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.ZonedDateTime; +import java.util.List; +import java.util.UUID; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; + +public class LabelAllocateDto { + + @CodeExpose + @Getter + @AllArgsConstructor + public enum LabelMngState implements EnumType { + PENDING("작업대기"), + ASSIGNED("작업할당"), + ING("진행중"), + FINISH("종료"); + + private String desc; + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } + } + + @CodeExpose + @Getter + @AllArgsConstructor + public enum LabelState implements EnumType { + WAIT("대기"), + ASSIGNED("배정"), + SKIP("스킵"), + DONE("완료"); + + private String desc; + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } + } + + @CodeExpose + @Getter + @AllArgsConstructor + public enum InspectState implements EnumType { + UNCONFIRM("미확인"), + EXCEPT("제외"), + COMPLETE("완료"); + + private String desc; + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } + } + + @Getter + @Setter + @AllArgsConstructor + public static class AllocateDto { + + @Schema( + description = "회차 마스터 key", + example = "f97dc186-e6d3-4645-9737-3173dde8dc64", + required = true) + private UUID uuid; + + @Schema(description = "비교년도-기준년도", example = "2022-2024", required = true) + private String yyyy; + + // @Schema(description = "비교년도", example = "2022", required = true) + // private Integer compareYyyy; + // + // @Schema(description = "기준년도", example = "2024", required = true) + // private Integer targetYyyy; + + @Schema(description = "회차", example = "4") + private Integer stage; + + @Schema( + description = "라벨러 할당 목록", + example = + """ + [ + { + "userId": "123456", + "demand": 1000 + }, + { + "userId": "010222297501", + "demand": 400 + }, + { + "userId": "01022223333", + "demand": 440 + } + ] + """) + private List labelers; + + @Schema( + description = "검수자 할당 목록", + example = + """ + ["K20251216001", + "01022225555", + "K20251212001" + ] + """) + private List inspectors; + } + + @Getter + public static class TargetUser { + + @Schema(description = "라벨러 사번", example = "labeler44") + private final String userId; + + @Schema(description = "할당 건수", example = "200") + private final int demand; + + public TargetUser(String userId, int demand) { + this.userId = userId; + this.demand = demand; + } + } + + @Getter + @AllArgsConstructor + public static class TargetInspector { + + @Schema(description = "검수자 사번", example = "K20251212001") + private final String inspectorUid; + + @Schema(description = "할당 명수", example = "3") + private int userCount; + } + + @Getter + @Setter + @AllArgsConstructor + public static class Basic { + + private UUID assignmentUid; + private Long inferenceGeomUid; + private String workerUid; + private String inspectorUid; + private String workState; + private Character stagnationYn; + private String assignGroupId; + private Long learnGeomUid; + private Long analUid; + private ZonedDateTime createdDttm; + private ZonedDateTime updatedDttm; + private String inspectState; + private ZonedDateTime workStatDttm; + private ZonedDateTime inspectStatDttm; + } + + @Getter + @Setter + @AllArgsConstructor + public static class UserList { + + private String userRole; + private String employeeNo; + private String name; + } + + @Getter + @Setter + @AllArgsConstructor + public static class InferenceDetail { + + private String analTitle; + private Integer stage; + private ZonedDateTime gukyuinDttm; + private Long count; + } + + @Getter + @Setter + @AllArgsConstructor + public static class LabelerDetail { + + private String roleType; + private String name; + private String userId; // 사번 + private Long count; + private Long completeCnt; + private Long skipCnt; + private Double percent; + private Integer ranking; + private ZonedDateTime createdDttm; + private String ownerName; + private Long remainCnt; + } + + @Getter + @Setter + @AllArgsConstructor + public static class AllocateMoveDto { + + @Schema(description = "총 잔여 건수", example = "5061") + private Integer totalCnt; + + @Schema( + description = "이관할 라벨러", + example = """ + [ + "87654321" + ] + """) + private List labelers; + + @Schema(description = "회차 마스터 key", example = "f97dc186-e6d3-4645-9737-3173dde8dc64") + private String uuid; + + @Schema(description = "대상 사번", example = "01022223333") + private String userId; + } + + @Getter + @Setter + @AllArgsConstructor + public static class AllocateInfoDto { + + private Long geoUid; + private Long mapSheetNum; + private Long pnu; + } + + @Getter + @Setter + @AllArgsConstructor + public static class LabelingStatDto { + + private String workDate; + private Long dailyTotalCnt; + private Long totalCnt; + private Long assignedCnt; + private Long skipCnt; + private Long completeCnt; + private Long remainCnt; + } + + @Schema(name = "searchReq", description = "일자별 작업 목록 요청") + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class searchReq { + + // 페이징 파라미터 + private int page = 0; + private int size = 20; + private String sort; + + public Pageable toPageable() { + if (sort != null && !sort.isEmpty()) { + String[] sortParams = sort.split(","); + String property = sortParams[0]; + Sort.Direction direction = + sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC; + return PageRequest.of(page, size, Sort.by(direction, property)); + } + return PageRequest.of(page, size); + } + } + + @Getter + @Setter + @AllArgsConstructor + public static class MoveUserList { + + private String userRole; + private String employeeNo; + private String name; + private Long remainCnt; + private Double percent; + } + + @Getter + @Setter + @AllArgsConstructor + public static class MoveInfo { + + private Long totalCnt; + private List moveUserList; + } + + @Schema(name = "WorkHistoryDto", description = "WorkHistoryDto") + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class WorkHistoryDto { + + @Schema(description = "행 번호") + private Integer rowNum; + + @Schema(description = "변화탐지년도", example = "2021-2022") + private String changeDetectionYear; + + @Schema(description = "국유IN 회차") + private Long stage; + + @Schema(description = "반영일") + private ZonedDateTime gukyuinApplyDttm; + + @Schema(description = "할당건수") + private Long assignedCnt; + + @Schema(description = "완료건수") + private Long completeCnt; + + @Schema(description = "Skip건수") + private Long skipCnt; + + @Schema(description = "잔여건수") + private Long remainCnt; + + @Schema(description = "상태 (진행중/완료)") + private String status; + + @Schema(description = "진행률 (%)") + private Double percent; + + @Schema(description = "작업기간 시작일") + private ZonedDateTime createdDttm; + + @Schema(description = "작업기간 종료일") + private ZonedDateTime projectCloseDttm; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/LabelInspectorDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/LabelInspectorDto.java new file mode 100644 index 0000000..89fd8ef --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/LabelInspectorDto.java @@ -0,0 +1,22 @@ +package com.kamco.cd.kamcoback.label.dto; + +import java.time.ZonedDateTime; +import java.util.UUID; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +public class LabelInspectorDto { + + @Getter + @Setter + @AllArgsConstructor + public static class Basic { + + private UUID operatorUid; + private Long analUid; + private String inspectorUid; + private ZonedDateTime createdDttm; + private ZonedDateTime updatedDttm; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/LabelLabelerDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/LabelLabelerDto.java new file mode 100644 index 0000000..80360db --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/LabelLabelerDto.java @@ -0,0 +1,27 @@ +package com.kamco.cd.kamcoback.label.dto; + +import java.time.ZonedDateTime; +import java.util.UUID; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +public class LabelLabelerDto { + + @Getter + @Setter + @AllArgsConstructor + public static class Basic { + + private UUID lbUsrUid; + private Long analUid; + private String workerUid; + private Long allocateCnt; + private Boolean deleted; + private Boolean reAllocateYn; + private Long reAllocateCnt; + private String reAllocateWorkerUid; + private ZonedDateTime createdDttm; + private ZonedDateTime updatedDttm; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/TrainingDataReviewJobDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/TrainingDataReviewJobDto.java new file mode 100644 index 0000000..7d452c8 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/dto/TrainingDataReviewJobDto.java @@ -0,0 +1,137 @@ +package com.kamco.cd.kamcoback.scheduler.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.kamco.cd.kamcoback.scheduler.dto.TrainingDataReviewJobDto.CompleteLabelData.GeoJsonFeature; +import java.util.List; +import java.util.UUID; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; + +public class TrainingDataReviewJobDto { + + @Getter + @Setter + @RequiredArgsConstructor + @AllArgsConstructor + public static class Tasks { + + private UUID assignmentUid; + private Long inferenceUid; + private Long analUid; + } + + @Getter + @Setter + @RequiredArgsConstructor + @AllArgsConstructor + public static class InspectorPendingDto { + + String inspectorUid; + Long pendingCount; + } + + @Getter + @Setter + @RequiredArgsConstructor + @AllArgsConstructor + public static class AnalCntInfo { + + Long analUid; + String resultUid; + Long allCnt; + Long completeCnt; + Long fileCnt; + } + + @Getter + @Setter + @RequiredArgsConstructor + @AllArgsConstructor + public static class AnalMapSheetList { + + private Integer compareYyyy; + private Integer targetYyyy; + private String mapSheetNum; + } + + @Getter + @Setter + @JsonPropertyOrder({"type", "features"}) + public static class FeatureCollection { + + private final String type = "FeatureCollection"; + private List features; + + public FeatureCollection(List features) { + this.features = features; + } + } + + @Getter + @Setter + @JsonPropertyOrder({"type", "geometry", "properties"}) + public static class CompleteLabelData { + + private Long geoUid; + private String type; + @JsonIgnore private String geomStr; + private JsonNode geometry; + private Properties properties; + + public CompleteLabelData(Long geoUid, String type, String geomStr, Properties properties) { + this.geoUid = geoUid; + this.type = type; + this.geomStr = geomStr; + ObjectMapper mapper = new ObjectMapper(); + JsonNode jsonNode = null; + try { + if (geomStr != null) { + jsonNode = mapper.readTree(this.geomStr); + } + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + + this.geometry = jsonNode; + if (jsonNode != null && jsonNode.isObject()) { + ((ObjectNode) jsonNode).remove("crs"); + } + + this.properties = properties; + } + + @Getter + @Setter + @RequiredArgsConstructor + @AllArgsConstructor + public static class Properties { + + private String modelId; + private String before; + private String after; + } + + @Getter + @AllArgsConstructor + public static class GeoJsonFeature { + + private String type; + private JsonNode geometry; + private Properties properties; + + public static GeoJsonFeature from(CompleteLabelData data) { + return new GeoJsonFeature( + data.getType(), + data.getGeometry(), // geoUid 없음 + data.getProperties()); + } + } + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/ApiConfigEnum.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/ApiConfigEnum.java new file mode 100644 index 0000000..79cd405 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/ApiConfigEnum.java @@ -0,0 +1,22 @@ +package com.kamco.cd.kamcoback.enums; + +import lombok.EqualsAndHashCode; +import lombok.Getter; + +public class ApiConfigEnum { + + @Getter + @EqualsAndHashCode(of = "enumValue") + public static class EnumDto { + + private final T enumValue; + private final String id; + private final String text; + + public EnumDto(T enumValue, String id, String text) { + this.enumValue = enumValue; + this.id = id; + this.text = text; + } + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/CodeDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/CodeDto.java new file mode 100644 index 0000000..ae4bc00 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/CodeDto.java @@ -0,0 +1,20 @@ +package com.kamco.cd.kamcoback.enums; + +public class CodeDto { + + private String code; + private String name; + + public CodeDto(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/CommonUseStatus.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/CommonUseStatus.java new file mode 100644 index 0000000..bcd0b39 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/CommonUseStatus.java @@ -0,0 +1,46 @@ +package com.kamco.cd.kamcoback.enums; + +import com.kamco.cd.kamcoback.enums.ApiConfigEnum.EnumDto; +import com.kamco.cd.kamcoback.inferface.EnumType; +import java.util.Arrays; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * Common usage status used across the system. + * + *

This enum represents whether a resource is active, excluded from processing, or inactive. It + * is commonly used for filtering, business rules, and status management. + */ +@Getter +@AllArgsConstructor +public enum CommonUseStatus implements EnumType { + + // @formatter:off + USE("USE", "사용중", 100) + /** Actively used and available */ + , + EXCEPT("EXCEPT", "영구 추론제외", 200) + /** Explicitly excluded from use or processing */ + , + AUTO_EXCEPT("AUTO_EXCEPT", "자동추론 제외", 300), + NOT_USE("NOT_USE", "사용안함", 999) +/** Not used or disabled */ +; + // @formatter:on + + private String id; + private String text; + private int ordering; + + public static CommonUseStatus getEnumById(String id) { + return Arrays.stream(CommonUseStatus.values()) + .filter(x -> x.getId().equals(id)) + .findFirst() + .orElse(CommonUseStatus.NOT_USE); + } + + public EnumDto getEnumDto() { + return new EnumDto<>(this, this.id, this.text); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/Enums.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/Enums.java new file mode 100644 index 0000000..c87856e --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/Enums.java @@ -0,0 +1,86 @@ +package com.kamco.cd.kamcoback.enums; + +import com.kamco.cd.kamcoback.inferface.CodeExpose; +import com.kamco.cd.kamcoback.inferface.CodeHidden; +import com.kamco.cd.kamcoback.inferface.EnumType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.reflections.Reflections; + +public class Enums { + + private static final String BASE_PACKAGE = "com.kamco.cd.kamcoback"; + + /** 노출 가능한 enum만 모아둔 맵 key: enum simpleName (예: RoleType) value: enum Class */ + private static final Map>> exposedEnumMap = scanExposedEnumMap(); + + // code로 enum 찾기 + public static & EnumType> E fromId(Class enumClass, String id) { + if (id == null) { + return null; + } + + for (E e : enumClass.getEnumConstants()) { + if (id.equalsIgnoreCase(e.getId())) { + return e; + } + } + return null; + } + + // enum -> CodeDto list + public static List toList(Class> enumClass) { + Object[] enums = enumClass.getEnumConstants(); + + return Arrays.stream(enums) + .map(e -> (EnumType) e) + .filter(e -> !isHidden(enumClass, (Enum) e)) + .map(e -> new CodeDto(e.getId(), e.getText())) + .toList(); + } + + private static boolean isHidden(Class> enumClass, Enum e) { + try { + return enumClass.getField(e.name()).isAnnotationPresent(CodeHidden.class); + } catch (NoSuchFieldException ex) { + return false; + } + } + + /** 특정 타입(enum)만 조회 /codes/{type} -> type = RoleType 같은 값 */ + public static List getCodes(String type) { + Class> enumClass = exposedEnumMap.get(type); + if (enumClass == null) { + throw new IllegalArgumentException("지원하지 않는 코드 타입: " + type); + } + return toList(enumClass); + } + + /** 전체 enum 코드 조회 */ + public static Map> getAllCodes() { + Map> result = new HashMap<>(); + for (Map.Entry>> e : exposedEnumMap.entrySet()) { + result.put(e.getKey(), toList(e.getValue())); + } + return result; + } + + /** CodeExpose + EnumType 인 enum만 스캔해서 Map 구성 */ + private static Map>> scanExposedEnumMap() { + Reflections reflections = new Reflections(BASE_PACKAGE); + + Set> types = reflections.getTypesAnnotatedWith(CodeExpose.class); + + Map>> result = new HashMap<>(); + + for (Class clazz : types) { + if (clazz.isEnum() && EnumType.class.isAssignableFrom(clazz)) { + result.put(clazz.getSimpleName(), (Class>) clazz); + } + } + return result; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/MngStateType.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/MngStateType.java new file mode 100644 index 0000000..f5fd245 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/MngStateType.java @@ -0,0 +1,26 @@ +package com.kamco.cd.kamcoback.enums; + +import com.kamco.cd.kamcoback.inferface.EnumType; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum MngStateType implements EnumType { + NOTYET("동기화 시작"), + PROCESSING("데이터 체크"), + DONE("동기화 작업 종료"), + TAKINGERROR("오류 데이터 처리중"); + + private final String desc; + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/SyncStateType.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/SyncStateType.java new file mode 100644 index 0000000..adba1cc --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/enums/SyncStateType.java @@ -0,0 +1,33 @@ +package com.kamco.cd.kamcoback.enums; + +import com.kamco.cd.kamcoback.inferface.CodeExpose; +import com.kamco.cd.kamcoback.inferface.CodeHidden; +import com.kamco.cd.kamcoback.inferface.EnumType; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@CodeExpose +@Getter +@AllArgsConstructor +public enum SyncStateType implements EnumType { + @CodeHidden + NOTYET("미처리"), + NOFILE("파일없음"), + NOTPAIR("페어파일누락"), + DUPLICATE("파일중복"), + TYPEERROR("손상파일"), + @CodeHidden + DONE("완료"); + + private final String desc; + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inference/dto/DetectionClassification.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inference/dto/DetectionClassification.java new file mode 100644 index 0000000..d2a1330 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inference/dto/DetectionClassification.java @@ -0,0 +1,56 @@ +package com.kamco.cd.kamcoback.inference.dto; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum DetectionClassification { + ROAD("road", "도로", 10), + BUILDING("building", "건물", 20), + GREENHOUSE("greenhouse", "비닐하우스", 30), + FIELD("field", "논/밭", 40), + ORCHARD("orchard", "과수원", 50), + GRASS("grass", "초지", 60), + FOREST("forest", "숲", 70), + WATER("water", "물", 80), + STONE("stone", "모래/자갈", 90), + WASTE("waste", "적치물", 100), + CONTAINER("container", "컨테이너", 110), + LAND("land", "일반토지", 120), + SOLAR("solar", "태양광", 130), + TANK("tank", "물탱크", 140), + NDC("NDC", "미분류", 150), + ETC("ETC", "기타", 160); + + private final String id; + private final String desc; + private final int order; + + /** + * Optional: Helper method to get the enum from a String, case-insensitive, or return ETC if not + * found. + */ + public static DetectionClassification fromString(String text) { + if (text == null || text.trim().isEmpty()) { + return ETC; + } + + try { + return DetectionClassification.valueOf(text.toUpperCase()); + } catch (IllegalArgumentException e) { + // If the string doesn't match any enum constant name, return ETC + return ETC; + } + } + + /** + * Desc 한글명 get 하기 + * + * @return + */ + public static String fromStrDesc(String text) { + DetectionClassification dtf = fromString(text); + return dtf.getDesc(); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto.java new file mode 100644 index 0000000..4cfe330 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceDetailDto.java @@ -0,0 +1,561 @@ +package com.kamco.cd.kamcoback.inference.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.kamco.cd.kamcoback.common.utils.enums.ImageryFitStatus; +import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm; +import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.DetectOption; +import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetScope; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.Duration; +import java.time.ZonedDateTime; +import java.util.List; +import java.util.UUID; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; + +public class InferenceDetailDto { + + @Schema(name = "InferenceResultBasic", description = "분석결과 기본 정보") + @Getter + public static class Basic { + + private Long id; + private String dataName; + private Long mapSheepNum; + private Long detectingCnt; + @JsonFormatDttm private ZonedDateTime analStrtDttm; + @JsonFormatDttm private ZonedDateTime analEndDttm; + private Long analSec; + private String analState; + + public Basic( + Long id, + String dataName, + Long mapSheepNum, + Long detectingCnt, + ZonedDateTime analStrtDttm, + ZonedDateTime analEndDttm, + Long analSec, + String analState) { + this.id = id; + this.dataName = dataName; + this.mapSheepNum = mapSheepNum; + this.detectingCnt = detectingCnt; + this.analStrtDttm = analStrtDttm; + this.analEndDttm = analEndDttm; + this.analSec = analSec; + this.analState = analState; + } + } + + @Schema(name = "AnalysisResultList", description = "분석결과 목록") + @Getter + public static class AnalResList { + + private Long id; + private String analTitle; + private Long detectingCnt; + @JsonFormatDttm private ZonedDateTime analStrtDttm; + @JsonFormatDttm private ZonedDateTime analEndDttm; + private Long analSec; + private Long analPredSec; + private String analState; + private String analStateNm; + private String gukyuinUsed; + + public AnalResList( + Long id, + String analTitle, + Long detectingCnt, + ZonedDateTime analStrtDttm, + ZonedDateTime analEndDttm, + Long analSec, + Long analPredSec, + String analState, + String analStateNm, + String gukyuinUsed) { + this.id = id; + this.analTitle = analTitle; + this.detectingCnt = detectingCnt; + this.analStrtDttm = analStrtDttm; + this.analEndDttm = analEndDttm; + this.analSec = analSec; + this.analPredSec = analPredSec; + this.analState = analState; + this.analStateNm = analStateNm; + this.gukyuinUsed = gukyuinUsed; + } + } + + @Schema(name = "AnalysisResultSummary", description = "분석결과 요약정보") + @Getter + public static class AnalResSummary { + + private Long id; + private String analTitle; + private String modelInfo; + private Integer targetYyyy; + private Integer compareYyyy; + @JsonFormatDttm private ZonedDateTime analStrtDttm; + @JsonFormatDttm private ZonedDateTime analEndDttm; + private Long analSec; + private Long analPredSec; + private String resultUrl; + private Long detectingCnt; + private Double accuracy; + private String analState; + private String analStateNm; + + public AnalResSummary( + Long id, + String analTitle, + String modelInfo, + Integer targetYyyy, + Integer compareYyyy, + ZonedDateTime analStrtDttm, + ZonedDateTime analEndDttm, + Long analSec, + Long analPredSec, + String resultUrl, + Long detectingCnt, + Double accuracy, + String analState, + String analStateNm) { + this.id = id; + this.analTitle = analTitle; + this.modelInfo = modelInfo; + this.targetYyyy = targetYyyy; + this.compareYyyy = compareYyyy; + this.analStrtDttm = analStrtDttm; + this.analEndDttm = analEndDttm; + this.analSec = analSec; + this.analPredSec = analPredSec; + this.resultUrl = resultUrl; + this.detectingCnt = detectingCnt; + this.accuracy = accuracy; + this.analState = analState; + this.analStateNm = analStateNm; + } + } + + @Getter + public static class Dashboard { + + String classAfterCd; + String classAfterName; + Long classAfterCnt; + + public Dashboard(String classAfterCd, Long classAfterCnt) { + this.classAfterCd = classAfterCd; + this.classAfterName = DetectionClassification.fromString(classAfterCd).getDesc(); + this.classAfterCnt = classAfterCnt; + } + } + + @Getter + public static class Detail { + + AnalResSummary summary; + List dashboard; + Long totalCnt; + + public Detail(AnalResSummary summary, List dashboard, Long totalCnt) { + this.summary = summary; + this.dashboard = dashboard; + this.totalCnt = totalCnt; + } + } + + // 분석 상세 ROW + @Getter + @AllArgsConstructor + public static class DetailListEntity { + + private Uid code; + private Double detectionScore; + private Clazzes compare; + private Clazzes target; + private MapSheet mapSheet; + private Coordinate center; + @JsonFormatDttm private ZonedDateTime updatedDttm; + + public DetailListEntity( + UUID uuid, + Double detectionScore, + Clazzes compare, + Clazzes target, + MapSheet mapSheet, + Coordinate center, + ZonedDateTime updatedDttm) { + this.code = new Uid(uuid); + this.detectionScore = detectionScore; + this.compare = compare; + this.target = target; + this.mapSheet = mapSheet; + this.center = center; + this.updatedDttm = updatedDttm; + } + } + + @Getter + @AllArgsConstructor + public static class Uid { + + private String shortCode; + private String code; + + public Uid(UUID uuid) { + if (uuid != null) { + this.shortCode = uuid.toString().substring(0, 8).toUpperCase(); + this.code = uuid.toString(); + } + } + } + + // MAP NO + @Getter + @AllArgsConstructor + public static class MapSheet { + + private String number; + private String name; + } + + // classification info + @Getter + public static class Clazz { + + private String code; + private String name; + @JsonIgnore private Double score; + + public Clazz(String code, Double score) { + this.code = code; + this.score = score; + this.name = DetectionClassification.fromString(code).getDesc(); + } + + public Clazz(String code) { + this.code = code; + this.name = DetectionClassification.fromString(code).getDesc(); + } + } + + // classification info + @Getter + public static class Clazzes { + + private DetectionClassification code; + private String name; + + @JsonInclude(JsonInclude.Include.NON_NULL) + private Double score; + + private Integer order; + + public Clazzes(DetectionClassification classification, Double score) { + this.code = classification; + this.name = classification.getDesc(); + this.order = classification.getOrder(); + this.score = score; + } + + public Clazzes(DetectionClassification classification) { + this.code = classification; + this.name = classification.getDesc(); + this.order = classification.getOrder(); + } + } + + // 좌표 정보 point + @Getter + public static class Coordinate { + + private Double lon; // 경도(Longitude) + private Double lat; // 위도(Latitude) + private String srid; // Spatial Reference ID의 약자로, 데이터베이스에서 좌표계를 식별하는 고유 번호 추후enum으로 + + public Coordinate(Double lon, Double lat) { + this.lon = lon; + this.lat = lat; + this.srid = "EPSG:4326"; + } + } + + @Getter + public static class Geom { + + UUID uuid; + String uid; + Integer compareYyyy; + Integer targetYyyy; + Double cdProb; + String classBeforeCd; + String classBeforeName; + Double classBeforeProb; + String classAfterCd; + String classAfterName; + Double classAfterProb; + Long mapSheetNum; + String mapSheetName; + String subUid; + String pnu; + String fitState; + + public Geom( + UUID uuid, + String uid, + Integer compareYyyy, + Integer targetYyyy, + Double cdProb, + String classBeforeCd, + Double classBeforeProb, + String classAfterCd, + Double classAfterProb, + Long mapSheetNum, + String mapSheetName, + String subUid, + String pnu, + String fitState) { + this.uuid = uuid; + this.uid = uid; + this.compareYyyy = compareYyyy; + this.targetYyyy = targetYyyy; + this.cdProb = cdProb; + this.classBeforeCd = classBeforeCd; + this.classBeforeName = DetectionClassification.fromString(classBeforeCd).getDesc(); + this.classBeforeProb = classBeforeProb; + this.classAfterCd = classAfterCd; + this.classAfterName = DetectionClassification.fromString(classAfterCd).getDesc(); + this.classAfterProb = classAfterProb; + this.mapSheetNum = mapSheetNum; + this.mapSheetName = mapSheetName; + this.subUid = subUid; + this.pnu = pnu; + this.fitState = fitState; + } + + @JsonProperty("fitState") + public String getFitState() { + return this.fitState == null ? null : this.fitState; + } + + // @JsonIgnore String gemoStr; + // @JsonIgnore String geomCenterStr; + // JsonNode gemo; + // JsonNode geomCenter; + + @JsonProperty("fitStateName") + public String fitStateName() { + return ImageryFitStatus.getDescByCode(this.fitState); + } + } + + @Schema(name = "InferenceResultSearchReq", description = "분석결과 목록 요청 정보") + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class SearchReq { + + // 검색 조건 + private String statCode; + private String title; + + // 페이징 파라미터 + private int page = 0; + private int size = 20; + + public Pageable toPageable() { + return PageRequest.of(page, size); + } + } + + @Schema(name = "InferenceResultSearchReq", description = "분석결과 목록 요청 정보") + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class SearchGeoReq { + + // 기준년도 + private String targetClass; + // 비교년도 + private String compareClass; + // 분석도엽 + private Long mapSheetNum; + + // 페이징 파라미터 + private int page = 0; + private int size = 20; + private String sort; + + public Pageable toPageable() { + if (sort != null && !sort.isEmpty()) { + String[] sortParams = sort.split(","); + String property = sortParams[0]; + Sort.Direction direction = + sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC; + return PageRequest.of(page, size, Sort.by(direction, property)); + } + return PageRequest.of(page, size); + } + } + + @Getter + @Setter + @AllArgsConstructor + @NoArgsConstructor + public static class InferenceBatchSheet { + + private Long id; + private UUID uuid; + private Long m1BatchId; + private Long m2BatchId; + private Long m3BatchId; + private String status; + private String runningModelType; + private UUID m1ModelUuid; + private UUID m2ModelUuid; + private UUID m3ModelUuid; + private String uid; + } + + @Schema(name = "AnalResultInfo", description = "추론결과 기본정보") + @Getter + @Setter + @AllArgsConstructor + @NoArgsConstructor + public static class AnalResultInfo { + + private String analTitle; + private String modelVer1; + private String modelVer2; + private String modelVer3; + private Integer compareYyyy; + private Integer targetYyyy; + private String detectOption; + private String mapSheetScope; + @JsonFormatDttm private ZonedDateTime inferStartDttm; + @JsonFormatDttm private ZonedDateTime inferEndDttm; + private Integer stage; + private String elapsedDuration; + private String subUid; + private Boolean applyYn; + @JsonFormatDttm private ZonedDateTime applyDttm; + + private String bboxGeom; + private String bboxCenterPoint; + private UUID inferenceUuid; + + public AnalResultInfo( + String analTitle, + String modelVer1, + String modelVer2, + String modelVer3, + Integer compareYyyy, + Integer targetYyyy, + String detectOption, + String mapSheetScope, + ZonedDateTime inferStartDttm, + ZonedDateTime inferEndDttm, + Integer stage, + String subUid, + Boolean applyYn, + ZonedDateTime applyDttm, + UUID inferenceUuid) { + this.analTitle = analTitle; + this.modelVer1 = modelVer1; + this.modelVer2 = modelVer2; + this.modelVer3 = modelVer3; + this.compareYyyy = compareYyyy; + this.targetYyyy = targetYyyy; + this.detectOption = DetectOption.getDescByCode(detectOption); + this.mapSheetScope = MapSheetScope.getDescByCode(mapSheetScope); + this.inferStartDttm = inferStartDttm; + this.inferEndDttm = inferEndDttm; + this.stage = stage; + this.subUid = subUid; + this.applyYn = applyYn; + this.applyDttm = applyDttm; + Duration elapsed = + (inferStartDttm != null && inferEndDttm != null) + ? Duration.between(inferStartDttm, inferEndDttm) + : null; + + if (elapsed != null) { + long seconds = elapsed.getSeconds(); + long abs = Math.abs(seconds); + + long h = abs / 3600; + long m = (abs % 3600) / 60; + long s = abs % 60; + + this.elapsedDuration = String.format("%02d:%02d:%02d", h, m, s); + } + this.inferenceUuid = inferenceUuid; + } + + @JsonProperty("bboxGeom") + public JsonNode getBboxGeom() { + ObjectMapper mapper = new ObjectMapper(); + try { + if (this.bboxGeom != null) { + return mapper.readTree(this.bboxGeom); + } else { + return null; + } + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + @JsonProperty("bboxCenterPoint") + public JsonNode getBboxCenterPoint() { + ObjectMapper mapper = new ObjectMapper(); + try { + if (this.bboxCenterPoint != null) { + return mapper.readTree(this.bboxCenterPoint); + } else { + return null; + } + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public Boolean getApplyYn() { + return this.applyYn != null && this.applyYn; + } + } + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class BboxPointDto { + + private String bboxGeom; + private String bboxCenterPoint; + } + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class Scene { + + private String path; + private Integer size; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java new file mode 100644 index 0000000..2ee0526 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java @@ -0,0 +1,679 @@ +package com.kamco.cd.kamcoback.inference.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.kamco.cd.kamcoback.common.utils.enums.EnumType; +import com.kamco.cd.kamcoback.common.utils.interfaces.EnumValid; +import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import java.time.Duration; +import java.time.LocalDate; +import java.time.ZonedDateTime; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; + +public class InferenceResultDto { + + /** 분석대상 도엽 enum */ + @Getter + @AllArgsConstructor + public enum MapSheetScope implements EnumType { + ALL("전체"), + PART("부분"), + ; + + private final String desc; + + public static MapSheetScope fromCode(String code) { + return Arrays.stream(values()).filter(v -> v.name().equals(code)).findFirst().orElse(null); + } + + public static String getDescByCode(String code) { + return fromCode(code).getDesc(); + } + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } + } + + /** 탐지 데이터 옵션 dto */ + @Getter + @AllArgsConstructor + public enum DetectOption implements EnumType { + EXCL("추론제외"), + PREV("이전 년도 도엽 사용"), + ; + private final String desc; + + public static DetectOption fromCode(String code) { + return Arrays.stream(values()).filter(v -> v.name().equals(code)).findFirst().orElse(null); + } + + public static String getDescByCode(String code) { + return fromCode(code).getDesc(); + } + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } + } + + @Getter + @AllArgsConstructor + public enum Status implements EnumType { + READY("대기"), + IN_PROGRESS("진행중"), + END("완료"), + FORCED_END("강제종료"); + private final String desc; + + public static Status fromCode(String code) { + return Arrays.stream(values()).filter(v -> v.name().equals(code)).findFirst().orElse(null); + } + + public static String getDescByCode(String code) { + return fromCode(code).getDesc(); + } + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } + } + + @Getter + @AllArgsConstructor + public enum ServerStatus implements EnumType { + SAFETY("원활"), + CAUTION("주의"), + FAILUR("장애"), + ; + + private final String desc; + + @Override + public String getId() { + return name(); + } + + @Override + public String getText() { + return desc; + } + } + + /** 목록조회 dto */ + @Schema(name = "ResultList", description = "추론관리 목록") + @Getter + @Setter + @AllArgsConstructor + @NoArgsConstructor + public static class ResultList { + + private UUID uuid; + + @Schema(description = "제목") + private String title; + + @Schema(description = "회차") + private Integer stage; + + @Schema(description = "상태") + private String status; + + @Schema(description = "분석 도엽") + private String mapSheetCnt; + + @Schema(description = "탐지건수") + private Long detectingCnt; + + @Schema(description = "시작일시") + @JsonFormatDttm + private ZonedDateTime startTime; + + @Schema(description = "종료일시") + @JsonFormatDttm + private ZonedDateTime endTime; + + @Schema(description = "반영여부") + private Boolean applyYn; + + @Schema(description = "반영일시") + @JsonFormatDttm + private ZonedDateTime applyDttm; + + @Schema(description = "비교년도") + private Integer compareYyyy; + + @Schema(description = "기준년도") + private Integer targetYyyy; + + @Schema(description = "uid") + private String uid; + + @Schema(description = "uid 앞 8자리") + @JsonProperty("subUid") + public String subUid() { + return this.uid.substring(0, 8).toUpperCase(); + } + + @Schema(description = "상태명") + @JsonProperty("statusName") + public String statusName() { + return Status.getDescByCode(this.status); + } + + @Schema(description = "소요시간") + @JsonProperty("elapsedTim") + public String getElapsedTime() { + if (this.startTime == null || this.endTime == null) { + return null; + } + ZonedDateTime start = this.startTime; + ZonedDateTime end = this.endTime; + Duration d = Duration.between(start, end); + + if (d.isNegative()) { + d = d.negated(); + } + + long s = d.getSeconds(); + long h = s / 3600; + long m = (s % 3600) / 60; + long sec = s % 60; + + return String.format("%d시간 %d분 %d초", h, m, sec); + } + } + + /** 목록조회 검색 조건 dto */ + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class SearchListReq { + + // 검색 조건 + private String applyYn; + private LocalDate strtDttm; + private LocalDate endDttm; + private String title; + + // 페이징 파라미터 + private int page = 0; + private int size = 20; + + public Pageable toPageable() { + return PageRequest.of(page, size); + } + } + + /** 변화탐지 실행 정보 저장 요청 정보 */ + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class RegReq { + + @Schema(description = "제목", example = "2023-2024 변화탐지 테스트") + @NotBlank + private String title; + + @Schema(description = "M1", example = "b40e0f68-c1d8-49fc-93f9-a36270093861") + @NotNull + private UUID model1Uuid; + + @Schema(description = "M2", example = "ec92b7d2-b5a3-4915-9bdf-35fb3ca8ad27") + @NotNull + private UUID model2Uuid; + + @Schema(description = "M3", example = "37f45782-8ccf-4cf6-911c-a055a1510d39") + @NotNull + private UUID model3Uuid; + + @Schema(description = "비교년도", example = "2023") + @NotNull + private Integer compareYyyy; + + @Schema(description = "탐지년도", example = "2024") + @NotNull + private Integer targetYyyy; + + @Schema(description = "분석대상 도엽 - 전체(ALL), 부분(PART)", example = "PART") + @NotBlank + @EnumValid(enumClass = MapSheetScope.class, message = "분석대상 도엽 옵션은 '전체', '부분' 만 사용 가능합니다.") + private String mapSheetScope; + + @Schema(description = "탐지 데이터 옵션 - 추론제외(EXCL), 이전 년도 도엽 사용(PREV)", example = "EXCL") + @NotBlank + @EnumValid( + enumClass = DetectOption.class, + message = "탐지 데이터 옵션은 '추론제외', '이전 년도 도엽 사용' 만 사용 가능합니다.") + private String detectOption; + + @Schema(description = "5k 도협 번호 목록", example = "[33605,33606, 33610, 34802, 35603, 35611]") + @NotNull + private List mapSheetNum; + } + + @Getter + @Setter + public static class MapSheetNumDto { + + private String mapSheetNum; + private String mapSheetName; + } + + @Getter + @Setter + @NoArgsConstructor + @Schema(name = "InferenceStatusDetailDto", description = "추론(변화탐지) 진행상태") + public static class InferenceStatusDetailDto { + + @Schema(description = "탐지대상 도엽수") + private Long detectingCnt; + + @Schema(description = "모델1 분석 대기") + private Integer m1PendingJobs; + + @Schema(description = "모델2 분석 대기") + private Integer m2PendingJobs; + + @Schema(description = "모델3 분석 대기") + private Integer m3PendingJobs; + + @Schema(description = "모델1 분석 진행중") + private Integer m1RunningJobs; + + @Schema(description = "모델2 분석 진행중") + private Integer m2RunningJobs; + + @Schema(description = "모델3 분석 진행중") + private Integer m3RunningJobs; + + @Schema(description = "모델1 분석 완료") + private Integer m1CompletedJobs; + + @Schema(description = "모델2 분석 완료") + private Integer m2CompletedJobs; + + @Schema(description = "모델3 분석 완료") + private Integer m3CompletedJobs; + + @Schema(description = "모델1 분석 실패") + private Integer m1FailedJobs; + + @Schema(description = "모델2 분석 실패") + private Integer m2FailedJobs; + + @Schema(description = "모델3 분석 실패") + private Integer m3FailedJobs; + + @Schema(description = "모델1 사용시간 시작일시") + @JsonFormatDttm + ZonedDateTime m1ModelStartDttm; + + @Schema(description = "모델2 사용시간 시작일시") + @JsonFormatDttm + ZonedDateTime m2ModelStartDttm; + + @Schema(description = "모델3 사용시간 시작일시") + @JsonFormatDttm + ZonedDateTime m3ModelStartDttm; + + @Schema(description = "모델1 사용시간 종료일시") + @JsonFormatDttm + ZonedDateTime m1ModelEndDttm; + + @Schema(description = "모델2 사용시간 종료일시") + @JsonFormatDttm + ZonedDateTime m2ModelEndDttm; + + @Schema(description = "모델3 사용시간 종료일시") + @JsonFormatDttm + ZonedDateTime m3ModelEndDttm; + + @Schema(description = "변화탐지 제목") + private String title; + + @Schema(description = "비교년도") + private Integer compareYyyy; + + @Schema(description = "기준년도") + private Integer targetYyyy; + + @Schema(description = "회차") + private Integer stage; + + @Schema(description = "변화탐지 시작") + @JsonFormatDttm + private ZonedDateTime inferStartDttm; + + @Schema(description = "변화탐지 종료") + @JsonFormatDttm + private ZonedDateTime inferEndDttm; + + @Schema(description = "변화탐지 옵션") + private String detectOption; + + @Schema(description = "분석도엽") + private String mapSheetScope; + + @Schema(description = "모델1 버전") + private String modelVer1; + + @Schema(description = "모델2 버전") + private String modelVer2; + + @Schema(description = "모델3 버전") + private String modelVer3; + + @Schema(description = "탑지 도엽 수") + @JsonIgnore + private Long totalJobs; + + public InferenceStatusDetailDto( + Long detectingCnt, + Integer m1PendingJobs, + Integer m2PendingJobs, + Integer m3PendingJobs, + Integer m1RunningJobs, + Integer m2RunningJobs, + Integer m3RunningJobs, + Integer m1CompletedJobs, + Integer m2CompletedJobs, + Integer m3CompletedJobs, + Integer m1FailedJobs, + Integer m2FailedJobs, + Integer m3FailedJobs, + ZonedDateTime m1ModelStartDttm, + ZonedDateTime m2ModelStartDttm, + ZonedDateTime m3ModelStartDttm, + ZonedDateTime m1ModelEndDttm, + ZonedDateTime m2ModelEndDttm, + ZonedDateTime m3ModelEndDttm, + String title, + Integer compareYyyy, + Integer targetYyyy, + Integer stage, + ZonedDateTime inferStartDttm, + ZonedDateTime inferEndDttm, + String detectOption, + String mapSheetScope, + String modelVer1, + String modelVer2, + String modelVer3, + Long totalJobs) { + this.detectingCnt = detectingCnt; + this.m1PendingJobs = m1PendingJobs; + this.m2PendingJobs = m2PendingJobs; + this.m3PendingJobs = m3PendingJobs; + this.m1RunningJobs = m1RunningJobs; + this.m2RunningJobs = m2RunningJobs; + this.m3RunningJobs = m3RunningJobs; + this.m1CompletedJobs = m1CompletedJobs; + this.m2CompletedJobs = m2CompletedJobs; + this.m3CompletedJobs = m3CompletedJobs; + this.m1FailedJobs = m1FailedJobs; + this.m2FailedJobs = m2FailedJobs; + this.m3FailedJobs = m3FailedJobs; + this.m1ModelStartDttm = m1ModelStartDttm; + this.m2ModelStartDttm = m2ModelStartDttm; + this.m3ModelStartDttm = m3ModelStartDttm; + this.m1ModelEndDttm = m1ModelEndDttm; + this.m2ModelEndDttm = m2ModelEndDttm; + this.m3ModelEndDttm = m3ModelEndDttm; + this.title = title; + this.compareYyyy = compareYyyy; + this.targetYyyy = targetYyyy; + this.stage = stage; + this.inferStartDttm = inferStartDttm; + this.inferEndDttm = inferEndDttm; + this.detectOption = detectOption; + this.mapSheetScope = mapSheetScope; + this.modelVer1 = modelVer1; + this.modelVer2 = modelVer2; + this.modelVer3 = modelVer3; + this.totalJobs = totalJobs; + } + + @Schema(description = "진행률") + @JsonProperty("progress") + private int getProgress() { + long tiles = this.totalJobs == null ? 0L : this.totalJobs; // 도엽수 + int models = 3; // 모델 개수 + int completed = + this.m1CompletedJobs + + this.m2CompletedJobs + + this.m3CompletedJobs + + this.m1FailedJobs + + this.m2FailedJobs + + this.m3FailedJobs; // 완료수 + + long total = tiles * models; // 전체 작업량 + if (completed >= total) { + return 100; + } + return (int) ((completed * 100L) / total); + } + + @Schema(description = "변화탐지 옵션명") + @JsonProperty("detectOptionName") + private String getDetectOptionName() { + return DetectOption.getDescByCode(this.detectOption); + } + + @Schema(description = "분석도엽 명") + @JsonProperty("mapSheetScopeName") + private String getMapSheetScopeName() { + return MapSheetScope.getDescByCode(this.mapSheetScope); + } + + @Schema(description = "M1 사용시간") + @JsonProperty("m1ElapsedTim") + public String getM1ElapsedTime() { + return formatElapsedTime(this.m1ModelStartDttm, this.m1ModelEndDttm); + } + + @Schema(description = "M2 사용시간") + @JsonProperty("m2ElapsedTim") + public String getM2ElapsedTime() { + return formatElapsedTime(this.m2ModelStartDttm, this.m2ModelEndDttm); + } + + @Schema(description = "M3 사용시간") + @JsonProperty("m3ElapsedTim") + public String getM3ElapsedTime() { + return formatElapsedTime(this.m3ModelStartDttm, this.m3ModelEndDttm); + } + + private String formatElapsedTime(ZonedDateTime start, ZonedDateTime end) { + if (start == null || end == null) { + return null; + } + + Duration d = Duration.between(start, end); + if (d.isNegative()) { + d = d.negated(); + } + + long s = d.getSeconds(); + long h = s / 3600; + long m = (s % 3600) / 60; + long sec = s % 60; + + return String.format("%d시간 %d분 %d초", h, m, sec); + } + } + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class InferenceServerStatusDto { + + private String serverName; + @JsonIgnore private float cpu_user; + @JsonIgnore private float cpu_system; + @JsonIgnore private float memused; + private Long kbmemused; + private float gpuUtil; + + // private String cpuStatusName; + // private String memStatusName; + // private String gpuStatusName; + // private float cpu_use_rate; + // private float gpu_use_rate; + // private float mem_use_rate; + + public float getCpuUseRate() { + return this.cpu_user + this.cpu_system; + } + + public String getServerStatus() { + String enumId = "SAFETY"; + if (this.cpu_user + this.cpu_system + this.gpuUtil + this.kbmemused == 0) { + enumId = "FAILUR"; + } + // if( this.cpu_user+this.cpu_system >= 80 )enumId = "CAUTION"; + return enumId; + } + + public String getServerStatusName() { + String enumStr = ServerStatus.SAFETY.getText(); + if (this.cpu_user + this.cpu_system + this.gpuUtil + this.kbmemused == 0) { + enumStr = ServerStatus.FAILUR.getText(); + } + return enumStr; + } + + public String getCpuStatus() { + String enumId = "SAFETY"; + if (this.cpu_user + this.cpu_system >= 80) { + enumId = "CAUTION"; + } else if (this.cpu_user + this.cpu_system + this.memused == 0) { + enumId = "FAILUR"; + } + return enumId; + } + + public String getGpuStatus() { + String enumId = "SAFETY"; + if (this.gpuUtil >= 80) { + enumId = "CAUTION"; + } else if (this.cpu_user + this.cpu_system == 0) { + enumId = "FAILUR"; + } + return enumId; + } + + public String getMemStatus() { + String enumId = "SAFETY"; + if (this.memused >= 80) { + enumId = "CAUTION"; + } else if (this.cpu_user + this.cpu_system + this.memused == 0) { + enumId = "FAILUR"; + } + return enumId; + } + + public String getCpuStatusName() { + if (this.cpu_user + this.cpu_system >= 80) { + return ServerStatus.CAUTION.getText(); + } else if (this.cpu_user + this.cpu_system + this.memused == 0) { + return ServerStatus.FAILUR.getText(); + } + return ServerStatus.SAFETY.getText(); + } + + public String getGpuStatusName() { + if (this.gpuUtil >= 80) { + return ServerStatus.CAUTION.getText(); + } else if (this.cpu_user + this.cpu_system + this.memused == 0) { + return ServerStatus.FAILUR.getText(); + } + return ServerStatus.SAFETY.getText(); + } + + public String getMemStatusName() { + if (this.memused >= 80) { + return ServerStatus.CAUTION.getText(); + } else if (this.cpu_user + this.cpu_system + this.memused == 0) { + return ServerStatus.FAILUR.getText(); + } + return ServerStatus.SAFETY.getText(); + } + } + + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor + public static class InferenceStatusDetailDto2 { + + InferenceServerStatusDto serverStatus; + } + + @Getter + @Setter + @AllArgsConstructor + @NoArgsConstructor + public static class SaveInferenceAiDto { + + private UUID uuid; + private Long batchId; + private String status; + private String type; + private ZonedDateTime inferStartDttm; + private ZonedDateTime inferEndDttm; + private Long detectEndCnt; + private String modelComparePath; + private String modelTargetPath; + private String modelModelPath; + private ZonedDateTime modelStartDttm; + private ZonedDateTime modelEndDttm; + private Long updateUid; + private String runningModelType; + private Integer pendingJobs; + private Integer runningJobs; + private Integer completedJobs; + private Integer failedJobs; + } + + @Getter + @Setter + public static class InferenceLearnDto { + + private String uid; + private Long m1ModelBatchId; + private Long m2ModelBatchId; + private Long m3ModelBatchId; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/CodeExpose.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/CodeExpose.java new file mode 100644 index 0000000..aa50c0e --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/CodeExpose.java @@ -0,0 +1,10 @@ +package com.kamco.cd.kamcoback.inferface; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface CodeExpose {} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/CodeHidden.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/CodeHidden.java new file mode 100644 index 0000000..7516dfe --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/CodeHidden.java @@ -0,0 +1,10 @@ +package com.kamco.cd.kamcoback.inferface; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface CodeHidden {} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/EnumType.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/EnumType.java new file mode 100644 index 0000000..2fa5f21 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/EnumType.java @@ -0,0 +1,8 @@ +package com.kamco.cd.kamcoback.inferface; + +public interface EnumType { + + String getId(); + + String getText(); +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/JsonFormatDttm.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/JsonFormatDttm.java new file mode 100644 index 0000000..aabb352 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/inferface/JsonFormatDttm.java @@ -0,0 +1,19 @@ +package com.kamco.cd.kamcoback.inferface; + +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.FIELD, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@JacksonAnnotationsInside +@JsonFormat( + shape = JsonFormat.Shape.STRING, + pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", + timezone = "Asia/Seoul") +public @interface JsonFormatDttm {} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/core/TrainingDataLabelJobCoreService.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/core/TrainingDataLabelJobCoreService.java new file mode 100644 index 0000000..640783b --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/core/TrainingDataLabelJobCoreService.java @@ -0,0 +1,36 @@ +package com.kamco.cd.kamcoback.postgres.core; + +import com.kamco.cd.kamcoback.postgres.repository.scheduler.TrainingDataLabelJobRepository; +import com.kamco.cd.kamcoback.scheduler.dto.TrainingDataReviewJobDto.InspectorPendingDto; +import com.kamco.cd.kamcoback.scheduler.dto.TrainingDataReviewJobDto.Tasks; +import java.util.List; +import java.util.UUID; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class TrainingDataLabelJobCoreService { + + private final TrainingDataLabelJobRepository trainingDataLabelJobRepository; + + public List findCompletedYesterdayUnassigned() { + return trainingDataLabelJobRepository.findCompletedYesterdayUnassigned(); + } + + public void assignReviewerBatch(List assignmentUids, String reviewerId) { + trainingDataLabelJobRepository.assignReviewerBatch(assignmentUids, reviewerId); + } + + public List findInspectorPendingByRound(Long analUid) { + return trainingDataLabelJobRepository.findInspectorPendingByRound(analUid); + } + + public void lockInspectors(Long analUid, List reviewerIds) { + trainingDataLabelJobRepository.lockInspectors(analUid, reviewerIds); + } + + public void updateGeomUidTestState(List geomUids) { + trainingDataLabelJobRepository.updateGeomUidTestState(geomUids); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/CommonDateEntity.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/CommonDateEntity.java new file mode 100644 index 0000000..cb9abe9 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/CommonDateEntity.java @@ -0,0 +1,34 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.PrePersist; +import jakarta.persistence.PreUpdate; +import java.time.ZonedDateTime; +import lombok.Getter; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; + +@Getter +@MappedSuperclass +public class CommonDateEntity { + + @CreatedDate + @Column(name = "created_dttm", updatable = false, nullable = false) + private ZonedDateTime createdDate; + + @LastModifiedDate + @Column(name = "updated_dttm", nullable = false) + private ZonedDateTime modifiedDate; + + @PrePersist + protected void onPersist() { + this.createdDate = ZonedDateTime.now(); + this.modifiedDate = ZonedDateTime.now(); + } + + @PreUpdate + protected void onUpdate() { + this.modifiedDate = ZonedDateTime.now(); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingAssignmentEntity.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingAssignmentEntity.java new file mode 100644 index 0000000..0e0abea --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingAssignmentEntity.java @@ -0,0 +1,69 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import java.time.ZonedDateTime; +import java.util.UUID; + +@Entity +@Table(name = "tb_labeling_assignment") +public class LabelingAssignmentEntity extends CommonDateEntity { + + @Id + @Column(name = "assignment_uid") + private UUID assignmentUid; + + @Column(name = "inference_geom_uid") + private Long inferenceGeomUid; + + @Column(name = "worker_uid") + private String workerUid; + + @Column(name = "inspector_uid") + private String inspectorUid; + + @Column(name = "work_state") + private String workState; + + @Column(name = "stagnation_yn") + private Character stagnationYn; + + @Column(name = "assign_group_id") + private String assignGroupId; + + @Column(name = "learn_geom_uid") + private Long learnGeomUid; + + @Column(name = "anal_uid") + private Long analUid; + + @Column(name = "inspect_state") + private String inspectState; + + @Column(name = "work_stat_dttm") + private ZonedDateTime workStatDttm; + + @Column(name = "inspect_stat_dttm") + private ZonedDateTime inspectStatDttm; + + public LabelAllocateDto.Basic toDto() { + return new LabelAllocateDto.Basic( + this.assignmentUid, + this.inferenceGeomUid, + this.workerUid, + this.inspectorUid, + this.workState, + this.stagnationYn, + this.assignGroupId, + this.learnGeomUid, + this.analUid, + super.getCreatedDate(), + super.getModifiedDate(), + this.inspectState, + this.workStatDttm, + this.inspectStatDttm); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.java new file mode 100644 index 0000000..c378179 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.java @@ -0,0 +1,32 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import com.kamco.cd.kamcoback.label.dto.LabelInspectorDto; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import java.util.UUID; + +@Entity +@Table(name = "tb_labeling_inspector") +public class LabelingInspectorEntity extends CommonDateEntity { + + @Id + @Column(name = "operator_uid") + private UUID operatorUid; + + @Column(name = "anal_uid") + private Long analUid; + + @Column(name = "inspector_uid") + private String inspectorUid; + + public LabelInspectorDto.Basic toDto() { + return new LabelInspectorDto.Basic( + this.operatorUid, + this.analUid, + this.inspectorUid, + super.getCreatedDate(), + super.getModifiedDate()); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapInkx50kEntity.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapInkx50kEntity.java new file mode 100644 index 0000000..c483e5c --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapInkx50kEntity.java @@ -0,0 +1,48 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.locationtech.jts.geom.Geometry; + +@Getter +@Setter +@Table(name = "tb_map_inkx_50k") +@Entity +@NoArgsConstructor +public class MapInkx50kEntity extends CommonDateEntity { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_map_inkx_50k_fid_seq_gen") + @SequenceGenerator( + name = "tb_map_inkx_50k_fid_seq_gen", + sequenceName = "tb_map_inkx_50k_fid_seq", + allocationSize = 1) + private Integer fid; + + @Column(name = "mapidcd_no") + private String mapidcdNo; + + @Column(name = "mapid_nm") + private String mapidNm; + + @Column(name = "mapid_no") + private String mapidNo; + + @Column(name = "geom") + private Geometry geom; + + public MapInkx50kEntity(String mapidcdNo, String mapidNm, String mapidNo, Geometry geom) { + this.mapidcdNo = mapidcdNo; + this.mapidNm = mapidNm; + this.mapidNo = mapidNo; + this.geom = geom; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapInkx5kEntity.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapInkx5kEntity.java new file mode 100644 index 0000000..3246924 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapInkx5kEntity.java @@ -0,0 +1,75 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import com.kamco.cd.kamcoback.enums.CommonUseStatus; +import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto; +import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.locationtech.jts.geom.Geometry; + +@Getter +@Setter +@Table(name = "tb_map_inkx_5k") +@Entity +@NoArgsConstructor +public class MapInkx5kEntity extends CommonDateEntity { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_map_inkx_5k_fid_seq_gen") + @SequenceGenerator( + name = "tb_map_inkx_5k_fid_seq_gen", + sequenceName = "tb_map_inkx_5k_fid_seq", + allocationSize = 1) + private Integer fid; + + @Column(name = "mapidcd_no") + private String mapidcdNo; + + @Column(name = "mapid_nm") + private String mapidNm; + + @Column(name = "geom") + private Geometry geom; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "fid_k50", referencedColumnName = "fid") + private MapInkx50kEntity mapInkx50k; + + // 사용상태 USE, + @Column(name = "use_inference") + @Enumerated(EnumType.STRING) + private CommonUseStatus useInference; + + public InferenceDetailDto.MapSheet toEntity() { + return new MapSheet(mapidcdNo, mapidNm); + } + + // Constructor + public MapInkx5kEntity( + String mapidcdNo, String mapidNm, Geometry geom, MapInkx50kEntity mapInkx50k) { + this.mapidcdNo = mapidcdNo; + this.mapidNm = mapidNm; + this.geom = geom; + this.mapInkx50k = mapInkx50k; + // 생성시 default 사용함 (사용,제외,사용안함) + this.useInference = CommonUseStatus.USE; + } + + // 변경 사용상태 (추론사용여부) + public void updateUseInference(CommonUseStatus useInference) { + this.useInference = useInference; + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataInferenceGeomEntity.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataInferenceGeomEntity.java new file mode 100644 index 0000000..c0487a1 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetAnalDataInferenceGeomEntity.java @@ -0,0 +1,181 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import com.kamco.cd.kamcoback.inference.dto.DetectionClassification; +import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto; +import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Clazzes; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.validation.constraints.Size; +import java.time.ZonedDateTime; +import java.util.UUID; +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.ColumnDefault; +import org.locationtech.jts.geom.Geometry; + +@Getter +@Setter +@Entity +@Table(name = "tb_map_sheet_anal_data_inference_geom") +public class MapSheetAnalDataInferenceGeomEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "geo_uid") + private Long geoUid; + + @Column(name = "cd_prob") + private Double cdProb; + + @Size(max = 40) + @Column(name = "class_before_cd", length = 40) + private String classBeforeCd; + + @Column(name = "class_before_prob") + private Double classBeforeProb; + + @Size(max = 40) + @Column(name = "class_after_cd", length = 40) + private String classAfterCd; + + @Column(name = "class_after_prob") + private Double classAfterProb; + + @Column(name = "map_sheet_num") + private Long mapSheetNum; + + @Column(name = "compare_yyyy") + private Integer compareYyyy; + + @Column(name = "target_yyyy") + private Integer targetYyyy; + + @Column(name = "area") + private Double area; + + @Size(max = 100) + @Column(name = "geo_type", length = 100) + private String geoType; + + @Column(name = "data_uid") + private Long dataUid; + + @ColumnDefault("now()") + @Column(name = "created_dttm") + private ZonedDateTime createdDttm; + + @Column(name = "created_uid") + private Long createdUid; + + @ColumnDefault("now()") + @Column(name = "updated_dttm") + private ZonedDateTime updatedDttm; + + @Column(name = "updated_uid") + private Long updatedUid; + + @ColumnDefault("0") + @Column(name = "geom_cnt") + private Long geomCnt; + + @ColumnDefault("0") + @Column(name = "pnu") + private Long pnu; + + @Size(max = 20) + @Column(name = "fit_state", length = 20) + private String fitState; + + @ColumnDefault("now()") + @Column(name = "fit_state_dttm") + private ZonedDateTime fitStateDttm; + + @Column(name = "labeler_uid") + private Long labelerUid; + + @Size(max = 20) + @ColumnDefault("'0'") + @Column(name = "label_state", length = 20) + private String labelState; + + @ColumnDefault("now()") + @Column(name = "label_state_dttm") + private ZonedDateTime labelStateDttm; + + @Column(name = "tester_uid") + private Long testerUid; + + @Size(max = 20) + @ColumnDefault("'0'") + @Column(name = "test_state", length = 20) + private String testState; + + @ColumnDefault("now()") + @Column(name = "test_state_dttm") + private ZonedDateTime testStateDttm; + + @Column(name = "fit_state_cmmnt", length = Integer.MAX_VALUE) + private String fitStateCmmnt; + + @Column(name = "ref_map_sheet_num") + private Long refMapSheetNum; + + @ColumnDefault("uuid_generate_v4()") + @Column(name = "uuid") + private UUID uuid; + + @Column(name = "stage") + private Integer stage; + + @Column(name = "file_created_yn") + private Boolean fileCreatedYn; + + @Column(name = "geom", columnDefinition = "geometry") + private Geometry geom; + + @Column(name = "geom_center", columnDefinition = "geometry") + private Geometry geomCenter; + + @Column(name = "before_geom", columnDefinition = "geometry") + private Geometry beforeGeom; + + @Column(name = "file_created_dttm") + private ZonedDateTime fileCreatedDttm; + + @Column(name = "result_uid") + private String resultUid; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "map_5k_id", referencedColumnName = "fid") + private MapInkx5kEntity map5k; + + @Column(name = "label_send_dttm") + private ZonedDateTime labelSendDttm; + + @Column(name = "lock_yn") + private String lockYn; + + public InferenceDetailDto.DetailListEntity toEntity() { + DetectionClassification classification = DetectionClassification.fromString(classBeforeCd); + Clazzes comparedClazz = new Clazzes(classification, classBeforeProb); + DetectionClassification classification1 = DetectionClassification.fromString(classAfterCd); + Clazzes targetClazz = new Clazzes(classification1, classAfterProb); + InferenceDetailDto.MapSheet mapSheet = map5k != null ? map5k.toEntity() : null; + + InferenceDetailDto.Coordinate coordinate = null; + if (geomCenter != null) { + org.locationtech.jts.geom.Point point = (org.locationtech.jts.geom.Point) geomCenter; + coordinate = new InferenceDetailDto.Coordinate(point.getX(), point.getY()); + } + + return new InferenceDetailDto.DetailListEntity( + uuid, cdProb, comparedClazz, targetClazz, mapSheet, coordinate, createdDttm); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/repository/TrainingDataLabelJobRepository.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/repository/TrainingDataLabelJobRepository.java new file mode 100644 index 0000000..b6f83e5 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/repository/TrainingDataLabelJobRepository.java @@ -0,0 +1,23 @@ +package com.kamco.cd.kamcoback.postgres.repository.scheduler; + +import com.kamco.cd.kamcoback.postgres.entity.LabelingInspectorEntity; +import jakarta.persistence.LockModeType; +import java.util.List; +import java.util.UUID; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Lock; +import org.springframework.data.jpa.repository.Query; + +public interface TrainingDataLabelJobRepository + extends JpaRepository, TrainingDataLabelJobRepositoryCustom { + + @Lock(LockModeType.PESSIMISTIC_WRITE) + @Query( + """ + select r + from LabelingInspectorEntity r + where r.analUid = :analUid + and r.inspectorUid in :inspectorUids + """) + List lockInspectors(Long analUid, List inspectorUids); +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/repository/TrainingDataLabelJobRepositoryCustom.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/repository/TrainingDataLabelJobRepositoryCustom.java new file mode 100644 index 0000000..cb824f9 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/repository/TrainingDataLabelJobRepositoryCustom.java @@ -0,0 +1,17 @@ +package com.kamco.cd.kamcoback.postgres.repository.scheduler; + +import com.kamco.cd.kamcoback.scheduler.dto.TrainingDataReviewJobDto.InspectorPendingDto; +import com.kamco.cd.kamcoback.scheduler.dto.TrainingDataReviewJobDto.Tasks; +import java.util.List; +import java.util.UUID; + +public interface TrainingDataLabelJobRepositoryCustom { + + List findCompletedYesterdayUnassigned(); + + List findInspectorPendingByRound(Long analUid); + + void assignReviewerBatch(List assignmentUids, String reviewerId); + + void updateGeomUidTestState(List geomUids); +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/repository/TrainingDataLabelJobRepositoryImpl.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/repository/TrainingDataLabelJobRepositoryImpl.java new file mode 100644 index 0000000..f1bfe27 --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/postgres/repository/TrainingDataLabelJobRepositoryImpl.java @@ -0,0 +1,119 @@ +package com.kamco.cd.kamcoback.postgres.repository.scheduler; + +import static com.kamco.cd.kamcoback.postgres.entity.QLabelingAssignmentEntity.labelingAssignmentEntity; +import static com.kamco.cd.kamcoback.postgres.entity.QLabelingInspectorEntity.labelingInspectorEntity; +import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity; + +import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InspectState; +import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelState; +import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity; +import com.kamco.cd.kamcoback.scheduler.dto.TrainingDataReviewJobDto.InspectorPendingDto; +import com.kamco.cd.kamcoback.scheduler.dto.TrainingDataReviewJobDto.Tasks; +import com.querydsl.core.types.Projections; +import com.querydsl.core.types.dsl.BooleanExpression; +import com.querydsl.core.types.dsl.Expressions; +import com.querydsl.core.types.dsl.StringExpression; +import com.querydsl.jpa.impl.JPAQueryFactory; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.List; +import java.util.UUID; +import org.springframework.data.jpa.repository.support.QuerydslRepositorySupport; +import org.springframework.stereotype.Repository; + +@Repository +public class TrainingDataLabelJobRepositoryImpl extends QuerydslRepositorySupport + implements TrainingDataLabelJobRepositoryCustom { + + private final JPAQueryFactory queryFactory; + private final StringExpression NULL_STRING = Expressions.stringTemplate("cast(null as text)"); + + public TrainingDataLabelJobRepositoryImpl(JPAQueryFactory queryFactory) { + super(LabelingAssignmentEntity.class); + this.queryFactory = queryFactory; + } + + @Override + public List findCompletedYesterdayUnassigned() { + ZoneId zone = ZoneId.of("Asia/Seoul"); + ZonedDateTime todayStart = ZonedDateTime.now(zone).toLocalDate().atStartOfDay(zone); + ZonedDateTime yesterdayStart = todayStart.minusDays(1); + + BooleanExpression isYesterday = + labelingAssignmentEntity + .workStatDttm + .goe(yesterdayStart) + .and(labelingAssignmentEntity.workStatDttm.lt(todayStart)); + + return queryFactory + .select( + Projections.constructor( + Tasks.class, + labelingAssignmentEntity.assignmentUid, + labelingAssignmentEntity.inferenceGeomUid, + labelingAssignmentEntity.analUid)) + .from(labelingAssignmentEntity) + .where( + labelingAssignmentEntity.workState.in(LabelState.SKIP.getId(), LabelState.DONE.getId()), + labelingAssignmentEntity.inspectorUid.isNull(), + isYesterday) + .orderBy( + labelingAssignmentEntity.analUid.asc(), + labelingAssignmentEntity.assignGroupId.asc(), + labelingAssignmentEntity.inferenceGeomUid.asc()) + .fetch(); + } + + /** + * 해당 회차에 라벨링 할당받은 검수자별 완료 건수 count(), 완료한 게 적은 순으로 해야 일이 한 사람에게 몰리지 않음 + * + * @param analUid + * @return + */ + @Override + public List findInspectorPendingByRound(Long analUid) { + return queryFactory + .select( + Projections.constructor( + InspectorPendingDto.class, + labelingInspectorEntity.inspectorUid, + labelingAssignmentEntity.assignmentUid.count())) + .from(labelingInspectorEntity) + .leftJoin(labelingAssignmentEntity) + .on( + labelingInspectorEntity.inspectorUid.eq(labelingAssignmentEntity.inspectorUid), + labelingAssignmentEntity.inspectState.in( + InspectState.EXCEPT.getId(), InspectState.COMPLETE.getId())) + .where(labelingInspectorEntity.analUid.eq(analUid)) + .groupBy(labelingInspectorEntity.inspectorUid) + .orderBy(labelingAssignmentEntity.assignmentUid.count().asc()) + .fetch(); + } + + /** + * 배치용 여러 건 update + * + * @param assignmentUids + * @param reviewerId + */ + @Override + public void assignReviewerBatch(List assignmentUids, String reviewerId) { + queryFactory + .update(labelingAssignmentEntity) + .set(labelingAssignmentEntity.inspectorUid, reviewerId) + .set(labelingAssignmentEntity.inspectState, InspectState.UNCONFIRM.getId()) + .set(labelingAssignmentEntity.modifiedDate, ZonedDateTime.now()) + .where(labelingAssignmentEntity.assignmentUid.in(assignmentUids)) + .execute(); + } + + @Override + public void updateGeomUidTestState(List geomUids) { + queryFactory + .update(mapSheetAnalDataInferenceGeomEntity) + .set(mapSheetAnalDataInferenceGeomEntity.testState, InspectState.UNCONFIRM.getId()) + .set(mapSheetAnalDataInferenceGeomEntity.updatedDttm, ZonedDateTime.now()) + .where(mapSheetAnalDataInferenceGeomEntity.geoUid.in(geomUids)) + .execute(); + } +} diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/service/TrainingDataLabelJobService.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/service/TrainingDataLabelJobService.java new file mode 100644 index 0000000..5f9a98a --- /dev/null +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/service/TrainingDataLabelJobService.java @@ -0,0 +1,112 @@ +package com.kamco.cd.kamcoback.scheduler.service; + +import com.kamco.cd.kamcoback.postgres.core.TrainingDataLabelJobCoreService; +import com.kamco.cd.kamcoback.scheduler.dto.TrainingDataReviewJobDto.InspectorPendingDto; +import com.kamco.cd.kamcoback.scheduler.dto.TrainingDataReviewJobDto.Tasks; +import jakarta.transaction.Transactional; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + +@Log4j2 +@Service +@RequiredArgsConstructor +public class TrainingDataLabelJobService { + + private final TrainingDataLabelJobCoreService trainingDataLabelJobCoreService; + + @Value("${spring.profiles.active}") + private String profile; + + private boolean isLocalProfile() { + return "local".equalsIgnoreCase(profile); + } + + @Transactional + @Scheduled(cron = "0 0 0 * * *") + public void assignReviewerYesterdayLabelComplete() { + + if (isLocalProfile()) { + return; + } + + try { + List tasks = trainingDataLabelJobCoreService.findCompletedYesterdayUnassigned(); + + if (tasks.isEmpty()) { + return; + } + + // 회차별로 그룹핑 + Map> taskByRound = + tasks.stream().collect(Collectors.groupingBy(Tasks::getAnalUid)); + + // 회차별 분배 + for (Map.Entry> entry : taskByRound.entrySet()) { + Long analUid = entry.getKey(); + List analTasks = entry.getValue(); + + // pending 계산 + List pendings = + trainingDataLabelJobCoreService.findInspectorPendingByRound(analUid); + + if (pendings.isEmpty()) { + continue; + } + + List reviewerIds = + pendings.stream().map(InspectorPendingDto::getInspectorUid).toList(); + + // Lock 걸릴 수 있기 때문에 엔티티 조회하는 Repository 에서 구현 + trainingDataLabelJobCoreService.lockInspectors(analUid, reviewerIds); + + // 균등 분배 + Map> assignMap = distributeByLeastPending(analTasks, reviewerIds); + + // reviewer별 batch update + assignMap.forEach( + (reviewerId, assignedTasks) -> { + if (assignedTasks.isEmpty()) { + return; + } + + List assignmentUids = + assignedTasks.stream().map(Tasks::getAssignmentUid).toList(); + trainingDataLabelJobCoreService.assignReviewerBatch(assignmentUids, reviewerId); + + List geomUids = assignedTasks.stream().map(Tasks::getInferenceUid).toList(); + trainingDataLabelJobCoreService.updateGeomUidTestState(geomUids); + }); + } + } catch (Exception e) { + log.error("배치 처리 중 예외", e); + } + } + + private Map> distributeByLeastPending( + List tasks, List reviewerIds) { + Map> result = new LinkedHashMap<>(); + + // 순서 유지 중요 (ASC 정렬된 상태) + for (String reviewerId : reviewerIds) { + result.put(reviewerId, new ArrayList<>()); + } + + int reviewerCount = reviewerIds.size(); + + for (int i = 0; i < tasks.size(); i++) { + String reviewerId = reviewerIds.get(i % reviewerCount); + result.get(reviewerId).add(tasks.get(i)); + } + + return result; + } +} diff --git a/label/label-to-review/src/main/resources/application.yml b/label/label-to-review/src/main/resources/application.yml new file mode 100644 index 0000000..5d1aadc --- /dev/null +++ b/label/label-to-review/src/main/resources/application.yml @@ -0,0 +1,4 @@ +server: + port: 9080 + + diff --git a/label/label-to-review/src/main/resources/application_dev.yml b/label/label-to-review/src/main/resources/application_dev.yml new file mode 100644 index 0000000..a5bc4d9 --- /dev/null +++ b/label/label-to-review/src/main/resources/application_dev.yml @@ -0,0 +1,67 @@ +server: + port: 9080 + +spring: + application: + name: label-to-review + profiles: + active: dev # 사용할 프로파일 지정 (ex. dev, prod, test) + + datasource: + url: jdbc:postgresql://192.168.2.127:15432/kamco_cds + #url: jdbc:postgresql://localhost:5432/kamco_cds + username: kamco_cds + password: kamco_cds_Q!W@E#R$ + hikari: + minimum-idle: 1 + maximum-pool-size: 5 + + jpa: + hibernate: + ddl-auto: update # 테이블이 없으면 생성, 있으면 업데이트 + properties: + hibernate: + jdbc: + batch_size: 50 + default_batch_fetch_size: 100 +logging: + level: + root: INFO + org.springframework.web: DEBUG + org.springframework.security: DEBUG + + # 헬스체크 노이즈 핵심만 다운 + org.springframework.security.web.FilterChainProxy: INFO + org.springframework.security.web.authentication.AnonymousAuthenticationFilter: INFO + org.springframework.security.web.authentication.Http403ForbiddenEntryPoint: INFO + org.springframework.web.servlet.DispatcherServlet: INFO +# actuator +management: + health: + readinessstate: + enabled: true + livenessstate: + enabled: true + endpoint: + health: + probes: + enabled: true + show-details: always + endpoints: + jmx: + exposure: + exclude: "*" + web: + base-path: /monitor + exposure: + include: + - "health" + +file: + #sync-root-dir: D:/kamco-nfs/images/ + sync-root-dir: /kamco-nfs/images/ + sync-tmp-dir: ${file.sync-root-dir}/tmp + sync-file-extention: tfw,tif + sync-auto-exception-start-year: 2025 + sync-auto-exception-before-year-cnt: 3 + diff --git a/label/label-to-review/src/main/resources/application_local.yml b/label/label-to-review/src/main/resources/application_local.yml new file mode 100644 index 0000000..328045e --- /dev/null +++ b/label/label-to-review/src/main/resources/application_local.yml @@ -0,0 +1,67 @@ +server: + port: 9080 + +spring: + application: + name: imagery-make-dataset + profiles: + active: local # 사용할 프로파일 지정 (ex. dev, prod, test) + + datasource: + url: jdbc:postgresql://192.168.2.127:15432/kamco_cds + #url: jdbc:postgresql://localhost:5432/kamco_cds + username: kamco_cds + password: kamco_cds_Q!W@E#R$ + hikari: + minimum-idle: 1 + maximum-pool-size: 5 + + jpa: + hibernate: + ddl-auto: update # 테이블이 없으면 생성, 있으면 업데이트 + properties: + hibernate: + jdbc: + batch_size: 50 + default_batch_fetch_size: 100 +logging: + level: + root: INFO + org.springframework.web: DEBUG + org.springframework.security: DEBUG + + # 헬스체크 노이즈 핵심만 다운 + org.springframework.security.web.FilterChainProxy: INFO + org.springframework.security.web.authentication.AnonymousAuthenticationFilter: INFO + org.springframework.security.web.authentication.Http403ForbiddenEntryPoint: INFO + org.springframework.web.servlet.DispatcherServlet: INFO +# actuator +management: + health: + readinessstate: + enabled: true + livenessstate: + enabled: true + endpoint: + health: + probes: + enabled: true + show-details: always + endpoints: + jmx: + exposure: + exclude: "*" + web: + base-path: /monitor + exposure: + include: + - "health" + +file: + #sync-root-dir: D:/kamco-nfs/images/ + sync-root-dir: /kamco-nfs/images/ + sync-tmp-dir: ${file.sync-root-dir}/tmp + sync-file-extention: tfw,tif + sync-auto-exception-start-year: 2025 + sync-auto-exception-before-year-cnt: 3 + diff --git a/label/label-to-review/src/main/resources/application_prod.yml b/label/label-to-review/src/main/resources/application_prod.yml new file mode 100644 index 0000000..1282d26 --- /dev/null +++ b/label/label-to-review/src/main/resources/application_prod.yml @@ -0,0 +1,67 @@ +server: + port: 9080 + +spring: + application: + name: imagery-make-dataset + profiles: + active: prod # 사용할 프로파일 지정 (ex. dev, prod, test) + + datasource: + url: jdbc:postgresql://192.168.2.127:15432/kamco_cds + #url: jdbc:postgresql://localhost:5432/kamco_cds + username: kamco_cds + password: kamco_cds_Q!W@E#R$ + hikari: + minimum-idle: 1 + maximum-pool-size: 5 + + jpa: + hibernate: + ddl-auto: update # 테이블이 없으면 생성, 있으면 업데이트 + properties: + hibernate: + jdbc: + batch_size: 50 + default_batch_fetch_size: 100 +logging: + level: + root: INFO + org.springframework.web: DEBUG + org.springframework.security: DEBUG + + # 헬스체크 노이즈 핵심만 다운 + org.springframework.security.web.FilterChainProxy: INFO + org.springframework.security.web.authentication.AnonymousAuthenticationFilter: INFO + org.springframework.security.web.authentication.Http403ForbiddenEntryPoint: INFO + org.springframework.web.servlet.DispatcherServlet: INFO +# actuator +management: + health: + readinessstate: + enabled: true + livenessstate: + enabled: true + endpoint: + health: + probes: + enabled: true + show-details: always + endpoints: + jmx: + exposure: + exclude: "*" + web: + base-path: /monitor + exposure: + include: + - "health" + +file: + #sync-root-dir: D:/kamco-nfs/images/ + sync-root-dir: /kamco-nfs/images/ + sync-tmp-dir: ${file.sync-root-dir}/tmp + sync-file-extention: tfw,tif + sync-auto-exception-start-year: 2025 + sync-auto-exception-before-year-cnt: 3 + diff --git a/label/label-to-review/src/main/resources/static/chunk_upload_test.html b/label/label-to-review/src/main/resources/static/chunk_upload_test.html new file mode 100644 index 0000000..2c331d4 --- /dev/null +++ b/label/label-to-review/src/main/resources/static/chunk_upload_test.html @@ -0,0 +1,137 @@ + + + + + Chunk Upload Test + + +

대용량 파일 청크 업로드 테스트

+ +* Chunk 테스트 사이즈 10M (10 * 1024 * 1024) - 성능에 따라 변경가능

+ +* 업로드 API선택

+ +

+* 파일첨부

+

+ +



+* 업로드시 업로드 이력을 추적하기 위해 UUID생성해서 전달(파일병합시 사용)(script 예제참고)

+UUID :

+ +* API 호출시 파일정보 추출해서 자동 할당해야 함.(script 예제참고)

+chunkIndex :

+chunkTotalIndex :

+ +* API 호출시 파일정보 추출해서 자동 할당해야 함.(script 예제참고)

+fileSize :

+ + + +

+* 진행율(%)

+
+

+* 결과메세지

+
+ + + + diff --git a/label/label-to-review/unpack_and_offline_build_airgap_macos.sh b/label/label-to-review/unpack_and_offline_build_airgap_macos.sh new file mode 100644 index 0000000..4ab128e --- /dev/null +++ b/label/label-to-review/unpack_and_offline_build_airgap_macos.sh @@ -0,0 +1,359 @@ +#!/bin/bash +# unpack_and_offline_build_airgap_macos.sh +# ============================================================================ +# Execution Environment: OFFLINE (Air-gapped, No Internet) +# Purpose: Extract bundle and run offline build +# ============================================================================ +# macOS Bash Script +# Version: 3.1 +# +# IMPORTANT: This script automatically: +# 1. Extracts the archive +# 2. Sets GRADLE_USER_HOME to project local cache +# 3. Configures settings.gradle for offline resolution +# 4. Runs build with --offline flag +# ============================================================================ + +set -e + +# ============================================================================ +# Configuration +# ============================================================================ +WRAPPER_SEED_PATH="wrapper_jar_seed" +OFFLINE_HOME_NAME="_offline_gradle_home" + +# Color codes +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +CYAN='\033[0;36m' +GRAY='\033[0;90m' +WHITE='\033[1;37m' +NC='\033[0m' # No Color + +echo "" +echo -e "${CYAN}============================================================${NC}" +echo -e "${CYAN} Gradle Offline Build Runner (macOS)${NC}" +echo -e "${CYAN} Environment: AIR-GAPPED (No Internet)${NC}" +echo -e "${CYAN} Mode: Fully Offline (--offline enforced)${NC}" +echo -e "${CYAN}============================================================${NC}" +echo "" + +# ============================================================================ +# [1/16] Check Current Directory +# ============================================================================ +echo -e "${YELLOW}==[1/16] Check Current Directory ==${NC}" +START_DIR="$(pwd)" +echo "PWD: $START_DIR" +echo "" + +# ============================================================================ +# [2/16] Select Archive +# ============================================================================ +echo -e "${YELLOW}==[2/16] Select Archive ==${NC}" + +ARCHIVE="" +if [ $# -ge 1 ]; then + ARCHIVE="$1" +fi + +if [ -z "$ARCHIVE" ]; then + # Auto-detect most recent .tar.gz file (macOS compatible) + ARCHIVE=$(find "$START_DIR" -maxdepth 1 -type f \( -name "*.tar.gz" -o -name "*.tgz" \) -exec stat -f "%m %N" {} \; 2>/dev/null | sort -rn | head -1 | cut -d' ' -f2-) + + if [ -z "$ARCHIVE" ]; then + echo -e "${RED}[ERROR] No archive found${NC}" + ls -lh "$START_DIR" + exit 1 + fi + + echo -e "${CYAN}[AUTO] $(basename "$ARCHIVE")${NC}" +else + if [ ! -f "$ARCHIVE" ]; then + ARCHIVE="$START_DIR/$ARCHIVE" + fi + echo -e "${CYAN}[USER] $(basename "$ARCHIVE")${NC}" +fi + +if [ ! -f "$ARCHIVE" ]; then + echo -e "${RED}ERROR: Archive not found: $ARCHIVE${NC}" + exit 1 +fi + +# macOS stat command +ARCHIVE_SIZE=$(stat -f%z "$ARCHIVE" 2>/dev/null) +ARCHIVE_SIZE_MB=$(awk "BEGIN {printf \"%.2f\", $ARCHIVE_SIZE / 1048576}") +echo "Size: ${ARCHIVE_SIZE_MB} MB" +echo "" + +# ============================================================================ +# [3/16] Check tar +# ============================================================================ +echo -e "${YELLOW}==[3/16] Check tar ==${NC}" + +if ! command -v tar &>/dev/null; then + echo -e "${RED}ERROR: tar not found${NC}" + exit 1 +fi +echo -e "${GREEN}[OK] tar found${NC}" +echo "" + +# ============================================================================ +# [4/16] Extract Archive +# ============================================================================ +echo -e "${YELLOW}==[4/16] Extract Archive ==${NC}" +echo -e "${GRAY}[INFO] Extracting...${NC}" + +tar -xzf "$ARCHIVE" -C "$START_DIR" +if [ $? -ne 0 ]; then + echo -e "${RED}ERROR: Extraction failed${NC}" + exit 1 +fi +echo -e "${GREEN}[OK] Extracted${NC}" +echo "" + +# ============================================================================ +# [5/16] Set Permissions +# ============================================================================ +echo -e "${YELLOW}==[5/16] Set Permissions ==${NC}" + +chmod -R u+rw "$START_DIR" 2>/dev/null || true +# Remove extended attributes that macOS may add +xattr -cr "$START_DIR" 2>/dev/null || true +echo -e "${GREEN}[OK] Permissions set${NC}" +echo "" + +# ============================================================================ +# [6/16] Find Project Root +# ============================================================================ +echo -e "${YELLOW}==[6/16] Find Project Root ==${NC}" + +GRADLEW=$(find "$START_DIR" -name "gradlew" -type f 2>/dev/null | sort | head -1) +if [ -z "$GRADLEW" ]; then + echo -e "${RED}ERROR: gradlew not found${NC}" + exit 1 +fi + +PROJECT_DIR=$(dirname "$GRADLEW") +echo -e "${CYAN}Project: $PROJECT_DIR${NC}" +cd "$PROJECT_DIR" +echo "" + +# ============================================================================ +# [7/16] Fix Permissions +# ============================================================================ +echo -e "${YELLOW}==[7/16] Fix Permissions ==${NC}" + +chmod +x ./gradlew +find . -name "*.sh" -type f -exec chmod +x {} \; 2>/dev/null || true +# Remove quarantine attributes that macOS adds to downloaded files +xattr -d com.apple.quarantine ./gradlew 2>/dev/null || true +find . -name "*.jar" -exec xattr -d com.apple.quarantine {} \; 2>/dev/null || true +echo -e "${GREEN}[OK] Permissions fixed${NC}" +echo "" + +# ============================================================================ +# [8/16] Verify Wrapper +# ============================================================================ +echo -e "${YELLOW}==[8/16] Verify Wrapper ==${NC}" + +WRAPPER_DIR="$PROJECT_DIR/gradle/wrapper" +WRAPPER_JAR="$WRAPPER_DIR/gradle-wrapper.jar" +WRAPPER_PROP="$WRAPPER_DIR/gradle-wrapper.properties" + +if [ ! -f "$WRAPPER_PROP" ]; then + echo -e "${RED}ERROR: gradle-wrapper.properties missing${NC}" + exit 1 +fi + +if [ ! -f "$WRAPPER_JAR" ]; then + SEED_JAR="$PROJECT_DIR/$WRAPPER_SEED_PATH/gradle-wrapper.jar" + if [ -f "$SEED_JAR" ]; then + mkdir -p "$WRAPPER_DIR" + cp "$SEED_JAR" "$WRAPPER_JAR" + echo -e "${GREEN}[OK] Injected from seed${NC}" + else + echo -e "${RED}ERROR: wrapper jar missing${NC}" + exit 1 + fi +else + echo -e "${GREEN}[OK] Wrapper verified${NC}" +fi +echo "" + +# ============================================================================ +# [9/16] Set GRADLE_USER_HOME +# ============================================================================ +echo -e "${YELLOW}==[9/16] Set GRADLE_USER_HOME ==${NC}" + +OFFLINE_HOME="$PROJECT_DIR/$OFFLINE_HOME_NAME" +if [ ! -d "$OFFLINE_HOME" ]; then + echo -e "${RED}ERROR: _offline_gradle_home not found in archive${NC}" + exit 1 +fi + +export GRADLE_USER_HOME="$OFFLINE_HOME" +echo -e "${CYAN}GRADLE_USER_HOME = $GRADLE_USER_HOME${NC}" + +# Check cache +CACHES_DIR="$OFFLINE_HOME/caches" +if [ -d "$CACHES_DIR" ]; then + # macOS du command + if du -k "$CACHES_DIR" &>/dev/null; then + CACHE_SIZE=$(du -sk "$CACHES_DIR" 2>/dev/null | cut -f1) + CACHE_SIZE=$((CACHE_SIZE * 1024)) + else + CACHE_SIZE=0 + fi + CACHE_SIZE_MB=$(awk "BEGIN {printf \"%.2f\", $CACHE_SIZE / 1048576}") + echo -e "${CYAN}[INFO] Cache size: ${CACHE_SIZE_MB} MB${NC}" +else + echo -e "${YELLOW}[WARN] No cache folder found${NC}" +fi +echo "" + +# ============================================================================ +# [10/16] Verify settings.gradle +# ============================================================================ +echo -e "${YELLOW}==[10/16] Verify settings.gradle ==${NC}" + +SETTINGS_FILE="" +if [ -f "./settings.gradle" ]; then + SETTINGS_FILE="settings.gradle" +elif [ -f "./settings.gradle.kts" ]; then + SETTINGS_FILE="settings.gradle.kts" +fi + +if [ -n "$SETTINGS_FILE" ]; then + if grep -q "mavenLocal()" "$SETTINGS_FILE" && grep -q "pluginManagement" "$SETTINGS_FILE"; then + echo -e "${GREEN}[OK] settings.gradle configured for offline${NC}" + else + echo -e "${YELLOW}[WARN] settings.gradle may not be configured for offline${NC}" + echo -e "${GRAY}[INFO] Build may fail if plugins not cached${NC}" + fi +fi +echo "" + +# ============================================================================ +# [11/16] Test Gradle +# ============================================================================ +echo -e "${YELLOW}==[11/16] Test Gradle ==${NC}" + +GRADLE_WORKS=false +if ./gradlew --offline --version &>/dev/null; then + GRADLE_WORKS=true + echo -e "${GREEN}[OK] Gradle working in offline mode${NC}" +else + echo -e "${YELLOW}[WARN] Gradle --version failed${NC}" +fi +echo "" + +# ============================================================================ +# [12/16] Stop Daemon +# ============================================================================ +echo -e "${YELLOW}==[12/16] Stop Daemon ==${NC}" + +./gradlew --stop &>/dev/null || true +sleep 2 +echo -e "${GREEN}[OK] Daemon stopped${NC}" +echo "" + +# ============================================================================ +# [13/16] Run Offline Build +# ============================================================================ +echo -e "${YELLOW}==[13/16] Run Offline Build ==${NC}" +echo "" +echo -e "${CYAN}============================================================${NC}" +echo -e "${CYAN} Building with --offline flag${NC}" +echo -e "${CYAN} All dependencies from local cache${NC}" +echo -e "${CYAN}============================================================${NC}" +echo "" + +BUILD_SUCCESS=false +BUILD_TASK="" + +# Try bootJar +echo -e "${GRAY}[TRY] --offline bootJar...${NC}" +if ./gradlew --offline clean bootJar --no-daemon; then + BUILD_SUCCESS=true + BUILD_TASK="bootJar" +fi + +# Try jar +if [ "$BUILD_SUCCESS" = false ]; then + echo -e "${GRAY}[TRY] --offline jar...${NC}" + if ./gradlew --offline clean jar --no-daemon; then + BUILD_SUCCESS=true + BUILD_TASK="jar" + fi +fi + +# Try build +if [ "$BUILD_SUCCESS" = false ]; then + echo -e "${GRAY}[TRY] --offline build...${NC}" + if ./gradlew --offline build --no-daemon; then + BUILD_SUCCESS=true + BUILD_TASK="build" + fi +fi + +echo "" +if [ "$BUILD_SUCCESS" = true ]; then + echo -e "${GREEN}============================================================${NC}" + echo -e "${GREEN} BUILD SUCCESS! (task: $BUILD_TASK)${NC}" + echo -e "${GREEN}============================================================${NC}" +else + echo -e "${RED}============================================================${NC}" + echo -e "${RED} BUILD FAILED!${NC}" + echo -e "${RED}============================================================${NC}" + echo "" + echo -e "${YELLOW}Possible causes:${NC}" + echo -e "${WHITE} - Dependencies not in cache${NC}" + echo -e "${WHITE} - Plugin resolution failed${NC}" + echo -e "${WHITE} - Need complete build in online env first${NC}" + exit 1 +fi +echo "" + +# ============================================================================ +# [14/16] Show Build Output +# ============================================================================ +echo -e "${YELLOW}==[14/16] Build Output ==${NC}" + +LIBS_DIR="$PROJECT_DIR/build/libs" +if [ -d "$LIBS_DIR" ]; then + echo -e "${CYAN}build/libs contents:${NC}" + ls -lh "$LIBS_DIR"/*.jar 2>/dev/null | awk '{printf " %-40s %10s\n", $9, $5}' + + MAIN_JAR=$(find "$LIBS_DIR" -name "*.jar" -type f ! -name "*-plain.jar" ! -name "*-sources.jar" ! -name "*-javadoc.jar" 2>/dev/null | head -1) +else + echo -e "${YELLOW}[WARN] build/libs not found${NC}" +fi +echo "" + +# ============================================================================ +# [15/16] Run Instructions +# ============================================================================ +echo -e "${YELLOW}==[15/16] Run Instructions ==${NC}" +echo "" + +if [ -n "$MAIN_JAR" ]; then + echo -e "${CYAN}To run the application:${NC}" + echo -e "${WHITE} java -jar $(basename "$MAIN_JAR")${NC}" + echo "" +fi + +echo -e "${CYAN}To rebuild:${NC}" +echo -e "${WHITE} export GRADLE_USER_HOME=\"./_offline_gradle_home\"${NC}" +echo -e "${WHITE} ./gradlew --offline bootJar --no-daemon${NC}" +echo "" + +# ============================================================================ +# [16/16] Complete +# ============================================================================ +echo -e "${GREEN}============================================================${NC}" +echo -e "${GREEN} Offline Build Complete!${NC}" +echo -e "${GREEN}============================================================${NC}" +echo "" +echo -e "${CYAN}Project: $PROJECT_DIR${NC}" +echo ""