- 重命名获取多个字典值方法
This commit is contained in:
parent
a765b2c233
commit
d30aeea6ab
@ -5,6 +5,7 @@ import cn.iocoder.mall.admin.api.bo.DataDictBO;
|
|||||||
import cn.iocoder.mall.admin.api.dto.DataDictAddDTO;
|
import cn.iocoder.mall.admin.api.dto.DataDictAddDTO;
|
||||||
import cn.iocoder.mall.admin.api.dto.DataDictUpdateDTO;
|
import cn.iocoder.mall.admin.api.dto.DataDictUpdateDTO;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface DataDictService {
|
public interface DataDictService {
|
||||||
@ -17,5 +18,25 @@ public interface DataDictService {
|
|||||||
|
|
||||||
CommonResult<Boolean> deleteDataDict(Integer adminId, Integer dataDictId);
|
CommonResult<Boolean> deleteDataDict(Integer adminId, Integer dataDictId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典值 - 单个
|
||||||
|
*
|
||||||
|
* 注意: dictValue:Object 为了方便调用,会自动转换为 dictValue:String
|
||||||
|
*
|
||||||
|
* @param dictKey
|
||||||
|
* @param dictValue
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
CommonResult<DataDictBO> getDataDict(String dictKey, Object dictValue);
|
CommonResult<DataDictBO> getDataDict(String dictKey, Object dictValue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典值 - 多个
|
||||||
|
*
|
||||||
|
* 注意:dictValueList:? 为了方便调用,会自动转换为 Set:String
|
||||||
|
*
|
||||||
|
* @param dictKey
|
||||||
|
* @param dictValueList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CommonResult<List<DataDictBO>> getDataDictList(String dictKey, Collection<?> dictValueList);
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ public class DataDictServiceImpl implements DataDictService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<List<DataDictBO>> getDataDict(String dictKey, Collection<Object> dictValueList) {
|
public CommonResult<List<DataDictBO>> getDataDictList(String dictKey, Collection<?> dictValueList) {
|
||||||
Set<String> convertDictValueList = dictValueList.stream().map(o -> String.valueOf(o)).collect(Collectors.toSet());
|
Set<String> convertDictValueList = dictValueList.stream().map(o -> String.valueOf(o)).collect(Collectors.toSet());
|
||||||
List<DataDictDO> dataDictDOList = dataDictMapper.selectByEnumValueAndValues(dictKey, convertDictValueList);
|
List<DataDictDO> dataDictDOList = dataDictMapper.selectByEnumValueAndValues(dictKey, convertDictValueList);
|
||||||
List<DataDictBO> dataDictBOList = DataDictConvert.INSTANCE.convert(dataDictDOList);
|
List<DataDictBO> dataDictBOList = DataDictConvert.INSTANCE.convert(dataDictDOList);
|
||||||
|
Loading…
Reference in New Issue
Block a user