- `docs/` 를 .gitignore 에서 빼 git 추적 대상으로 전환 (위키·완료 이력·검증 기록) - `docs/raw/PLAN.md` · `docs/raw/OWNERS.md` 를 저장소 최상위로 이동 후 .gitignore 에 등록 — 창끼리 공유하되 저장소에는 안 올리는 장부 - 살아 있는 경로 참조 7개 파일 정정 (아카이브 107건은 그때 사실이라 그대로 둠) - graphify 날짜별 산출물(`docs/wiki/graphify-out/20*/`) 제외 — `graphify update` 가 다시 만듦 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
48 lines
5.1 KiB
Markdown
48 lines
5.1 KiB
Markdown
---
|
|
type: concept
|
|
status: stable
|
|
related_pages: ["[[B01_Dashboard/B01_backend]]", "[[B03_FileInput/B03_backend]]", "[[B04_PreProcess/B04_backend]]", "[[B05_Profile/B05_backend]]", "[[B06_Section/B06_backend]]", "[[auth_rbac]]", "[[architecture/shared_resources]]"]
|
|
last_updated: 2026-08-13
|
|
source: ["docs/raw/verification/2026-07-19_verify_half_width_persistence.md", "docs/raw/verification/2026-07-19_verify_B05_B06_차트_레이아웃_후속보정.md", "docs/raw/verification/2026-07-20_verify_B07_상세설계개선.md", "docs/raw/verification/2026-08-01_verify_B04_detailed_basins.md", "docs/raw/verification/2026-08-08_verify_project_delete_hard.md", "docs/raw/verification/2026-08-13_verify_rainfall_wamis_station.md"]
|
|
---
|
|
|
|
# 공통 유틸 (common_util/)
|
|
|
|
> 둘 이상의 페이지가 실제로 공유하는 경로·원자적 파일쓰기·기하 유틸만 이 폴더에 배치 (migration_plan.md 2.2)
|
|
|
|
| 파일 | 역할 | 사용처 |
|
|
|---|---|---|
|
|
| `common_util_validate.ts` | 프론트 1차 유효성 검사 (이메일/빈값/최소길이) | 전 페이지 |
|
|
| `common_util_auth.py` | 비밀번호·OTP·세션 쿠키·권한 검증, 디바이스 토큰(32B) 발급 및 SHA256 해시, HttpOnly 쿠키 헬퍼 | 전 페이지 → [[auth_rbac]] |
|
|
| `common_util_auth_repository.py` | 인증·조직·관리 Raw SQL 저장소 (신뢰 기기 토큰 검증 포함) | 인증 관련 |
|
|
| `common_util_email.py` | 비동기 SMTP 발송+재시도(최대3회) | OTP/승인 알림 |
|
|
| `common_util_email_templates.py` | 인증·조직 알림 이메일 템플릿 | common_util_email.py |
|
|
| `common_util_string.ts` | 문자열 유틸 | 미상세 |
|
|
| `common_util_storage.py` | 프로젝트·워크플로우 단계별 저장 경로 | → [[storage_paths]] |
|
|
| `common_util_project_delete.py` | 프로젝트 DB/디스크 하드 삭제 유틸 | → [[concepts/common_util/common_util_project_delete]] |
|
|
| `common_util_json.py` | JSON 원자적 저장 | workflow.json 등 |
|
|
| `common_util_atomic.py` | 임시 파일을 활용한 바이트 및 npz 데이터 원자적 저장 오퍼레이션 | [[B04_PreProcess/B04_backend]] |
|
|
| `common_util_workflow.py` | 공유 workflow.json 상태 처리 | ⚠️ [[workflow_state]] 재설계로 대체/정리 예정 |
|
|
| `common_util_resource_monitor.py` | 시스템 리소스 계측(2분 주기) + log + DB 기록 | `sample_resources_loop()` → [[B01_Dashboard/B01_backend|B01_Dashboard]] |
|
|
| `common_util_surface_confirmation.py` | 지표면 확정 params 스냅샷 저장, B05 등고선 간격 영속화(`update_contour_interval_param`), config 폴백 조회 헬퍼 | [[B03_FileInput/B03_backend]], [[B04_PreProcess/B04_backend]], [[B05_Profile/B05_backend]] |
|
|
| `common_util_wamis_station.py` | WAMIS 621개 관측소 xlsx 기반 확률강우량 수급, 반경 10km 최대 지점 선정, Mononobe/General IDF 산출 | [[B04_PreProcess/B04_backend]], [[concepts/drainage_watershed]] |
|
|
| `common_util_wamis_rainfall.py` | WAMIS 제주 등우선 내삽(96조합) 및 +10km 범위 밖 예외 전파 커버리지 가드 (`value_at`) | [[B04_PreProcess/B04_backend]], [[concepts/drainage_watershed]] |
|
|
| `common_util_drainage_detail.py` | B04/B05 공용 배수유역/세부유역 분할 및 도로 흐름 수신사 할당 코어 알고리즘 엔진 | [[B04_PreProcess/B04_backend]], [[B05_Profile/B05_backend]] |
|
|
| `common_util_route_profile.py` | 종단 Z 해석기 및 노선 동일성 판정 API (`resolve_route_profile`, `routes_match`) | [[B04_PreProcess/B04_backend]], [[B05_Profile/B05_backend]] |
|
|
| `common_util_drainage_context.py` | B04/B05 배수 엔진 연동을 위한 공용 입력 콘텍스트 구조 정의 | [[B04_PreProcess/B04_backend]], [[B05_Profile/B05_backend]] |
|
|
| `common_util_surface_sampler.py` | 종단/횡단 생성에 필요한 포인트 클라우드 지표면 고도 샘플러 | [[B04_PreProcess/B04_backend]], [[B05_Profile/B05_backend]] |
|
|
| `common_util_drainage_pipes.py` | 관 매설 지점 정보(`pipe_points.json`) 저장 및 원청 CSV 해시 검증 | [[B04_PreProcess/B04_backend]], [[B05_Profile/B05_backend]] |
|
|
| `common_util_http_cache.py` | HTTP cache-control, ETag 헤더 기반 304 Not Modified 캐시 유틸 | [[B04_PreProcess/B04_backend]], [[B05_Profile/B05_backend]] |
|
|
| `B05_Profile_Engine_Sections.py:prune_stale_cross_files` | 유효 측점 목록(`stations`) 기반 구버전 잔재 `cross_*.json` 자동 삭제 및 오삭제 방지 가드 | [[B05_Profile/B05_backend]], [[B06_Section/B06_backend]], [[B08_DesignDetail/B08_backend]] |
|
|
| `common_util_format.py` | 포맷 유틸 | 미상세 |
|
|
|
|
## 이메일 발송 (common_util_email.py)
|
|
- 개발: Google Gmail SMTP / 상용: Google Workspace 또는 AWS SES
|
|
- 발송 유형: OTP, 가입확인, 팀원승인요청(ADMIN), 승인/거부결과, 회사참여신청(SYSTEM_ADMIN), 인증갱신알림
|
|
|
|
## 리소스 모니터링 (common_util_resource_monitor.py)
|
|
- `main.py` lifespan에서 `asyncio.create_task` 등록/취소
|
|
- 계측: `psutil.cpu_percent`, `psutil.virtual_memory().percent`, `shutil.disk_usage`
|
|
- 이중 기록: `system_resources` 테이블 (DB) + `log/system_resources.log` (탭 구분 1줄, `.gitignore`)
|
|
- 30일 롤링 삭제 (DB `DELETE`, 로그파일 오래된 줄 제거)
|