2026-01-27 15:50:23 +08:00
|
|
|
|
from flask import Blueprint
|
2026-01-27 18:10:09 +08:00
|
|
|
|
|
|
|
|
|
|
# 1. 导入同目录下的 buy 模块 (假设文件名为 buy.py)
|
2026-01-27 15:50:23 +08:00
|
|
|
|
from .buy import inbound_buy_bp
|
|
|
|
|
|
|
2026-01-27 18:10:09 +08:00
|
|
|
|
# 2. 【关键修改】导入同目录下的 base 模块
|
|
|
|
|
|
# 使用相对导入 .base,这样 Python 就会去 app/api/v1/inbound/base.py 找
|
|
|
|
|
|
from .base import inbound_base_bp
|
|
|
|
|
|
|
|
|
|
|
|
# 创建父级蓝图 'inbound'
|
2026-01-27 15:50:23 +08:00
|
|
|
|
inbound_bp = Blueprint('inbound', __name__)
|
|
|
|
|
|
|
2026-01-27 18:10:09 +08:00
|
|
|
|
# 3. 挂载子蓝图
|
|
|
|
|
|
# 最终路由将是: /api/v1/inbound/buy/...
|
2026-01-27 15:50:23 +08:00
|
|
|
|
inbound_bp.register_blueprint(inbound_buy_bp, url_prefix='/buy')
|
|
|
|
|
|
|
2026-01-27 18:10:09 +08:00
|
|
|
|
# 最终路由将是: /api/v1/inbound/base/...
|
|
|
|
|
|
inbound_bp.register_blueprint(inbound_base_bp, url_prefix='/base')
|