(no commit message provided)

Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
dxc
2026-02-09 11:44:24 +08:00
parent 03aea51e9a
commit c06b96f149
2 changed files with 49 additions and 9 deletions

View File

@ -1,22 +1,23 @@
from flask import Blueprint
# 首先创建主蓝图,避免子模块导入时出现循环依赖
inbound_bp = Blueprint('inbound', __name__)
# 导入各子模块的蓝图(此时 inbound_bp 已定义,子模块可以安全导入它)
from .buy import inbound_buy_bp
from .semi import inbound_semi_bp
from .base import inbound_base_bp
from .product import inbound_product_bp
from .inbound_summary import bp as inbound_summary_bp
# ★ [修正] 正确导入 service 模块的蓝图 (假设你在 service.py 里定义的是 bp)
from .service import bp as inbound_service_bp
# 导入 service 模块,使其路由装饰器可以正常注册到 inbound_bp 上
from . import service
inbound_bp = Blueprint('inbound', __name__)
# 注册原有模块
# 注册子蓝图
inbound_bp.register_blueprint(inbound_buy_bp, url_prefix='/buy')
inbound_bp.register_blueprint(inbound_semi_bp, url_prefix='/semi')
inbound_bp.register_blueprint(inbound_base_bp, url_prefix='/base')
inbound_bp.register_blueprint(inbound_product_bp, url_prefix='/product')
inbound_bp.register_blueprint(inbound_summary_bp, url_prefix='/summary')
# ★ [修正] 注册 service 模块,前缀设为 /service
# 最终访问路径: /api/v1/inbound/service
inbound_bp.register_blueprint(inbound_service_bp, url_prefix='/service')
# service 模块的路由已经直接附加到 inbound_bp无需再注册子蓝图