import { getRedisInstance, Redis } from "../redis"; class RedisBaseKey { protected redis:InstanceType=getRedisInstance() protected type:T protected name:string constructor(name:string,type:T){ this.name=name, this.type=type } } export class RedisStringKey extends RedisBaseKey { constructor(name:string,type:T){ super(name,type) } async get():Promise{ let ret=await this.redis.get(this.name,this.type) return ret } async set(value:T,ttl?:number){ await this.redis.set(this.name,value,ttl); } }