Skip to content

Codex/service api restore config extras#8

Open
LING71671 wants to merge 9 commits into
mainfrom
codex/service-api-restore-config-extras
Open

Codex/service api restore config extras#8
LING71671 wants to merge 9 commits into
mainfrom
codex/service-api-restore-config-extras

Conversation

@LING71671

Copy link
Copy Markdown
Collaborator

No description provided.

@hungryM0

Copy link
Copy Markdown
Collaborator

SurveyCore SDK 不应包含 SurveyController 原有业务逻辑(如 user_iddevice_id 等字段),也不再接入 https://api-wjx.hunrgym0.top

计划开源分发后给予二开自写鉴权业务逻辑

@LING71671

Copy link
Copy Markdown
Collaborator Author

SurveyCore SDK 不应包含 SurveyController 原有业务逻辑(如 user_iddevice_id 等字段),也不再接入 https://api-wjx.hunrgym0.top

计划开源分发后给予二开自写鉴权业务逻辑

👌

@LING71671 LING71671 force-pushed the codex/service-api-restore-config-extras branch from 0bdd10a to bd17d28 Compare June 1, 2026 00:50
@hungryM0 hungryM0 self-assigned this Jun 1, 2026

@hungryM0 hungryM0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

等今晚吧,我再 review 一下(
这风格太Codex了

Comment thread README.md
[SurveyController](https://github.com/SurveyController/SurveyController) 的核心 HTTP 提交 API 服务。

负责解析问卷、创建提交任务、查询任务、停止任务、读取任务日志和解析二维码
负责解析问卷、创建提交任务、查询任务、停止任务、读取任务日志、导入导出配置、导出报告和解析二维码

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 或许 导出报告 应该是问卷平台的职责,而非 SurveyCore 要做的事?能够读取任务日志已经足够了
  • 导出配置 在客户端做会更合适一些,服务端 SDK 进做接收配置、执行提交、返回状态的流程

Comment thread README.md
| `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` 导出日志表。 |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `GET` | `/api/tasks/{id}/report` | 导出指定任务报告。默认 JSON,`?format=csv` 导出日志表。 |

可以不需要这个接口

Comment thread README.md
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 校验,避免调用方把错误参数静默传入。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可不在 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 thread README.md
Comment on lines +161 to +166
## 能力边界

SurveyCore 是本地 HTTP/API 化的核心执行内核。Python 项目继续负责桌面 GUI、安装更新和用户交互;Go 项目负责解析、配置、任务执行、状态、日志和可被桌面端调用的稳定 API。

SurveyCore 不包含 PySide GUI,也不引入 Playwright、Selenium 或浏览器兼容提交层。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 能力边界
SurveyCore 是本地 HTTP/API 化的核心执行内核。Python 项目继续负责桌面 GUI、安装更新和用户交互;Go 项目负责解析、配置、任务执行、状态、日志和可被桌面端调用的稳定 API。
SurveyCore 不包含 PySide GUI,也不引入 Playwright、Selenium 或浏览器兼容提交层。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants