mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 19:15:06 +08:00
Merge branch 'develop' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into master-jdk21
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.api.dict;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -33,6 +35,21 @@ public interface DictDataApi {
|
||||
*/
|
||||
DictDataRespDTO getDictData(String type, String value);
|
||||
|
||||
/**
|
||||
* 获得指定的字典标签,从缓存中
|
||||
*
|
||||
* @param type 字典类型
|
||||
* @param value 字典数据值
|
||||
* @return 字典标签
|
||||
*/
|
||||
default String getDictDataLabel(String type, Integer value) {
|
||||
DictDataRespDTO dictData = getDictData(type, String.valueOf(value));
|
||||
if (ObjUtil.isNull(dictData)) {
|
||||
return StrUtil.EMPTY;
|
||||
}
|
||||
return dictData.getLabel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析获得指定的字典数据,从缓存中
|
||||
*
|
||||
|
Reference in New Issue
Block a user