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