增加预注册处理

grimm 2025-05-04 16:28:56 +08:00
parent 74b49b1fc5
commit aeb0aba0de
2 changed files with 14 additions and 1 deletions

View File

@ -66,7 +66,7 @@ public class RedisUserKey {
public static final String LOGIC_SERVER_INFO = "LOGIC_SERVER_INFO";
public static final String PLAYER_INFO_CACHE = "PLAYER_INFO_CACHE";
public static final String F5_PRE_REWARD = "F5_PRE_REWARD";//F5预热奖励
}

View File

@ -1,6 +1,7 @@
package com.jmfy.util;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.jmfy.redisProperties.RedisProperties;
import com.jmfy.redisProperties.RedisUserKey;
import org.slf4j.Logger;
@ -11,6 +12,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ZSetOperations;
import redis.clients.jedis.JedisPoolConfig;
import java.lang.reflect.Type;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -334,4 +336,15 @@ public class RedisUtil {
LOGGER.error("sleep->msg=null", e.getMessage(), e);
}
}
public Map<String,Integer> getMapValues(String key){
Map<String,Integer> result = new HashMap<String,Integer>();
Map<Object, Object> entries = redisObjectTemplate.opsForHash().entries(key);
for(Map.Entry<Object,Object> item : entries.entrySet()){
Object key1 = item.getKey();
Object value = item.getValue();
result.put(gson.fromJson(gson.toJson(key1),String.class),gson.fromJson(value.toString(),Integer.class));
}
return result;
}
}