refactor(api): 重构API蓝图结构按功能模块拆分
- 将原有的单一api蓝图拆分为多个独立蓝图(torrent、book、music、file、video、image) - 每个蓝图负责对应的功能模块,实现更好的代码组织和维护性 - 更新应用初始化文件中的蓝图注册方式,使用新的模块化结构 - 修改前端API调用路径,将/files/rename调整为/file/rename - 在torrent服务中新增按名称查询功能和相关处理逻辑
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from typing import List
|
||||
from flask import Blueprint, jsonify
|
||||
|
||||
from app.services import FileService
|
||||
|
||||
bp = Blueprint("file", __name__)
|
||||
|
||||
|
||||
@bp.route('/rename')
|
||||
def files_rename():
|
||||
paths: List[str] = [
|
||||
"C:\\迅雷下载\\0_done",
|
||||
"C:\\Users\\Localhost\\Desktop\\BT",
|
||||
]
|
||||
|
||||
file_object = FileService(paths)
|
||||
return jsonify({"code": 200, "message": file_object.rename()})
|
||||
Reference in New Issue
Block a user