|
@@ -0,0 +1,23 @@
|
|
|
|
|
+package com.yunfeiyun.agmp.iot.common.service;
|
|
|
|
|
+
|
|
|
|
|
+import com.yunfeiyun.agmp.common.enums.RedisCacheKey;
|
|
|
|
|
+import com.yunfeiyun.agmp.common.framework.manager.RedisCacheManager;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.Set;
|
|
|
|
|
+
|
|
|
|
|
+@Service
|
|
|
|
|
+public class IotMqttTopicCacheService {
|
|
|
|
|
+
|
|
|
|
|
+ private static final String KEY_ID = "all";
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RedisCacheManager redisCacheManager;
|
|
|
|
|
+
|
|
|
|
|
+ public void refreshTopicCache(Set<String> topicSet){
|
|
|
|
|
+ redisCacheManager.setCacheSet(RedisCacheKey.IOT_MQTT_DEVICE_TOPIC_SET, KEY_ID, topicSet);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+}
|