| | |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加") |
| | | public R<Object> add(@RequestBody @Validated FieldCategoryDTO dto) { |
| | | try { |
| | | tbFieldCategoryService.add(dto); |
| | | } catch (Exception e) { |
| | | log.error("添加分类异常", e); |
| | | throw new RuntimeException("操作失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | * @param id 字段分类id |
| | | * @return R |
| | | */ |
| | | @GetMapping("/getById") |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("根据id获取字段分类详情") |
| | | public R<FieldCategoryDetailVO> getById(@RequestParam(value = "id") Integer id) { |
| | | TbFieldCategory oneCategory = tbFieldCategoryService.getById(id); |
| | |
| | | * @param dto 显示隐藏操作数据传输对象 |
| | | * @return R |
| | | */ |
| | | @PutMapping("/show-hide") |
| | | @PostMapping("/show-hide") |
| | | @ApiOperation("隐藏显示操作") |
| | | public R<Object> showHide(@RequestBody ShowHideDTO dto) { |
| | | public R<Void> showHide(@RequestBody ShowHideDTO dto) { |
| | | tbFieldCategoryService.showHide(dto); |
| | | return R.ok(); |
| | | } |
| | |
| | | @DeleteMapping("/delete-children") |
| | | @ApiOperation("编辑页面删除子字段分类") |
| | | public R<Object> deleteChildren(@RequestParam(value = "id") Integer id){ |
| | | try { |
| | | tbFieldCategoryService.deleteChildren(id); |
| | | } catch (Exception e) { |
| | | log.error("编辑页面删除子字段分类失败",e); |
| | | throw new RuntimeException("操作失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |