public class DictUtil extends Object
| 限定符 | 构造器和说明 |
|---|---|
private |
DictUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
clearDictCache()
清空字典缓存
|
static Function<String,String> |
dictKeyFun()
redis key
|
private static String |
dictLabel(DictDataVo dictData,
Locale locale)
获取到label
|
static String |
getCacheKey(String dictType)
设置cache key
|
static List<DictDataVo> |
getDictCache(DictType key)
获取字典缓存
|
static String |
getDictLabel(DictType dictType,
String dictValue)
根据字典类型和字典值获取字典标签
|
static String |
getDictLabel(DictType dictType,
String dictValue,
String separator)
根据字典类型和字典值获取字典标签
|
static String |
getDictValue(DictType dictType,
String dictLabel)
根据字典类型和字典标签获取字典值
|
static String |
getDictValue(DictType dictType,
String dictLabel,
String separator)
根据字典类型和字典标签获取字典值
|
static void |
setDictCache(Map<String,List<DictDataVo>> data)
设置字典缓存
|
private static String |
tran(DictType dictType,
String text,
String separator,
boolean value)
数据字典转义
|
public static void setDictCache(Map<String,List<DictDataVo>> data)
data - 参数键 字典数据列表public static String getDictLabel(DictType dictType, String dictValue)
dictType - 字典类型dictValue - 字典值public static String getDictValue(DictType dictType, String dictLabel)
dictType - 字典类型dictLabel - 字典标签public static String getDictLabel(DictType dictType, String dictValue, String separator)
dictType - 字典类型dictValue - 字典值separator - 分隔符public static String getDictValue(DictType dictType, String dictLabel, String separator)
dictType - 字典类型dictLabel - 字典标签separator - 分隔符private static String tran(DictType dictType, String text, String separator, boolean value)
dictType - 类型text - 文本separator - 分隔符value - 是否为值public static void clearDictCache()
private static String dictLabel(DictDataVo dictData, Locale locale)
dictData - 数据public static List<DictDataVo> getDictCache(DictType key)
key - 参数键public static String getCacheKey(String dictType)
dictType - 参数键Copyright © 2024. All rights reserved.