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