Files
easyai-ai-gateway/apps/api/migrations/0075_compatibility_protocol_metadata.sql
T
easyai e07a997aa9 feat(api): 统一官方兼容接口响应协议
兼容接口现在以入口协议作为最终响应协议,同协议保留官方 Wire 响应,跨协议统一转换成功、任务状态与错误结构。

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

验证:go vet ./...;go test ./...;govulncheck ./...;pnpm lint;pnpm test;pnpm build;pnpm audit --audit-level high;pnpm openapi;全部 CI 脚本。
2026-07-22 15:34:59 +08:00

19 lines
936 B
SQL

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 <> '';