2025-02-25 19:50:00 +08:00
|
|
|
|
# API模块初始化文件
|
|
|
|
|
|
from flask import Blueprint
|
|
|
|
|
|
import logging
|
|
|
|
|
|
|
|
|
|
|
|
# 创建API蓝图
|
|
|
|
|
|
api_bp = Blueprint('api', __name__, url_prefix='/api')
|
|
|
|
|
|
|
|
|
|
|
|
# 注册默认路由
|
|
|
|
|
|
@api_bp.route('/')
|
|
|
|
|
|
def index():
|
|
|
|
|
|
return {
|
|
|
|
|
|
'name': 'Email System API',
|
|
|
|
|
|
'version': '1.0.0',
|
|
|
|
|
|
'status': 'running'
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# 导入并合并所有API路由
|
|
|
|
|
|
# 为避免可能的文件读取问题,改为从routes.py模块中导入所有路由定义
|
|
|
|
|
|
try:
|
|
|
|
|
|
from .routes import *
|
2025-02-26 11:47:15 +08:00
|
|
|
|
# 导入解码邮件路由模块
|
|
|
|
|
|
from .decoded_email_routes import *
|
2025-02-25 19:50:00 +08:00
|
|
|
|
except Exception as e:
|
|
|
|
|
|
logging.error(f"导入API路由时出错: {str(e)}")
|
|
|
|
|
|
raise
|