feat(api): 统一官方兼容接口响应协议
ci / verify (pull_request) Failing after 15s

兼容接口现在以入口协议作为最终响应协议,同协议保留官方 Wire 响应,跨协议统一转换成功、任务状态与错误结构。

同时修正异步提交状态边界,持久化兼容公开任务标识和官方提交响应,并新增迁移、流式响应及协议契约测试。

验证:go vet ./...;go test ./...;govulncheck ./...;pnpm lint;pnpm test;pnpm build;pnpm audit --audit-level high;pnpm openapi;全部 CI 脚本。
This commit is contained in:
2026-07-22 15:11:50 +08:00
parent cbebfd7baa
commit a778216264
32 changed files with 2436 additions and 591 deletions
@@ -0,0 +1,18 @@
ALTER TABLE gateway_tasks
ADD COLUMN IF NOT EXISTS compatibility_protocol text,
ADD COLUMN IF NOT EXISTS compatibility_public_id text,
ADD COLUMN IF NOT EXISTS compatibility_source_protocol text,
ADD COLUMN IF NOT EXISTS compatibility_submit_http_status integer,
ADD COLUMN IF NOT EXISTS compatibility_submit_headers jsonb NOT NULL DEFAULT '{}'::jsonb,
ADD COLUMN IF NOT EXISTS compatibility_submit_body jsonb NOT NULL DEFAULT '{}'::jsonb;
CREATE UNIQUE INDEX IF NOT EXISTS gateway_tasks_compatibility_public_id_unique
ON gateway_tasks (compatibility_protocol, compatibility_public_id)
WHERE compatibility_protocol IS NOT NULL
AND compatibility_protocol <> ''
AND compatibility_public_id IS NOT NULL
AND compatibility_public_id <> '';
CREATE INDEX IF NOT EXISTS gateway_tasks_remote_task_compatibility_lookup
ON gateway_tasks (remote_task_id)
WHERE remote_task_id IS NOT NULL AND remote_task_id <> '';