refactor: restructure project layout
- Move main process to electron/main/ - Move preload to electron/preload/ - Add shared types in electron/shared/ - Split redis-service into modular redis/ directory - Flatten renderer to src/ (remove src/renderer/ nesting) - Update electron.vite.config.ts paths - Update tsconfig paths - Output to electron-dist/
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// src/main/redis/string.ts
|
||||
// String 操作
|
||||
import { getClient } from './connection'
|
||||
|
||||
export async function getStringValue(id: string, key: string): Promise<string | null> {
|
||||
const client = getClient(id)
|
||||
if (!client) throw new Error(`Client ${id} not found`)
|
||||
return client.get(key)
|
||||
}
|
||||
|
||||
export async function setStringValue(id: string, key: string, value: string): Promise<void> {
|
||||
const client = getClient(id)
|
||||
if (!client) throw new Error(`Client ${id} not found`)
|
||||
await client.set(key, value)
|
||||
}
|
||||
Reference in New Issue
Block a user