Refactor configuration management and remove deprecated files
- Consolidated database, file source, and field mapping configurations into dedicated modules under the `config` directory. - Removed hardcoded database connection details from `migration.py` and replaced them with imports from the new configuration structure. - Updated `ntfy_utils.py` and `run_incremental_sync.py` to utilize the new configuration imports for cleaner code and better maintainability. - Deleted `update_config.py` as its contents have been integrated into the new configuration files. - Added a new `settings.local.json` for managing permissions related to script execution. - Enhanced the structure of the migration tasks and Excel configurations for better organization and clarity.
This commit is contained in:
32
config/__init__.py
Normal file
32
config/__init__.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# config/__init__.py
|
||||
# 统一配置导出接口
|
||||
|
||||
# 数据库配置
|
||||
from .database import SQL_SERVER_CONFIG, SQL_SERVER_CONN, DB_CONFIG, ACCESS_DRIVER
|
||||
|
||||
# 文件路径配置
|
||||
from .file_sources import SYNC_MAPPING, EXCEL_CONFIGS, MIGRATION_TASKS
|
||||
|
||||
# 字段映射配置
|
||||
from .field_mappings import TABLE_SCHEMA, CONTRACT_MAPPING
|
||||
|
||||
# 应用设置
|
||||
from .app_settings import (
|
||||
LOG_TABLE_CONFIG, NTFY_CONFIG,
|
||||
POLL_INTERVAL, BATCH_SIZE, CACHE_DIR, TEMP_DIR,
|
||||
EXECUTION_CARD_FIELDS, CONTRACT_DATA_FIELDS, CONTRACT_DATA_MAPPING
|
||||
)
|
||||
|
||||
# 统一导出列表
|
||||
__all__ = [
|
||||
# Database
|
||||
'SQL_SERVER_CONFIG', 'SQL_SERVER_CONN', 'DB_CONFIG', 'ACCESS_DRIVER',
|
||||
# File Sources
|
||||
'SYNC_MAPPING', 'EXCEL_CONFIGS', 'MIGRATION_TASKS',
|
||||
# Field Mappings
|
||||
'TABLE_SCHEMA', 'CONTRACT_MAPPING',
|
||||
# App Settings
|
||||
'LOG_TABLE_CONFIG', 'NTFY_CONFIG',
|
||||
'POLL_INTERVAL', 'BATCH_SIZE', 'CACHE_DIR', 'TEMP_DIR',
|
||||
'EXECUTION_CARD_FIELDS', 'CONTRACT_DATA_FIELDS', 'CONTRACT_DATA_MAPPING'
|
||||
]
|
||||
Reference in New Issue
Block a user