feat(app): 添加 ASMR 和磁力链接功能模块
- 新增 asmr_bp 蓝图模块和 AsmrService 服务 - 新增 magnet_bp 蓝图模块和 MagnetService 服务 - 在应用初始化时注册新的蓝图模块 - 将 switch 语句替换为 if-elif 语句进行配置管理 - 在前端界面添加 ASMR 功能入口 - 增加 libtorrent 依赖包 - 修复字符串引号使用问题 - 增加文件重命名异常处理 - 扩展类型注解支持 Union 类型 - 增加请求超时时间到 30 秒 - 优化前端错误处理逻辑
This commit is contained in:
+10
-8
@@ -2,7 +2,7 @@ from flask import Flask
|
||||
from flask_cors import CORS
|
||||
from .extensions import db, migrate
|
||||
from .config import DevelopmentConfig, ProductionConfig, TestingConfig
|
||||
from .blueprints import torrent_bp, book_bp, music_bp, file_bp, video_bp, image_bp
|
||||
from .blueprints import torrent_bp, book_bp, music_bp, file_bp, video_bp, image_bp, asmr_bp, magnet_bp
|
||||
|
||||
|
||||
def create_app(config_name="development"):
|
||||
@@ -10,13 +10,13 @@ def create_app(config_name="development"):
|
||||
CORS(app)
|
||||
app.config.from_object(DevelopmentConfig)
|
||||
|
||||
match config_name:
|
||||
case 'production':
|
||||
app.config.from_object(ProductionConfig)
|
||||
case 'testing':
|
||||
app.config.from_object(TestingConfig)
|
||||
case _:
|
||||
app.config.from_object(DevelopmentConfig)
|
||||
if config_name == 'production':
|
||||
app.config.from_object(ProductionConfig)
|
||||
elif config_name == 'testing':
|
||||
app.config.from_object(TestingConfig)
|
||||
else:
|
||||
app.config.from_object(DevelopmentConfig)
|
||||
|
||||
|
||||
db.init_app(app)
|
||||
migrate.init_app(app, db)
|
||||
@@ -27,5 +27,7 @@ def create_app(config_name="development"):
|
||||
app.register_blueprint(file_bp.bp, url_prefix='/api/file')
|
||||
app.register_blueprint(video_bp.bp, url_prefix='/api/video')
|
||||
app.register_blueprint(image_bp.bp, url_prefix='/api/image')
|
||||
app.register_blueprint(asmr_bp.bp, url_prefix='/api/asmr')
|
||||
app.register_blueprint(magnet_bp.bp, url_prefix='/api/magnet')
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user