| | |
| | | @Autowired |
| | | private DictDataService dictDataService; |
| | | |
| | | @PreAuthorize("hasAuthority('system:dictData:list')") |
| | | @PreAuthorize("hasAuthority('system:dictType:list')") |
| | | @PostMapping("/dictData/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(dictDataService.page(pageParam, pageParam.buildWrapper(true)))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:dictData:list')") |
| | | @PreAuthorize("hasAuthority('system:dictType:list')") |
| | | @PostMapping("/dictData/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(dictDataService.list())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:dictData:list')") |
| | | @PreAuthorize("hasAuthority('system:dictType:list')") |
| | | @PostMapping({"/dictData/many/{ids}", "/dictDatas/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(dictDataService.listByIds(Arrays.asList(ids)))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:dictData:list')") |
| | | @PreAuthorize("hasAuthority('system:dictType:list')") |
| | | @GetMapping("/dictData/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(dictDataService.getById(id))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:dictData:save')") |
| | | @PreAuthorize("hasAuthority('system:dictType:save')") |
| | | @OperationLog("Create 字典数据集") |
| | | @PostMapping("/dictData/save") |
| | | public R save(@RequestBody DictData dictData) { |
| | |
| | | return R.ok("Save Success").add(buildPageRowsUtils.rowsMap(dictData)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:dictData:update')") |
| | | @PreAuthorize("hasAuthority('system:dictType:update')") |
| | | @OperationLog("Update 字典数据集") |
| | | @PostMapping("/dictData/update") |
| | | public R update(@RequestBody DictData dictData) { |
| | |
| | | return R.ok("Update Success").add(buildPageRowsUtils.rowsMap(dictData)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:dictData:remove')") |
| | | @PreAuthorize("hasAuthority('system:dictType:remove')") |
| | | @OperationLog("Delete 字典数据集") |
| | | @PostMapping("/dictData/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | |
| | | return R.ok("Delete Success").add(buildPageRowsUtils.rowsMap(ids)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:dictData:list')") |
| | | @PreAuthorize("hasAuthority('system:dictType:list')") |
| | | @PostMapping("/dictData/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(vos)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:dictData:list')") |
| | | @PreAuthorize("hasAuthority('system:dictType:list')") |
| | | @PostMapping("/dictData/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(buildPageRowsUtils.rowsMap(dictDataService.list()), DictData.class), response); |