From 7f703a54a555334430e900941072f31e1c3b0210 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 06 五月 2019 12:16:59 +0800
Subject: [PATCH] 保存/修改分类将中文逗号改为英文
---
fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java | 41 +++++++++++++++++++++++++++++++++++++++--
1 files changed, 39 insertions(+), 2 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 50f7b75..1524fe8 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java
@@ -102,6 +102,24 @@
}
}
+ public void increase(String key) {
+ Jedis jedis = jedisPool.getResource();
+ try {
+ jedis.incr(key);
+ } finally {
+ jedisPool.returnResource(jedis);
+ }
+ }
+
+ public void expire(String key,int seconds) {
+ Jedis jedis = jedisPool.getResource();
+ try {
+ jedis.expire(key, seconds);
+ } finally {
+ jedisPool.returnResource(jedis);
+ }
+ }
+
public void cacheCommonString(String key, String value, int seconds) {
setString(key, value, seconds);
}
@@ -235,7 +253,7 @@
long count = jedis.incr(key);
if (count == 1)
jedis.expire(key, 5);
- if (count >= 100)
+ if (count >= 10)
return true;
else
return false;
@@ -284,19 +302,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;
}
}
--
Gitblit v1.8.0