feat: cleanup support address and inactive address (#671)

This commit is contained in:
Dream Hunter
2025-06-18 17:31:15 +08:00
committed by GitHub
parent c694b07380
commit 9ac9cd46b0
6 changed files with 115 additions and 29 deletions
+2 -4
View File
@@ -17,13 +17,11 @@ export default {
return c.json({ success: true })
},
getCleanup: async (c: Context<HonoCustomType>) => {
const value = await getJsonSetting(c, CONSTANTS.AUTO_CLEANUP_KEY);
const cleanupSetting = new CleanupSettings(value);
const cleanupSetting = await getJsonSetting<CleanupSettings>(c, CONSTANTS.AUTO_CLEANUP_KEY);
return c.json(cleanupSetting)
},
saveCleanup: async (c: Context<HonoCustomType>) => {
const value = await c.req.json();
const cleanupSetting = new CleanupSettings(value);
const cleanupSetting = await c.req.json<CleanupSettings>();
await saveSetting(c, CONSTANTS.AUTO_CLEANUP_KEY, JSON.stringify(cleanupSetting));
return c.json({ success: true })
}