Commit 80976a1e by 田超

Merge branch 'fixbug/fixUserCount' into 'master'

bug: [none] fixUserCount

See merge request rays/pcloud-book!1033
parents 96cd461c 715f4aa9
...@@ -2,6 +2,7 @@ package com.pcloud.book.rightsSetting.biz.impl; ...@@ -2,6 +2,7 @@ package com.pcloud.book.rightsSetting.biz.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.math.MathUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -118,6 +119,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -118,6 +119,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.elasticsearch.common.math.MathUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -1830,10 +1832,11 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1830,10 +1832,11 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
@Override @Override
public Integer getUserCount() { public Integer getUserCount() {
Integer userCount = 102336; Integer userCount = null;
String key = "BOOK:APPLET:RIGHTS_SETTING_USER_COUNT"; String key = "BOOK:APPLET:RIGHTS_SETTING_USER_COUNT";
String value = JedisClusterUtils.get(key); String value = JedisClusterUtils.get(key);
if (StringUtil.isEmpty(value)) { if (StringUtil.isEmpty(value)) {
userCount = RandomUtil.randomInt(3000, 5000);
JedisClusterUtils.set(key, userCount.toString(), 24 * 3600); JedisClusterUtils.set(key, userCount.toString(), 24 * 3600);
} else { } else {
userCount = Integer.valueOf(value); userCount = Integer.valueOf(value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment