const CacheBase = require("../cache.base");
const system = require("../../system");
const settings = require("../../../config/settings");
class MerchantPushUrlCache extends CacheBase {
  constructor() {
    super();
    this.merchantpushDao = system.getObject("db.merchant.merchantpushDao");
  }
  desc() {
    return "应用中缓存访问token";
  }
  prefix() {
    return settings.cacheprefix + "_merchantPushUrl:";
  }
  async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
    var item = await this.merchantpushDao.getItemByMerchantId(inputkey);
    if (!item) {
      return null;
    }
    return JSON.stringify(item);
  }
}
module.exports = MerchantPushUrlCache;
