|
|
|
@ -1,36 +1,36 @@
|
|
|
|
|
package org.springblade.auth; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import io.protostuff.LinkedBuffer; |
|
|
|
|
import io.protostuff.ProtobufIOUtil; |
|
|
|
|
import io.protostuff.Schema; |
|
|
|
|
import io.protostuff.runtime.RuntimeSchema; |
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
import org.junit.jupiter.api.extension.ExtendWith; |
|
|
|
|
import org.springblade.common.cache.CacheNames; |
|
|
|
|
import org.springblade.core.cache.utils.CacheUtil; |
|
|
|
|
import org.springblade.core.redis.cache.BladeRedis; |
|
|
|
|
import org.springblade.core.test.BladeBootTest; |
|
|
|
|
import org.springblade.core.test.BladeSpringExtension; |
|
|
|
|
import org.springblade.core.tool.utils.ProtostuffUtil; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
|
|
|
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
|
|
|
|
|
@ExtendWith(BladeSpringExtension.class) |
|
|
|
|
@BladeBootTest(appName = "blade-auth", enableLoader = true) |
|
|
|
|
public class TestService { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BladeRedis bladeRedis; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void test2() { |
|
|
|
|
RedisTemplate<String, Object> redisTemplate = bladeRedis.getRedisTemplate(); |
|
|
|
|
//import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
//import io.protostuff.LinkedBuffer;
|
|
|
|
|
//import io.protostuff.ProtobufIOUtil;
|
|
|
|
|
//import io.protostuff.Schema;
|
|
|
|
|
//import io.protostuff.runtime.RuntimeSchema;
|
|
|
|
|
//import org.junit.jupiter.api.Test;
|
|
|
|
|
//import org.junit.jupiter.api.extension.ExtendWith;
|
|
|
|
|
//import org.springblade.common.cache.CacheNames;
|
|
|
|
|
//import org.springblade.core.cache.utils.CacheUtil;
|
|
|
|
|
//import org.springblade.core.redis.cache.BladeRedis;
|
|
|
|
|
//import org.springblade.core.test.BladeBootTest;
|
|
|
|
|
//import org.springblade.core.test.BladeSpringExtension;
|
|
|
|
|
//import org.springblade.core.tool.utils.ProtostuffUtil;
|
|
|
|
|
//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
//import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
|
|
|
|
|
|
//import java.io.ByteArrayInputStream;
|
|
|
|
|
//import java.io.IOException;
|
|
|
|
|
//import java.io.UnsupportedEncodingException;
|
|
|
|
|
|
|
|
|
|
//@ExtendWith(BladeSpringExtension.class)
|
|
|
|
|
//@BladeBootTest(appName = "blade-auth", enableLoader = true)
|
|
|
|
|
//public class TestService {
|
|
|
|
|
//
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private BladeRedis bladeRedis;
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// @Test
|
|
|
|
|
// public void test2() {
|
|
|
|
|
// RedisTemplate<String, Object> redisTemplate = bladeRedis.getRedisTemplate();
|
|
|
|
|
// byte[] dump = redisTemplate.dump("627683:logpm:user:warehouse:select:1649331096967450625");
|
|
|
|
|
// Schema<String> schema = RuntimeSchema.getSchema(String.class);
|
|
|
|
|
// LinkedBuffer buffer = LinkedBuffer.allocate(256);
|
|
|
|
@ -40,21 +40,21 @@ public class TestService {
|
|
|
|
|
// JSONObject jsonObject = new JSONObject();
|
|
|
|
|
// jsonObject.put("name","xiaob");
|
|
|
|
|
// jsonObject.put("age",23);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// bladeRedis.setEx(CacheNames.tenantKeyObj("627683", CacheNames.USER_WAREHOUSE_KEY, "1649331096967450625"), jsonObject.toJSONString(), 30 * 24 * 60 * 60L);
|
|
|
|
|
// bladeRedis.setEx(CacheNames.tenantKeyObj("627683111", CacheNames.USER_WAREHOUSE_KEY, "1649331096967450625"), ProtostuffUtil.serialize(jsonObject.toJSONString()), 30 * 24 * 60 * 60L);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Object o = bladeRedis.get("627683:logpm:user:warehouse:select:1649331096967450625");
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// byte[] dump = redisTemplate.dump("627683:logpm:user:warehouse:select:1649331096967450625");
|
|
|
|
|
|
|
|
|
|
Object o = bladeRedis.get("627683:logpm:user:warehouse:select:1649331096967450625"); |
|
|
|
|
//
|
|
|
|
|
// Object o = bladeRedis.get("627683:logpm:user:warehouse:select:1649331096967450625");
|
|
|
|
|
// Object o = bladeRedis.get("627683111:logpm:user:warehouse:select:1649331096967450625");
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// String deserialize = ProtostuffUtil.deserialize(dump, String.class);
|
|
|
|
|
|
|
|
|
|
System.out.println(111); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//
|
|
|
|
|
// System.out.println(111);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//}
|
|
|
|
|