leutu
2024-06-03 3ef35e6cd16bbfa206b26bb3271eac40ad020bcb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.fastbee.common.core.redis;
 
import com.fastbee.common.constant.FastBeeConstant;
 
/**
 * 缓存key生成器
 *
 * @author bill
 */
public class RedisKeyBuilder {
 
    /**设备在线列表缓存key*/
    public static String buildDeviceOnlineListKey(){
       return FastBeeConstant.REDIS.DEVICE_ONLINE_LIST;
    }
 
    /**设备实时数据key*/
    public static String buildDeviceRtCacheKey(String serialNumber){
        return FastBeeConstant.REDIS.DEVICE_RUNTIME_DATA + serialNumber;
    }
 
    /**
     * 设备通讯协议参数
     */
    public static String buildDeviceRtParamsKey(String serialNumber){
        return FastBeeConstant.REDIS.DEVICE_PROTOCOL_PARAM + serialNumber;
    }
 
    /**固件版本缓存key*/
    public static String buildFirmwareCachedKey(Long firmwareId){
       return FastBeeConstant.REDIS.FIRMWARE_VERSION + firmwareId;
    }
 
    /**属性读取回调缓存key*/
    public static String buildPropReadCacheKey(String serialNumber){
        return FastBeeConstant.REDIS.PROP_READ_STORE + serialNumber;
    }
 
    /**
     * 物模型值命名缓存key
     * Key:TSLV:{productId}_{deviceNumber}   HKey:{identity#V/identity#S/identity#M/identity#N}
     */
    public static String buildTSLVCacheKey(Long productId,String serialNumber){
        return FastBeeConstant.REDIS.DEVICE_PRE_KEY + productId + "_" + serialNumber.toUpperCase();
    }
 
    /**
     * 物模型缓存key
     * 物模型命名空间:Key:TSL:{productId}  hkey: identity  value: thingsModel
     */
    public static String buildTSLCacheKey(Long productId){
        return FastBeeConstant.REDIS.TSL_PRE_KEY + productId;
    }
 
    /**录像缓存key*/
    public static String buildSipRecordinfoCacheKey(String recordKey){
        return FastBeeConstant.REDIS.RECORDINFO_KEY + recordKey;
    }
 
    /**设备id缓存key*/
    public static String buildSipDeviceidCacheKey(String id){
        return FastBeeConstant.REDIS.DEVICEID_KEY + id;
    }
    /**ipCSEQ缓存key*/
    public static String buildStreamCacheKey(String steamId){
        return FastBeeConstant.REDIS.STREAM_KEY + steamId;
    }
 
    /**ipCSEQ缓存key*/
    public static String buildSipCSEQCacheKey(String CSEQ){
        return FastBeeConstant.REDIS.SIP_CSEQ_PREFIX + CSEQ;
    }
 
    /**modbus指令缓存可以*/
    public static String buildModbusCacheKey(Long productId){
        return FastBeeConstant.REDIS.POLL_MODBUS_KEY + productId;
    }
 
    /*缓存设备下发指令消息ID*/
    public static String buildDownMessageIdCacheKey(String serialNumber){
        return FastBeeConstant.REDIS.DEVICE_MESSAGE_ID;
    }
 
}