修复了一点bug,然后增加了图层拆分更多的功能

This commit is contained in:
andy committed 2026-09-02 16:06:45 +08:00
1 parent 1305a9cdd8
commit ce8372e878
31 files changed
+2567 -391

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import { readFile } from "node:fs/promises";
import { describe, expect, it } from "vitest";
describe("Seedream layer composition persistence contract", () => {
it("ships a versioned PostgreSQL document table that follows generation-job deletion", async () => {
const migration = await readFile(new URL("../database/migrations/0005_seedream_layer_compositions.sql", import.meta.url), "utf8");
expect(migration).toContain("create table if not exists public.seedream_layer_compositions");
expect(migration).toContain("references public.generation_jobs(id) on delete cascade");
expect(migration).toContain("layers jsonb not null");
expect(migration).toContain("version bigint not null");
expect(migration).toContain("jsonb_typeof(layers) = 'array'");
});
it("exposes owner-scoped GET/PUT routes and provisions application-role privileges", async () => {
const [surface, privileges, handler] = await Promise.all([
readFile(new URL("../contracts/http/route-surface.v1.json", import.meta.url), "utf8"),
readFile(new URL("../scripts/migrate-postgres.mjs", import.meta.url), "utf8"),
readFile(new URL("../backend/internal/httpapi/layer_compositions.go", import.meta.url), "utf8")
]);
expect(surface).toContain('"GET", "path": "/api/layer-compositions/{id}"');
expect(surface).toContain('"PUT", "path": "/api/layer-compositions/{id}"');
expect(privileges).toContain('["seedream_layer_compositions", "SELECT, INSERT, UPDATE, DELETE"]');
expect(handler).toContain("handler.platform.Authorize");
expect(handler).toContain("jobs.Scope{OwnerID: session.User.ID}");
});
});