feat: 增强功能批量入库 - 双色彩引擎/抖动/杂色清理/品牌色板/PDF导出/编辑工具/分享/i18n 等验收代码
This commit is contained in:
1 parent
02762400fb
commit
f846fabfc6
77 files changed
+11372
-226
No files matched your search
@@ -75,4 +75,35 @@ CREATE TABLE IF NOT EXISTS device_bindings (
|
||||
|
||||
-- 索引:按 code 反查绑定设备
|
||||
CREATE INDEX IF NOT EXISTS idx_device_bindings_code ON device_bindings(code);
|
||||
|
||||
-- 安全事件表(防刷:IP 追踪 + 滥用检测)
|
||||
-- ip 可空:兑换成功/失败等带来源 IP 的事件写入,禁用事件(code_disabled)无来源
|
||||
CREATE TABLE IF NOT EXISTS security_events (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
ip TEXT,
|
||||
code TEXT NOT NULL,
|
||||
action TEXT NOT NULL,
|
||||
event_type TEXT NOT NULL CHECK(event_type IN ('redeem_ok', 'redeem_fail', 'code_disabled')),
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
|
||||
-- 索引:按兑换码查询安全事件(防刷检测主路径)
|
||||
CREATE INDEX IF NOT EXISTS idx_security_events_code ON security_events(code, event_type, created_at);
|
||||
|
||||
-- 索引:按 IP 查询安全事件(同一 IP 刷码检测)
|
||||
CREATE INDEX IF NOT EXISTS idx_security_events_ip ON security_events(ip, event_type, created_at);
|
||||
|
||||
-- 下载授权表(一次性下载凭证)
|
||||
-- AI 生成成功后写入一行:consume 时必须携带未使用的 grant 且归属同一兑换码,
|
||||
-- 核销时置 used=1,防止绕过生成流程直接消耗次数下载。
|
||||
CREATE TABLE IF NOT EXISTS download_grants (
|
||||
grant TEXT PRIMARY KEY,
|
||||
code TEXT NOT NULL REFERENCES codes(code),
|
||||
order_no TEXT,
|
||||
used INTEGER NOT NULL DEFAULT 0 CHECK(used IN (0, 1)),
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
|
||||
-- 索引:按兑换码查询下载授权
|
||||
CREATE INDEX IF NOT EXISTS idx_download_grants_code ON download_grants(code);
|
||||
`;
|
||||
Reference in new issue
Block a user