This commit is contained in:
vastxie
2024-07-07 13:09:08 +08:00
parent 086e5aed3c
commit 4fef3663e4
1131 changed files with 11143 additions and 10769 deletions

View File

@@ -18,12 +18,6 @@ let RedisCacheService = class RedisCacheService {
constructor(redisClient) {
this.redisClient = redisClient;
}
async onModuleInit() {
}
test() {
this.redisClient.set('aaa', 111);
return 1;
}
async get(body) {
const { key } = body;
const res = await this.redisClient.get(key);
@@ -40,6 +34,13 @@ let RedisCacheService = class RedisCacheService {
throw new common_1.HttpException(error, common_1.HttpStatus.BAD_REQUEST);
}
}
async getJwtSecret() {
const secret = await this.redisClient.get('JWT_SECRET');
if (!secret) {
throw new Error('JWT secret not found in Redis');
}
return secret;
}
async ttl(key) {
return await this.redisClient.ttl(key);
}