字典功能 #5

Closed
jiangdingxuan wants to merge 9 commits from rzdata:feature/dict into main
2 changed files with 12 additions and 0 deletions
Showing only changes of commit 2ebeb0976b - Show all commits

View File

@ -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));
}
} }

View File

@ -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);
}
} }