"""
估值分析模块配置文件
"""

import os
from pathlib import Path

# 数据库配置
DB_CONFIG = {
    'host': '192.168.18.199',
    'port': 3306,
    'user': 'root',
    'password': 'Chlry#$.8',
    'database': 'db_gp_cj'
}
# redis配置
REDIS_CONFIG = {
    'host': '192.168.18.208',
    'port': 6379,
    'password': 'wlkj2018',
    'db': 13,
    'socket_timeout': 5
}
# 创建数据库连接URL
DB_URL = f"mysql+pymysql://{DB_CONFIG['user']}:{DB_CONFIG['password']}@{DB_CONFIG['host']}:{DB_CONFIG['port']}/{DB_CONFIG['database']}"

# MongoDB配置
MONGO_CONFIG = {
    'host': '192.168.18.75',
    'port': 27017,
    'db': 'judge',
    'username': 'root',
    'password': 'wlkj2018',
    'collection': 'wind_financial_analysis'
}
# MongoDB配置
MONGO_CONFIG2 = {
    'host': '192.168.20.110',
    'port': 27017,
    'db': 'judge',
    'username': 'root',
    'password': 'wlkj2018',
    'collection': 'wind_financial_analysis'
}

# --- MySQL配置（用于个股标签关联分析模块）
DB_CONFIG_TAG_ANALYSIS = {
    'host': '192.168.18.199',
    'port': 3306,
    'user': 'root',
    'password': 'Chlry#$.8',
    'database': 'db_gp_cj'
}
# 创建数据库连接URL（用于个股标签关联分析模块）
DB_URL_TAG_ANALYSIS = f"mysql+pymysql://{DB_CONFIG_TAG_ANALYSIS['user']}:{DB_CONFIG_TAG_ANALYSIS['password']}@{DB_CONFIG_TAG_ANALYSIS['host']}:{DB_CONFIG_TAG_ANALYSIS['port']}/{DB_CONFIG_TAG_ANALYSIS['database']}"

# MongoDB配置（用于个股标签关联分析模块）
MONGO_CONFIG222 = {
    'host': '192.168.16.222',
    'port': 27017,
    'db': 'stock_predictions',
    'username': 'stockvix',
    'password': '!stock@vix2',
    'collection': 'tag_relation_analysis'  # 默认集合名
}

# 项目根目录
ROOT_DIR = Path(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))

# 结果输出目录
OUTPUT_DIR = ROOT_DIR / "results" / "valuation_analysis"

# 确保输出目录存在
os.makedirs(OUTPUT_DIR, exist_ok=True)

# 日志配置
LOG_FILE = ROOT_DIR / "logs" / "valuation_analysis.log"

# 确保日志目录存在
os.makedirs(LOG_FILE.parent, exist_ok=True) 