Codex/service api restore config extras#8
Open
LING71671 wants to merge 9 commits into
Open
Conversation
Collaborator
|
SurveyCore SDK 不应包含 SurveyController 原有业务逻辑(如 计划开源分发后给予二开自写鉴权业务逻辑 |
Collaborator
Author
👌 |
0bdd10a to
bd17d28
Compare
hungryM0
requested changes
Jun 1, 2026
hungryM0
left a comment
Collaborator
There was a problem hiding this comment.
等今晚吧,我再 review 一下(
这风格太Codex了
| [SurveyController](https://github.com/SurveyController/SurveyController) 的核心 HTTP 提交 API 服务。 | ||
|
|
||
| 负责解析问卷、创建提交任务、查询任务、停止任务、读取任务日志和解析二维码。 | ||
| 负责解析问卷、创建提交任务、查询任务、停止任务、读取任务日志、导入导出配置、导出报告和解析二维码。 |
Collaborator
There was a problem hiding this comment.
- 或许
导出报告应该是问卷平台的职责,而非 SurveyCore 要做的事?能够读取任务日志已经足够了 导出配置在客户端做会更合适一些,服务端 SDK 进做接收配置、执行提交、返回状态的流程
| | `GET` | `/api/tasks/{id}` | 查询单个任务详情。 | | ||
| | `GET` | `/api/tasks/{id}/logs` | 分页读取指定任务日志。支持 `after` 游标和 `limit` 条数参数。 | | ||
| | `GET` | `/api/tasks/{id}/config` | 导出指定任务的运行配置 JSON。 | | ||
| | `GET` | `/api/tasks/{id}/report` | 导出指定任务报告。默认 JSON,`?format=csv` 导出日志表。 | |
Collaborator
There was a problem hiding this comment.
Suggested change
| | `GET` | `/api/tasks/{id}/report` | 导出指定任务报告。默认 JSON,`?format=csv` 导出日志表。 | |
可以不需要这个接口
Comment on lines
+94
to
+103
| ## 配置兼容 | ||
|
|
||
| `POST /api/tasks`、`POST /api/configs/import` 和 `POST /api/configs/export` 按兼容模式读取运行配置,既支持直接传运行配置对象,也支持 `{ "config": ... }` 包络。 | ||
|
|
||
| Go 会兼容 Python codec 的宽松输入形态:数字字段可接受字符串数字,布尔字段可接受 `true/false`、`1/0`、`yes/no`,`answer_duration` 可接受旧版单值或单元素数组并转换为上下浮动范围,`answer_datetime_window` 会按 `YYYY-MM-DD HH:MM:SS` 归一化。随机 UA 支持 Python 当前 preset 键 `wechat_android`、`mobile_android`、`pc_web`,同时兼容旧版 Go 键 `wechat`、`mobile`、`pc`。 | ||
|
|
||
| SurveyCore 不包含 SurveyController 原有的账号、额度、设备身份或私有服务接入逻辑。来自旧配置的此类字段会被视为遗留字段并忽略;二次开发者可在 SurveyCore 外层自行实现鉴权和业务服务。 | ||
|
|
||
| Go 生成或导出的配置默认带 `config_schema_version=6`。其他请求包络(例如 `/api/surveys/parse`、`/api/configs`)保持严格 JSON 校验,避免调用方把错误参数静默传入。 | ||
|
|
Collaborator
There was a problem hiding this comment.
可不在 README 说明。
默认不留旧兼容,避免与 Python 侧过于精细化的对齐
Suggested change
| ## 配置兼容 | |
| `POST /api/tasks`、`POST /api/configs/import` 和 `POST /api/configs/export` 按兼容模式读取运行配置,既支持直接传运行配置对象,也支持 `{ "config": ... }` 包络。 | |
| Go 会兼容 Python codec 的宽松输入形态:数字字段可接受字符串数字,布尔字段可接受 `true/false`、`1/0`、`yes/no`,`answer_duration` 可接受旧版单值或单元素数组并转换为上下浮动范围,`answer_datetime_window` 会按 `YYYY-MM-DD HH:MM:SS` 归一化。随机 UA 支持 Python 当前 preset 键 `wechat_android`、`mobile_android`、`pc_web`,同时兼容旧版 Go 键 `wechat`、`mobile`、`pc`。 | |
| SurveyCore 不包含 SurveyController 原有的账号、额度、设备身份或私有服务接入逻辑。来自旧配置的此类字段会被视为遗留字段并忽略;二次开发者可在 SurveyCore 外层自行实现鉴权和业务服务。 | |
| Go 生成或导出的配置默认带 `config_schema_version=6`。其他请求包络(例如 `/api/surveys/parse`、`/api/configs`)保持严格 JSON 校验,避免调用方把错误参数静默传入。 |
Comment on lines
+161
to
+166
| ## 能力边界 | ||
|
|
||
| SurveyCore 是本地 HTTP/API 化的核心执行内核。Python 项目继续负责桌面 GUI、安装更新和用户交互;Go 项目负责解析、配置、任务执行、状态、日志和可被桌面端调用的稳定 API。 | ||
|
|
||
| SurveyCore 不包含 PySide GUI,也不引入 Playwright、Selenium 或浏览器兼容提交层。 | ||
|
|
Collaborator
There was a problem hiding this comment.
Suggested change
| ## 能力边界 | |
| SurveyCore 是本地 HTTP/API 化的核心执行内核。Python 项目继续负责桌面 GUI、安装更新和用户交互;Go 项目负责解析、配置、任务执行、状态、日志和可被桌面端调用的稳定 API。 | |
| SurveyCore 不包含 PySide GUI,也不引入 Playwright、Selenium 或浏览器兼容提交层。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.