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
package com.everyday.word.config;
 
/**
 * @author hxh
 * @title: RedisKeyEnum
 * @description: Redis的键枚举
 * @date 2025/2/11 17:08
 */
public enum RedisKeyEnum {
    emptyKey("", "空值-key外部空值"),
    SMS("sms-", "短信"),
    SMSVCode("smscode-", "短信验证码");
 
    private final String key;
    private final String desc;
 
    private RedisKeyEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }
 
    public String getDesc() {
        return desc;
    }
 
    public String getKey() {
        return key;
    }
 
    public static String getRedisKey(RedisKeyEnum keyEnum, String value) {
        return keyEnum.getKey() + value;
    }
 
}