const CacheBase=require("../cache.base");
const system=require("../../system");
class ChannelManageAllotCache extends CacheBase{
   constructor(){
     super();
     this.prefix="channel_manage_allot:";
   }
   async delAllCache(){
     const key=this.prefix+"_all";
     await this.redisClient.delete(key);
   }
   async setAllAllotBusinessList(obj){
       const key=this.prefix+"_all";
       await this.redisClient.set(key,obj);
       return obj;
   }
   async getAllAllotBusinessListByCache(){
     const key=this.prefix+"_all";
     var cachedVal= await this.redisClient.get(key);
     if(cachedVal){
       return cachedVal;
     }else{
         return null;
       }
   }
   async delCache(keyCode){
     const key=this.prefix+keyCode;
     await this.redisClient.delete(key);
   }
   async setAllotBusinessList(keyCode,obj){
       const key=this.prefix+keyCode;
       await this.redisClient.set(key,obj);
       return obj;
   }
   async getAllotBusinessListByCache(keyCode){
     if(keyCode==null || keyCode==""){
       return null;
     }
     const key=this.prefix+keyCode;
     var cachedVal= await this.redisClient.get(key);
     if(cachedVal){
       return cachedVal;
     }else{
         return null;
       }
   }
}
module.exports=ChannelManageAllotCache;
