(key: string, value: string)
| 85 | } |
| 86 | |
| 87 | static set(key: string, value: string): void { |
| 88 | this.init(); |
| 89 | |
| 90 | try { |
| 91 | const stmt = this.db.prepare(` |
| 92 | INSERT OR REPLACE INTO config (key, value, updated_at) |
| 93 | VALUES (?, ?, CURRENT_TIMESTAMP) |
| 94 | `); |
| 95 | stmt.run(key, value); |
| 96 | } catch (error) { |
| 97 | console.error("保存配置失败:", error); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | // 获取所有配置 |
| 102 | static getAll(): { [key: string]: string } { |
no test coverage detected