# -*- coding: utf-8 -*-
"""
paths.py — 服务监测模块私有路径常量

注意：本模块独立于全局 utils/paths.py，仅供 service_monitor 子包内部使用。
不在全局路径常量中追加服务监测相关路径，保持代码物理隔离。
"""

from pathlib import Path

# service_monitor/ 子包根目录
MODULE_DIR = Path(__file__).resolve().parent.parent

# 静态资源目录：bash 检测模块
ASSETS_DIR = MODULE_DIR / "assets"
SYSTEM_ASSETS_DIR = ASSETS_DIR / "system"
SERVICE_ASSETS_DIR = ASSETS_DIR / "service"
COMMON_SH = ASSETS_DIR / "common.sh"
CONFIG_TEMPLATE = ASSETS_DIR / "config.sh.template"

# 数据目录：目标列表 + 报告归档
DATA_DIR = MODULE_DIR / "data"
REPORTS_DIR = DATA_DIR / "reports"
TARGETS_FILE = DATA_DIR / "targets.json"
SCHEDULES_FILE = DATA_DIR / "schedules.json"
NOTIFICATIONS_FILE = DATA_DIR / "notifications.json"


def ensure_dirs() -> None:
    """确保运行时所需目录存在（首次启动调用）。"""
    DATA_DIR.mkdir(parents=True, exist_ok=True)
    REPORTS_DIR.mkdir(parents=True, exist_ok=True)
