- 拆分应用工厂、业务服务与路由,保留原有 HTTP/SSE 和存储入口 - 分离页面资源,重排客服工作台并完善响应式导航、草稿和附件交互 - 整理维护脚本、请求示例和贡献指南,移除启动脚本中的密钥配置 - 上传文件改为仅本地保留,补充隔离的后端与前端回归验证 验证:46 项 Python 测试通过,含 14 个已有子测试;12 个 Node 前端场景通过。
18 lines
460 B
Python
18 lines
460 B
Python
"""HTTP adapters for files; business logic lives in services."""
|
|
|
|
from flask import Blueprint, request, send_from_directory
|
|
|
|
from .. import file_service
|
|
from ..config import get_setting
|
|
|
|
bp = Blueprint('files', __name__)
|
|
|
|
@bp.route('/api/upload', methods=['POST'])
|
|
def upload_file():
|
|
return file_service.upload_file(request.files)
|
|
|
|
|
|
@bp.route('/uploads/<path:name>')
|
|
def uploaded_file(name):
|
|
return send_from_directory(get_setting('UPLOAD_DIR'), name)
|