From 9a04f65eb79c50cc1570f7db6de67dd53521556f Mon Sep 17 00:00:00 2001 From: dxc Date: Tue, 27 Jan 2026 18:10:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E9=94=99=E8=AF=AF=EF=BC=8C=E6=9C=AA=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/api/v1/inbound/__init__.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/inventory-backend/app/api/v1/inbound/__init__.py b/inventory-backend/app/api/v1/inbound/__init__.py index ff119b1..883c8cb 100644 --- a/inventory-backend/app/api/v1/inbound/__init__.py +++ b/inventory-backend/app/api/v1/inbound/__init__.py @@ -1,14 +1,18 @@ from flask import Blueprint -from .buy import inbound_buy_bp -# 后续如果有 semi.py 或 product.py,在这里导入 -# from .semi import inbound_semi_bp -# 创建聚合蓝图 +# 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__) -# 挂载子模块。url_prefix 会进行路径拼接 -# 路径变为:/buy/... +# 3. 挂载子蓝图 +# 最终路由将是: /api/v1/inbound/buy/... inbound_bp.register_blueprint(inbound_buy_bp, url_prefix='/buy') -# 后续扩展: -# inbound_bp.register_blueprint(inbound_semi_bp, url_prefix='/semi') \ No newline at end of file +# 最终路由将是: /api/v1/inbound/base/... +inbound_bp.register_blueprint(inbound_base_bp, url_prefix='/base') \ No newline at end of file