From 0d21cd93cbb47fcf2ba02a872ed6c6485a35f799 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期二, 16 四月 2019 16:31:09 +0800 Subject: [PATCH] 分类图片版本区分 --- fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java | 37 ++++++++++++++++++++++++------------- 1 files changed, 24 insertions(+), 13 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java b/fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java index f7f2401..8899c7a 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java @@ -119,18 +119,6 @@ } /** - * 灏嗕俊鎭案涔呬繚瀛樺埌Redis - * - * @param goods - */ - public void saveTaoBaoGoodsBriefForever(TaoBaoGoodsBrief goods) { - String key = "taobao-goods-" + goods.getAuctionId(); - if (Constant.IS_OUTNET) { - cacheCommonString(key, JsonUtil.getSimpleGson().toJson(goods)); - } - } - - /** * 涓存椂瀛樺偍娣樺疂鐨勫晢鍝佽鎯� * * @param goods @@ -296,19 +284,38 @@ String value = ""; if (Constant.IS_OUTNET) value = getCommonString(key); + if (StringUtil.isNullOrEmpty(value)) { TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); goods.setShopTitle(shopTitle); goods.setSellerId(sellerId); goods.setAuctionId(auctionId); TaoBaoShopInfo info = taoBaoShopService.getTaoBaoShopInfo(goods); + + if(info != null) { + String shopUrl = info.getShopUrl(); + if(shopUrl != null && shopUrl.contains("tmall://page.tm/shop")) { + shopUrl = "http://store.taobao.com/shop/view_shop.htm?user_number_id=" + sellerId; + info.setShopUrl(shopUrl); + } + } + if (Constant.IS_OUTNET && info != null) { value = new Gson().toJson(info); cacheCommonString(key, value, 60 * 60 * 2); } + return info; } else { - return new Gson().fromJson(value, TaoBaoShopInfo.class); + TaoBaoShopInfo info = new Gson().fromJson(value, TaoBaoShopInfo.class); + + String shopUrl = info.getShopUrl(); + if(shopUrl != null && shopUrl.contains("tmall://page.tm/shop")) { + shopUrl = "http://store.taobao.com/shop/view_shop.htm?user_number_id=" + sellerId; + info.setShopUrl(shopUrl); + } + + return info; } } @@ -329,6 +336,10 @@ else return true; } + + + + /** * 璁剧疆鐭俊60s鍊掕鏃� -- Gitblit v1.8.0