Files
KCGL/inventory-backend/app/api/v1/inbound/__init__.py

18 lines
626 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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')