44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
"""
|
|
API 蓝图模块
|
|
"""
|
|
from flask import Blueprint
|
|
|
|
# 配置管理蓝图
|
|
config_bp = Blueprint('config', __name__, url_prefix='/api')
|
|
|
|
# 实体管理蓝图
|
|
entity_bp = Blueprint('entity', __name__, url_prefix='/api')
|
|
|
|
# 字段列表蓝图
|
|
field_bp = Blueprint('field', __name__, url_prefix='/api')
|
|
|
|
# 日报生成和历史记录蓝图
|
|
report_bp = Blueprint('report', __name__, url_prefix='/api')
|
|
|
|
# 数据库初始化蓝图
|
|
init_bp = Blueprint('init', __name__, url_prefix='/api')
|
|
|
|
# 文件下载蓝图
|
|
download_bp = Blueprint('download', __name__, url_prefix='/api')
|
|
|
|
# 求和数据管理蓝图
|
|
sum_data_bp = Blueprint('sum_data', __name__, url_prefix='/api')
|
|
|
|
# 认证蓝图
|
|
from .auth_api import auth_bp
|
|
|
|
# 导入各模块的路由
|
|
from . import config_api, entity_api, field_api, report_api, init_api, download_api, sum_data_api
|
|
|
|
|
|
def register_blueprints(app):
|
|
"""注册所有蓝图"""
|
|
app.register_blueprint(config_bp)
|
|
app.register_blueprint(entity_bp)
|
|
app.register_blueprint(field_bp)
|
|
app.register_blueprint(report_bp)
|
|
app.register_blueprint(init_bp)
|
|
app.register_blueprint(download_bp)
|
|
app.register_blueprint(sum_data_bp)
|
|
app.register_blueprint(auth_bp)
|