forked from rzdata/demo-empty
字典功能 #2
@ -82,4 +82,9 @@ public class DictController {
|
|||||||
public List<Dict> getDictData(@PathVariable String type) {
|
public List<Dict> getDictData(@PathVariable String type) {
|
||||||
return dictService.getDictByType(type);
|
return dictService.getDictByType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("{id}")
|
||||||
|
public void deleteDict(@PathVariable String id) {
|
||||||
|
dictService.deleteDict(Collections.singleton(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,4 +81,11 @@ public class DictService {
|
|||||||
throw new RepeatDataException(String.format("字典类型:%s, 值:%s 已存在", dict.getType(), dict.getValue()));
|
throw new RepeatDataException(String.format("字典类型:%s, 值:%s 已存在", dict.getType(), dict.getValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteDict(Collection<String> ids) {
|
||||||
|
if (ids == null || ids.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dictRepository.get().deleteBatchIds(ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user