const CacheBase=require("../cache.base");
const system=require("../../system");
var settings=require("../../../config/settings");
class companyportraitCache extends CacheBase{
   constructor(){
     super();
     this.prefix="companyportrait";
     this.restClient=system.getObject("util.restClient");
   }
   async add(){
     var key = this.prefix;
     var value = await this.redisClient.get(key);
     if(value){
       value = Number(value)+1;
     }else{
       value=1;
     }
     await this.redisClient.set(key,value);
   }
   async get(){
     var key = this.prefix;
     var value = await this.redisClient.get(key);
     if(!value){
       return 0;
     }
     return value;
   }
}
module.exports=companyportraitCache;
 // var task = new companyportraitCache();
// task.add().then(d=>{
//   console.log("add++++++++++++++++++");
// });
// task.get().then(d=>{
//   console.log("get++++++++++++++++++");
//   console.log(d);
// })
