yj
2025-07-22 2a8d022a20f82c35e9df680dfb66c3c95863b190
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""
配置管理模块
"""
 
import os
from typing import Optional
from pydantic_settings import BaseSettings
 
 
class Settings(BaseSettings):
    """应用配置"""
 
    # 数据库配置
    database_url: str = "mysql+pymysql://root:TAI%402019%23Zjun@120.24.39.179:3306/ecloud_dify"
 
    # Redis配置
    redis_url: str = "redis://localhost:6379/0"
 
    # E云管家配置
    ecloud_base_url: str = "http://your-ecloud-domain.com"
    ecloud_authorization: str = "your-authorization-token"
 
    # DifyAI配置
    dify_base_url: str = "https://api.dify.ai/v1"
    dify_api_key: str = "your-dify-api-key"
 
    # 服务配置
    server_host: str = "0.0.0.0"
    server_port: int = 8000
    debug: bool = True
 
    # 日志配置
    log_level: str = "INFO"
    log_file: str = "logs/app.log"
 
    # 消息处理配置
    max_retry_count: int = 3
    retry_delay: int = 5  # 秒
    queue_timeout: int = 300  # 秒
 
    class Config:
        env_file = ".env"
        env_file_encoding = "utf-8"
 
 
# 全局配置实例
settings = Settings()