bdcf4fe299
- 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/
16 lines
506 B
TypeScript
16 lines
506 B
TypeScript
// 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)
|
|
}
|