- 移除 services/__init__.py 中的所有服务导入导出 - 将各个蓝图中的通配符导入改为具体服务模块导入 - 将 files_rename 函数重命名为 file_rename 并更新相关引用 - 更新前端 API 调用中的函数名映射 - 修复视频蓝图中的多余空行问题 - 移除种子蓝图中的未使用路由代码
18 lines
425 B
Python
18 lines
425 B
Python
from flask import Blueprint, current_app, Response
|
|
|
|
from app.services.book_service import BookService
|
|
|
|
bp = Blueprint("book", __name__)
|
|
|
|
|
|
@bp.route("/download")
|
|
def book_download():
|
|
book_object = BookService()
|
|
app = current_app._get_current_object()
|
|
|
|
def generate():
|
|
with app.app_context():
|
|
yield from book_object.book_download()
|
|
|
|
return Response(generate(), mimetype='text/event-stream')
|