admin
2019-08-26 d28bed1a1275131a5ca37f7da37961e2b518ac07
fanli/src/main/java/com/yeshi/fanli/util/cache/TaoBaoGoodsCacheUtil.java
@@ -42,4 +42,62 @@
         return null;
   }
   /**
    * 是否可以添加到更新队列中
    *
    * @param auctionId
    * @return
    */
   public boolean canAddToUpdateQueue(Long auctionId) {
      String key = "tb-u-q-" + auctionId;
      String value = redisManager.getCommonString(key);
      if (StringUtil.isNullOrEmpty(value))
         return true;
      else
         return false;
   }
   /**
    * 增加添加到队列中的记录
    *
    * @param auctionId
    */
   public void addAddToQueueHistory(Long auctionId) {
      String key = "tb-u-q-" + auctionId;
      redisManager.cacheCommonString(key, "1", 60 * 60 * 2);// 有效期2个小时
   }
   /**
    * 查询商品是否需要更新
    *
    * @param actionId
    * @return
    */
   public boolean needUpdate(Long actionId) {
      String key = "tb-u-" + actionId;
      String value = redisManager.getCommonString(key);
      if (StringUtil.isNullOrEmpty(value))
         return true;
      else
         return false;
   }
   /**
    * 添加更新记录数据
    *
    * @param actionId
    * @return
    */
   public void addUpdateHistory(Long actionId) {
      String key = "tb-u-" + actionId;
      redisManager.cacheCommonString(key, "1", 60 * 60 * 1);// 有效期1个小时
   }
   /**
    * 删除更新记录
    */
   public void removeUpdateHistory() {
      // TODO 凌晨删除缓存记录
   }
}