65 lines
1.2 KiB
TypeScript
65 lines
1.2 KiB
TypeScript
import { RedisGroup } from '@/common/enum';
|
|
|
|
declare global {
|
|
interface QueryListResult {
|
|
page: number;
|
|
pageSize: number;
|
|
count: number;
|
|
list: any[];
|
|
}
|
|
|
|
interface IRedisGetOptions {
|
|
group?: RedisGroup;
|
|
key: string;
|
|
}
|
|
|
|
interface IRedisSetOptions {
|
|
group?: RedisGroup;
|
|
key: string;
|
|
value: unknown;
|
|
ttl?: number;
|
|
}
|
|
|
|
interface IRedisDelOptions {
|
|
group?: RedisGroup;
|
|
key: string;
|
|
}
|
|
|
|
interface IRedisMgetOptions {
|
|
group?: RedisGroup;
|
|
keys: string[];
|
|
}
|
|
|
|
interface IRedisKeysOptions {
|
|
group?: RedisGroup;
|
|
pattern: string;
|
|
}
|
|
|
|
interface IRedisMsetOptions {
|
|
group?: RedisGroup;
|
|
data: { key: string; value: string }[];
|
|
ttl?: number;
|
|
}
|
|
|
|
interface IRedisMdelOptions {
|
|
group?: RedisGroup;
|
|
keys: string[];
|
|
}
|
|
|
|
interface IRedisService {
|
|
get<T>(args: IRedisGetOptions): Promise<T>;
|
|
|
|
set(args: IRedisSetOptions): Promise<void>;
|
|
|
|
del(args: IRedisDelOptions): Promise<void>;
|
|
|
|
mget<T>(args: IRedisMgetOptions): Promise<T>;
|
|
|
|
keys(args: IRedisKeysOptions): Promise<string[]>;
|
|
|
|
mset(args: IRedisMsetOptions): Promise<void>;
|
|
|
|
mdel(args: IRedisMdelOptions): Promise<void>;
|
|
}
|
|
}
|