com.admin4j.dict.anno.impl.DefaultDictProviderManager Maven / Gradle / Ivy
package com.admin4j.dict.anno.impl;
import com.admin4j.dict.anno.DictProvider;
import com.admin4j.dict.anno.DictProviderManager;
import com.admin4j.spring.plugin.provider.manager.ProviderManager;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.Map;
import java.util.Objects;
/**
* @author andanyang
* @since 2022/7/20 14:15
*/
public class DefaultDictProviderManager implements DictProviderManager {
/**
* 根据dictCode获取字典显示值
*
* @param field 字段
* @param strategy 字典策略
* @param dictType 字典分类
* @param dictCode 字典code
* @return 获取字典显示值
*/
@Override
public String dictLabel(Field field, String strategy, String dictType, Object dictCode) {
DictProvider load = ProviderManager.load(DictProvider.class, strategy);
return Objects.requireNonNull(load).dictLabel(field, dictType, dictCode);
}
/**
* 批量获取
*/
@Override
public Map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy