1
zj
2025-04-27 5ce072de78ae263b52dc0e2be5c7391b23c093cf
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
package com.nq.utils.redis;
 
import org.omg.CORBA.PUBLIC_MEMBER;
 
/**
 * redis Key
 * */
public class RedisKeyConstant {
 
 
    /**
     * 基础数据key
     * */
    public static final String RK_BASE_STOCK = "rk_base_stock";
 
 
    /**
     * 股票实时数据key
     * */
    public static final String RK_REAL_TIME_STOCK = "rk_real_time_stock";
 
 
    /**
     * 股票实时数据key
     * */
    public static final String RK_COMPANY_INFO = "rk_company_info";
 
 
    /**
     * 短信code
     */
    public static final String verification_code= "verification_code";
 
 
    /**
     * 黄金行情
     */
    public static final String XAUUSD= "XAUUSD";
 
    /**
     * 原油行情
     */
    public static final String USOIL= "USOIL";
 
    /**
     * 根据传入的 key 名称获取对应的 Redis key 常量
     *
     * @param key 名称
     * @return 对应的 Redis Key 或者 null 如果没有匹配的 key
     */
    public static String getRedisKey(String key) {
        switch (key) {
            case "XAUUSD":
                return XAUUSD;
            case "USOIL":
                return USOIL;
            default:
                return null; // 如果没有匹配的 key,返回 null
        }
    }
}