mitao
2024-03-18 a4befde9e479ff159d08202b7e231377a975406b
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbFieldCategoryController.java
@@ -47,12 +47,7 @@
    @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();
    }
@@ -61,7 +56,7 @@
     * @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);
@@ -100,9 +95,9 @@
     * @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();
    }
@@ -115,12 +110,7 @@
    @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();
    }