UNPKG

nest-api-cache

Version:

使用redis实现nestjs接口层面的缓存

17 lines (16 loc) 630 B
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common'; import { RedisCacheService } from './../../services/redis-cache/redis-cache.service'; /** * @Author: 水痕 * @Date: 2021-03-08 13:04:56 * @LastEditors: 水痕 * @Description: 定义redis缓存接口的中间件。提高接口访问速度 * @param {*} * @return {*} */ export declare class NestApiCacheInterceptor implements NestInterceptor { private readonly redisCacheService; constructor(redisCacheService: RedisCacheService); intercept(context: ExecutionContext, next: CallHandler): Promise<any>; private redisCacheKey; }