|
@@ -0,0 +1,55 @@
|
|
|
+package com.persagy.test;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import org.springframework.data.redis.core.Cursor;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+import org.springframework.data.redis.core.ScanOptions;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+
|
|
|
+ * 报警记录控制层
|
|
|
+ *
|
|
|
+ * @author lixing
|
|
|
+ * @version V1.0 2021-09-08 22:30:38
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("test")
|
|
|
+public class TestController {
|
|
|
+ @Resource(name = "alarmRedisTemplate")
|
|
|
+ private RedisTemplate<String, Object> alarmRedisTemplate;
|
|
|
+
|
|
|
+ @PostMapping("/redis")
|
|
|
+ public void testRedis() {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ long time = 111L;
|
|
|
+ alarmRedisTemplate.opsForValue().set("test", time);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|