添加条形码内容
This commit is contained in:
@ -20,7 +20,9 @@ def create_app():
|
||||
# 2. 注册蓝图 (Blueprints)
|
||||
# =========================================================
|
||||
|
||||
# 注册入库聚合模块 (Inbound)
|
||||
# -----------------------------------------------------
|
||||
# 2.1 注册入库聚合模块 (Inbound)
|
||||
# -----------------------------------------------------
|
||||
try:
|
||||
# 指向聚合文件: app/api/v1/inbound/__init__.py
|
||||
# 该文件里应该包含了 buy, semi, base, product 的聚合逻辑
|
||||
@ -29,9 +31,6 @@ def create_app():
|
||||
# 注册父蓝图,路由前缀为 /api/v1/inbound
|
||||
# 最终路由效果:
|
||||
# /api/v1/inbound + /buy/list -> /api/v1/inbound/buy/list
|
||||
# /api/v1/inbound + /semi/list -> /api/v1/inbound/semi/list
|
||||
# /api/v1/inbound + /product/list -> /api/v1/inbound/product/list
|
||||
# /api/v1/inbound + /base/search -> /api/v1/inbound/base/search
|
||||
app.register_blueprint(inbound_bp, url_prefix='/api/v1/inbound')
|
||||
|
||||
print("✅ Inbound (Buy, Semi, Product, Base) 模块注册成功")
|
||||
@ -39,6 +38,22 @@ def create_app():
|
||||
except ImportError as e:
|
||||
print(f"❌ 错误: Inbound 模块导入失败: {e}")
|
||||
|
||||
# -----------------------------------------------------
|
||||
# 2.2 注册通用打印模块 (Common Print) - [新增]
|
||||
# -----------------------------------------------------
|
||||
try:
|
||||
from app.api.v1.common.print import print_bp
|
||||
|
||||
# 注册打印蓝图
|
||||
# 前端请求地址: /common/print/preview
|
||||
# 配合 baseURL=/api/v1,最终对应后端: /api/v1/common/print/preview
|
||||
app.register_blueprint(print_bp, url_prefix='/api/v1/common/print')
|
||||
|
||||
print("✅ Print (Label Printing) 模块注册成功")
|
||||
|
||||
except ImportError as e:
|
||||
print(f"❌ 错误: Print 模块导入失败: {e}")
|
||||
|
||||
# =========================================================
|
||||
# 3. 预加载数据模型 (解决 relationship 找不到模型的问题)
|
||||
# =========================================================
|
||||
@ -50,7 +65,7 @@ def create_app():
|
||||
from app.models.inbound.buy import StockBuy
|
||||
# 3. 半成品入库
|
||||
from app.models.inbound.semi import StockSemi
|
||||
# 4. 成品入库 (新增)
|
||||
# 4. 成品入库
|
||||
from app.models.inbound.product import StockProduct
|
||||
|
||||
# 开发环境如果需要自动建表,可以取消注释
|
||||
|
||||
Reference in New Issue
Block a user