feat(admin): 运营后台(登录/查看/审核编辑/补全)+ 写入API + 审计留痕
CI / Go (api) (pull_request) Failing after 18s
CI / Python (ingestion) (pull_request) Successful in 7s
CI / Migrations (postgres) (pull_request) Failing after 18s

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
oyaegeli98668
2026-06-20 02:53:30 +00:00
parent c272b2c5d7
commit d90a539e6b
36 changed files with 5519 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
-- Admin console support: manual edit provenance + audit log.
-- Manual-entry source used to record field-level provenance for operator edits.
INSERT INTO source (name, homepage, license, trust_weight, notes)
VALUES ('manual', NULL, 'proprietary', 0.90, '运营人工录入/补全')
ON CONFLICT (name) DO NOTHING;
-- Audit trail: every admin write records actor, action, entity and before/after.
CREATE TABLE IF NOT EXISTS audit_log (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
actor TEXT NOT NULL,
action TEXT NOT NULL,
entity TEXT NOT NULL,
entity_id UUID,
fields TEXT[] NOT NULL DEFAULT '{}',
before JSONB,
after JSONB,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_audit_entity ON audit_log (entity, entity_id);
CREATE INDEX IF NOT EXISTS idx_audit_created ON audit_log (created_at DESC);