字典开放接口
1、新增字典数据
传入参数:
| 参数 | 名称 | 类型 | 必传 | 默认值 | 备注 |
|---|---|---|---|---|---|
| dictType | 字典类型 | String | Y | - | - |
| dictCode | 字典编码 | Long | Y | - | - |
| dictSort | 字典排序 | Long | Y | - | - |
| dictLabel | 字典标签 | String | Y | - | - |
| dictValue | 字典键值 | String | Y | - | - |
| cssClass | 字典样式 | String | N | - | - |
| listClass | 表格字典样式 | String | N | - | - |
| isDefault | 是否默认 | String | Y | - | - |
| systemName | 系统名称 | String | Y | - | - |
| status | 状态 | String | Y | - | - |
返回参数:
| 参数 | 名称 | 类型 | 必传 | 默认值 | 备注 |
|---|---|---|---|---|---|
| ts | 时间戳 | String | Y | - | |
| data | 数据 | int | Y | - |
使用demo
java
@Autowired
private DictClient dictClient;
public void demo(){
DictData dictData = new DictData();
dictData.setDictLabel("测试0716");
dictData.setDictValue("ceshi0716");
dictData.setDictType("pangea-test02");
dictData.setIsDefault("Y");
dictData.setStatus("0");
dictData.setDictSort(9L);
int i = dictClient.addDataSave(dictData);
}2、查询系统中字典类型下的字典值
传入参数:
| 参数 | 名称 | 类型 | 必传 | 默认值 | 备注 |
|---|---|---|---|---|---|
| dictType | 字典类型 | String | Y | - | - |
| systemName | 系统名称 | String | Y | - | - |
返回参数:
| 参数 | 名称 | 类型 | 默认值 | 备注 |
|---|---|---|---|---|
| dictType | 字典类型 | String | - | - |
| dictCode | 字典编码 | Long | - | - |
| dictSort | 字典排序 | Long | - | - |
| dictLabel | 字典标签 | String | - | - |
| dictValue | 字典键值 | String | - | - |
| cssClass | 字典样式 | String | - | - |
| listClass | 表格字典样式 | String | - | - |
| isDefault | 是否默认 | String | - | - |
| systemName | 系统名称 | String | - | - |
| status | 状态 | String | - | - |
使用demo
java
@Autowired
private DictClient dictClient;
public void demo(){
String systemName = "pangea";
String dictType = "pangea-test";
List<DictData> dictData = dictClient.queryByDictType(systemName, dictType);
}