弱网核销功能

This commit is contained in:
2026-07-12 12:00:55 +08:00
parent de01d36cdb
commit 06b1cb22e0
24 changed files with 1434 additions and 42 deletions
@@ -30,4 +30,16 @@ export class RedisService {
async ttl(key: string): Promise<number> {
return this.redis.ttl(key);
}
async incr(key: string, ttlSeconds?: number): Promise<number> {
const count = await this.redis.incr(key);
if (ttlSeconds && count === 1) {
await this.redis.expire(key, ttlSeconds);
}
return count;
}
async get(key: string): Promise<string | null> {
return this.redis.get(key);
}
}