// Set 操作 import { getClient } from './connection' export async function setMembers(id: string, key: string): Promise { const client = getClient(id) if (!client) throw new Error(`Client ${id} not found`) return client.smembers(key) } export async function setSize(id: string, key: string): Promise { const client = getClient(id) if (!client) throw new Error(`Client ${id} not found`) return client.scard(key) } export async function setAdd(id: string, key: string, ...members: string[]): Promise { const client = getClient(id) if (!client) throw new Error(`Client ${id} not found`) return client.sadd(key, ...members) } export async function setRemove(id: string, key: string, ...members: string[]): Promise { const client = getClient(id) if (!client) throw new Error(`Client ${id} not found`) return client.srem(key, ...members) }