feat: 添加 cloudflare_pages、mysql_d1_backup_scheduler,更新 start_system、ensemble_models 及配置文件
This commit is contained in:
1 parent
6184c34a3a
commit
62110554d1
20 files changed
+1438
-19
No files matched your search
@@ -0,0 +1,23 @@
|
||||
function json(data, status = 200) {
|
||||
return new Response(JSON.stringify(data), {
|
||||
status,
|
||||
headers: { "content-type": "application/json; charset=UTF-8" },
|
||||
});
|
||||
}
|
||||
|
||||
export async function onRequestGet(context) {
|
||||
const db = context.env.DB;
|
||||
if (!db) {
|
||||
return json({ success: false, error: "缺少 D1 绑定 DB" }, 500);
|
||||
}
|
||||
|
||||
try {
|
||||
const row = await db
|
||||
.prepare("SELECT * FROM backup_trades ORDER BY timestamp DESC LIMIT 1")
|
||||
.first();
|
||||
|
||||
return json({ success: true, data: row || null });
|
||||
} catch (error) {
|
||||
return json({ success: false, error: String(error) }, 500);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user