Geojson File Monitoring System Docu Fix - Daniel C No.2

This commit is contained in:
sanghyeonhd
2025-11-21 10:25:14 +09:00
parent f847b55c89
commit 0dab9d7a96
2 changed files with 186 additions and 134 deletions

View File

@@ -225,4 +225,189 @@ tail -f logs/application.log | grep "geojson"
2. **웹 UI**: 모니터링 및 관리를 위한 웹 인터페이스
3. **배치 처리**: 대용량 파일을 위한 비동기 배치 처리
4. **데이터 검증**: 더 상세한 GeoJSON 데이터 검증 룰
5. **성능 모니터링**: 처리 시간, 메모리 사용량 등 성능 지표 수집
5. **성능 모니터링**: 처리 시간, 메모리 사용량 등 성능 지표 수집
#### 터미널 API 테스트 로그
deniallee@Denialui-MacBookPro-2 kamco-dabeeo-backoffice % curl -s "http://localhost:8080/api/geojson/monitor/status" | jq .
{
"cronExpression": "0/30 * * * * *",
"processedDirectory": "/Users/deniallee/geojson/processed",
"watchDirectory": "/Users/deniallee/geojson/upload",
"errorDirectory": "/Users/deniallee/geojson/error",
"maxFileSize": 104857600,
"maxFileSizeMB": 100,
"supportedExtensions": [
"zip",
"tar",
"tar.gz",
"tgz"
]
}
deniallee@Denialui-MacBookPro-2 kamco-dabeeo-backoffice % curl -s "http://localhost:8080/api/geojson/monitor/stats" | jq .
{
"fileSystem": {
"processedDirectoryCount": 1,
"errorDirectoryCount": 2,
"watchDirectoryCount": 1
},
"database": {
"totalLearnData": 1,
"totalGeomData": 1,
"pendingAnalysis": 0
},
"monitoring": {
"errorDirectory": "/Users/deniallee/geojson/error",
"isActive": true,
"watchDirectory": "/Users/deniallee/geojson/upload",
"processedDirectory": "/Users/deniallee/geojson/processed",
"cronExpression": "0/30 * * * * *"
}
}
deniallee@Denialui-MacBookPro-2 kamco-dabeeo-backoffice % curl -X POST -s "http://localhost:8080/api/geojson/monitor/init-d
irectories" | jq .
{
"status": "success",
"message": "디렉토리 초기화가 완료되었습니다."
}
deniallee@Denialui-MacBookPro-2 kamco-dabeeo-backoffice % curl -X POST -s "http://localhost:8080/api/geojson/process/geomet
ry" | jq .
{
"message": "Geometry 변환이 완료되었습니다.",
"processedCount": 0,
"processedIds": [],
"status": "success"
}
deniallee@Denialui-MacBookPro-2 kamco-dabeeo-backoffice %
# GeoJSON 파일 모니터링 시스템 - API 문제 해결 리스트
## 🔧 해결된 문제들
### 1. **누락된 Stats API 추가**
- **문제**: `/monitor/stats` 엔드포인트가 없어서 500 에러 발생
- **해결**: 시스템 통계 정보를 제공하는 완전한 API 구현
### 2. **Repository 메서드 누락**
- **문제**: `countByAnalState` 메서드 미구현으로 컴파일 에러
- **해결**: `MapSheetLearnDataRepository`에 메서드 추가
### 3. **Import 누락**
- **문제**: `HashMap`, Repository 클래스들 import 누락
- **해결**: 필요한 모든 import 문 추가
## 📊 **현재 사용 가능한 API 목록**
### ✅ **GET APIs**
#### 1. 모니터링 상태 조회
```bash
curl "http://localhost:8080/api/geojson/monitor/status"
```
**응답 예시:**
```json
{
"cronExpression": "0/30 * * * * *",
"processedDirectory": "/Users/deniallee/geojson/processed",
"watchDirectory": "/Users/deniallee/geojson/upload",
"errorDirectory": "/Users/deniallee/geojson/error",
"maxFileSize": 104857600,
"maxFileSizeMB": 100,
"supportedExtensions": ["zip", "tar", "tar.gz", "tgz"]
}
```
#### 2. 시스템 통계 조회 **[신규 추가]**
```bash
curl "http://localhost:8080/api/geojson/monitor/stats"
```
**응답 예시:**
```json
{
"fileSystem": {
"processedDirectoryCount": 1,
"errorDirectoryCount": 2,
"watchDirectoryCount": 1
},
"database": {
"totalLearnData": 1,
"totalGeomData": 1,
"pendingAnalysis": 0
},
"monitoring": {
"errorDirectory": "/Users/deniallee/geojson/error",
"isActive": true,
"watchDirectory": "/Users/deniallee/geojson/upload",
"processedDirectory": "/Users/deniallee/geojson/processed",
"cronExpression": "0/30 * * * * *"
}
}
```
### ✅ **POST APIs**
#### 1. 디렉토리 초기화
```bash
curl -X POST "http://localhost:8080/api/geojson/monitor/init-directories"
```
**응답 예시:**
```json
{
"status": "success",
"message": "디렉토리 초기화가 완료되었습니다."
}
```
#### 2. 수동 파일 처리
```bash
curl -X POST "http://localhost:8080/api/geojson/process/file?filePath=/path/to/file.zip"
```
#### 3. 미처리 Geometry 변환
```bash
curl -X POST "http://localhost:8080/api/geojson/process/geometry"
```
**응답 예시:**
```json
{
"message": "Geometry 변환이 완료되었습니다.",
"processedCount": 0,
"processedIds": [],
"status": "success"
}
```
#### 4. 특정 학습 데이터 Geometry 변환
```bash
curl -X POST "http://localhost:8080/api/geojson/process/geometry/convert" \
-H "Content-Type: application/json" \
-d '[1, 2, 3]'
```
## 🎯 **주요 개선사항**
1. **완전한 통계 정보 제공**
- 데이터베이스 통계 (학습 데이터, Geometry 데이터 수)
- 파일 시스템 통계 (각 폴더별 파일 수)
- 모니터링 설정 정보
2. **견고한 에러 처리**
- 각 API별 적절한 에러 처리
- 상세한 에러 메시지 제공
- 로깅을 통한 디버깅 지원
3. **일관된 응답 형식**
- 성공/실패 상태 명확히 구분
- JSON 형식 통일
- 적절한 HTTP 상태 코드
## 🚀 **시스템 현재 상태**
-**모니터링 시스템**: 정상 작동 (30초 간격)
-**API 서버**: http://localhost:8080 에서 실행 중
-**데이터베이스**: PostgreSQL + PostGIS 연결됨
-**파일 처리**: 자동 ZIP/TAR 처리 가능
-**통계 조회**: 실시간 시스템 상태 확인 가능
---