后端 - config.yaml 新增 task_deeplink 段:完整 URL(无 base)+ test/delete_test 两个独立测试开关 + mock 假数据(目的树 / delete 结果,可随时编辑) - 新增 TaskDeeplinkConfig 模型挂到 AppConfig;新增公开只读接口 GET /api/public/config/task-deeplink 暴露给前端(/api/public 已在鉴权白名单) 前端 - 登录深链 goPath=rwfx 进入「任务工作区」:左侧按 metadata.taskId 过滤的对话列表 (新建对话 / 编辑 / 下一步 / 清除任务记录)+ 右侧问答 - 新建对话(含首次进入)顶部展示目的树闸门:有数据弹覆盖确认→调 delete,success 才开始问答; 恢复历史对话不跑闸门 - 新建 thread 打 metadata.taskId 标签实现「一个任务挂多个对话」(1:N) - 地址/开关/假数据全部走后端配置,拿不到时用内置默认值兜底;test/delete_test=true 走假数据 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
52 lines
2.0 KiB
Python
52 lines
2.0 KiB
Python
"""任务深链(``goPath=rwfx``)的「目的树闸门 + 跳转」配置。
|
|
|
|
前端(登录深链流程)通过公开只读接口 ``GET /api/public/config/task-deeplink``
|
|
读取这一段:所有外部地址都是**完整 URL**(调用时仅追加 ``?taskId=`` / ``?id=``),
|
|
随时改 ``config.yaml`` 即可(Gateway 有 mtime 热重载,无需重新构建前端)。
|
|
|
|
测试开关(线上接口未通时用假数据,互相独立):
|
|
- ``test`` → 目的树查询(``purpose_detail_url``)走 ``mock.purpose_detail`` 假数据。
|
|
- ``delete_test`` → 删除接口(``delete_url``)走 ``mock.delete`` 假数据(该接口尚未开发完时打开)。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class TaskDeeplinkConfig(BaseModel):
|
|
"""rwfx 任务深链的目的树查询 / 删除接口与跳转页地址。"""
|
|
|
|
model_config = ConfigDict(extra="allow")
|
|
|
|
test: bool = Field(
|
|
default=False,
|
|
description="为真时前端目的树查询走 mock.purpose_detail 假数据(不打真实接口)",
|
|
)
|
|
delete_test: bool = Field(
|
|
default=False,
|
|
description="为真时前端删除接口走 mock.delete 假数据(删除接口未开发完时打开)",
|
|
)
|
|
purpose_detail_url: str = Field(
|
|
default="",
|
|
description="目的树查询完整 URL,调用时追加 ?taskId=",
|
|
)
|
|
delete_url: str = Field(
|
|
default="",
|
|
description="删除完整 URL,调用时追加 ?taskId=",
|
|
)
|
|
treemap_edit_url: str = Field(
|
|
default="",
|
|
description="B 系统树形完整编辑页 URL,跳转时追加 ?id=",
|
|
)
|
|
treemap_next_url: str = Field(
|
|
default="",
|
|
description="B 系统树形下一步页 URL,跳转时追加 ?id=",
|
|
)
|
|
mock: dict[str, Any] = Field(
|
|
default_factory=dict,
|
|
description="test/delete_test 为真时返回的假数据:{purpose_detail: {...}, delete: {message, success}}",
|
|
)
|