| | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | public String getDeviceConfig() { |
| | | Object obj = redisUtil.get(RedisKeyType.DEVICE_CONFIG.key); |
| | | if(null == obj){ |
| | | return null; |
| | | } |
| | | return obj.toString(); |
| | | } |
| | | |
| | | public DeviceCommandMsgModel getDeviceCommandMsg(SlaveType deviceType, Integer deviceId) { |
| | | TreeSet<String> listKey = getDeviceCommandMsgListKey(deviceType, deviceId); |
| | | if (listKey.isEmpty()) { |
| | |
| | | return key; |
| | | } |
| | | |
| | | public void sendDeviceConfig(String allDevices) { |
| | | redisUtil.set(RedisKeyType.DEVICE_CONFIG.key, allDevices); |
| | | } |
| | | |
| | | public void sendFakeDeviceConfig(String fakeDevices) { |
| | | redisUtil.set(RedisKeyType.FAKE_DEVICE_CONFIG.key, fakeDevices); |
| | | } |
| | | |
| | | public TreeSet<String> getDeviceMsgListKey(SlaveType deviceType, Integer deviceId) { |
| | | String listKey = parseDeviceMsgKey(deviceType, deviceId); |
| | | Set<String> keys = redisUtil.searchKeys(listKey); |