- 字典添加获取单个Value

pull/1/head
sin 2019-04-16 10:14:53 +08:00
parent daf3f4c8c7
commit 5de4ebfd2b
3 changed files with 5 additions and 4 deletions

View File

@ -17,5 +17,5 @@ public interface DataDictService {
CommonResult<Boolean> deleteDataDict(Integer adminId, Integer dataDictId);
CommonResult<DataDictBO> getDataDict(String dictKey, String dictValue);
CommonResult<DataDictBO> getDataDict(String dictKey, Object dictValue);
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.mall.admin.api.bo;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
@ -10,7 +11,7 @@ import java.util.Date;
*/
@Data
@Accessors(chain = true)
public class DataDictBO {
public class DataDictBO implements Serializable {
/**
*

View File

@ -88,8 +88,8 @@ public class DataDictServiceImpl implements DataDictService {
}
@Override
public CommonResult<DataDictBO> getDataDict(String dictKey, String dictValue) {
DataDictDO dataDictDO = dataDictMapper.selectByEnumValueAndValue(dictKey, dictValue);
public CommonResult<DataDictBO> getDataDict(String dictKey, Object dictValue) {
DataDictDO dataDictDO = dataDictMapper.selectByEnumValueAndValue(dictKey, String.valueOf(dictValue));
DataDictBO dataDictBO = DataDictConvert.INSTANCE.convert(dataDictDO);
return CommonResult.success(dataDictBO);
}