diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java
index 74620ed..d892b14 100644
--- a/src/main/java/com/nis/util/Constants.java
+++ b/src/main/java/com/nis/util/Constants.java
@@ -211,4 +211,6 @@ public final class Constants {
*是否使用Minio
*/
public static final Boolean IS_USE_MINIO = Configurations.getBooleanProperty("isUseMinio", true);
+ public static final int MAXTHREADNUM = Configurations.getIntProperty("maxThreadNum", 10);
+ public static final int EVERTHREADNUM = Configurations.getIntProperty("everThreadNum", 10000);
}
diff --git a/src/main/java/com/nis/util/JedisUtils.java b/src/main/java/com/nis/util/JedisUtils.java
index 36bb6be..20d8456 100644
--- a/src/main/java/com/nis/util/JedisUtils.java
+++ b/src/main/java/com/nis/util/JedisUtils.java
@@ -17,10 +17,11 @@ import com.nis.web.service.SpringContextHolder;
public class JedisUtils {
private static Logger logger = LoggerFactory.getLogger(JedisUtils.class);
private static JedisPool jedisPool = SpringContextHolder.getBean(JedisPool.class);
-
/**
* 获取缓存
- * @param key 键
+ *
+ * @param key
+ * 键
* @return 值
*/
public static String get(String key, int redisDb) {
@@ -34,7 +35,8 @@ public class JedisUtils {
logger.debug("get {} = {}", key, value);
}
} catch (Exception e) {
- throw new ServiceRuntimeException("从" + redisDb + "号redisDB中获取" + key + "对应的值失败", RestBusinessCode.KeyNotExistsInRedis.getValue());
+ throw new ServiceRuntimeException("从" + redisDb + "号redisDB中获取" + key + "对应的值失败",
+ RestBusinessCode.KeyNotExistsInRedis.getValue());
} finally {
returnResource(jedis);
}
@@ -43,7 +45,9 @@ public class JedisUtils {
/**
* 获取缓存
- * @param key 键
+ *
+ * @param key
+ * 键
* @return 值
*/
public static Object getObject(String key, int redisDb) {
@@ -56,7 +60,8 @@ public class JedisUtils {
logger.debug("getObject {} = {}", key, value);
}
} catch (Exception e) {
- throw new ServiceRuntimeException("从" + redisDb + "号redisDB中获取" + key + "对应的值失败", RestBusinessCode.KeyNotExistsInRedis.getValue());
+ throw new ServiceRuntimeException("从" + redisDb + "号redisDB中获取" + key + "对应的值失败",
+ RestBusinessCode.KeyNotExistsInRedis.getValue());
} finally {
returnResource(jedis);
}
@@ -64,14 +69,15 @@ public class JedisUtils {
}
/**
- * 可以作为获取唯一id的方法
- * 将key对应的value加上指定的值,只有value可以转为数字时该方法才可用
- *
- * @param String
- * key
- * @param long number 要减去的值
- * @return long 相加后的值
- * */
+ * 可以作为获取唯一id的方法
+ * 将key对应的value加上指定的值,只有value可以转为数字时该方法才可用
+ *
+ * @param String
+ * key
+ * @param long
+ * number 要减去的值
+ * @return long 相加后的值
+ */
public static long incrBy(String key, long number, int redisDb) {
Jedis jedis = getResource(redisDb);
long len = jedis.incrBy(key, number);
@@ -81,9 +87,13 @@ public class JedisUtils {
/**
* 设置缓存
- * @param key 键
- * @param value 值
- * @param cacheSeconds 超时时间,0为不超时
+ *
+ * @param key
+ * 键
+ * @param value
+ * 值
+ * @param cacheSeconds
+ * 超时时间,0为不超时
* @return
*/
public static String set(String key, String value, int cacheSeconds, int redisDb) {
@@ -97,7 +107,8 @@ public class JedisUtils {
}
logger.debug("set {} = {}", key, value);
} catch (Exception e) {
- throw new ServiceRuntimeException("向" + redisDb + "号redisDB中设置zset失败,key=" + key + ",value=" + value, RestBusinessCode.ZsetFailed.getValue());
+ throw new ServiceRuntimeException("向" + redisDb + "号redisDB中设置zset失败,key=" + key + ",value=" + value,
+ RestBusinessCode.ZsetFailed.getValue());
} finally {
returnResource(jedis);
}
@@ -106,7 +117,9 @@ public class JedisUtils {
/**
* 获取List缓存
- * @param key 键
+ *
+ * @param key
+ * 键
* @return 值
*/
public static List getList(String key, int redisDb) {
@@ -119,7 +132,8 @@ public class JedisUtils {
logger.debug("getList {} = {}", key, value);
}
} catch (Exception e) {
- throw new ServiceRuntimeException("从" + redisDb + "号redisDB中获取" + key + "对应的值失败", RestBusinessCode.KeyNotExistsInRedis.getValue());
+ throw new ServiceRuntimeException("从" + redisDb + "号redisDB中获取" + key + "对应的值失败",
+ RestBusinessCode.KeyNotExistsInRedis.getValue());
} finally {
returnResource(jedis);
}
@@ -128,7 +142,9 @@ public class JedisUtils {
/**
* 获取List缓存
- * @param key 键
+ *
+ * @param key
+ * 键
* @return 值
*/
public static List