- 字典添加获取单个Value
This commit is contained in:
parent
daf3f4c8c7
commit
5de4ebfd2b
@ -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);
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user