const CacheBase=require("../cache.base");
const system=require("../../system");
//缓存首次登录的赠送的宝币数量
class UIConfigCache extends CacheBase{
   constructor(){
     super();
     this.prefix="g_uiconfig_";
   }
   async cacheUiConfig(appid){
       const key=this.prefix+appid;
       var configValue=await this.redisClient.get(key);
       if(!configValue || configValue=="undefined" || true){
         console.log("uiconfig no cache....");
         configValue =system.getUiConfig2(appid);
         await this.redisClient.set(key,JSON.stringify(configValue));
         return configValue;
       }else {
         console.log("uiconfig already cache....");
       }
       return JSON.parse(configValue);
   }
}
module.exports=UIConfigCache;
