const CacheBase=require("../cache.base");
const system=require("../../system");
//缓存首次登录的赠送的宝币数量
class CacheLocker extends CacheBase{
   constructor(){
     super();
     this.prefix="locker_";
   }
    desc(){

    }
    prefix(){
    
    }
   async init(tradekey){
       const key=this.prefix+tradekey;
       return this.redisClient.rpushWithEx(key,"1",1800);
   }
   async enter(tradekey){
       const key=this.prefix+tradekey;
       return this.redisClient.rpop(key);
   }
   async release(tradekey){
       const key=this.prefix+tradekey;
       return this.redisClient.rpushWithEx(key,"1",1800);
   }
}
module.exports=CacheLocker;
