feat: first commit
This commit is contained in:
64
server/type/global.ts
Normal file
64
server/type/global.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
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>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user