liding
2026-04-23 1b3d13f691957d4fffdfb3671dc09f66b6e3dfd0
src/main/java/com/ruoyi/warehouse/controller/DocumentClassificationController.java
@@ -8,7 +8,7 @@
import com.ruoyi.warehouse.service.DocumentClassificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.AllArgsConstructor;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@@ -17,32 +17,35 @@
@RestController
@Api(tags = "文档分类")
@RequestMapping("/warehouse/documentClassification")
@AllArgsConstructor
public class DocumentClassificationController extends BaseController {
    @Autowired
    private DocumentClassificationService documentClassificationService;
    //树结构
    @GetMapping("/getList")
    @ApiOperation("文档分类-查询")
    @Log(title = "文档分类-查询", businessType = BusinessType.OTHER)
    public AjaxResult getList() {
        return AjaxResult.success(documentClassificationService.list());
        return AjaxResult.success(documentClassificationService.selectDocumentClassificationList());
    }
    @PostMapping("/add")
    @ApiOperation("文档分类-添加")
    @Log(title = "文档分类-添加", businessType = BusinessType.INSERT)
    public AjaxResult add(@RequestBody DocumentClassification documentClassification) {
        return AjaxResult.success(documentClassificationService.save(documentClassification));
    }
    @PostMapping("/update")
    @PutMapping("/update")
    @ApiOperation("文档分类-更新")
    @Log(title = "文档分类-更新", businessType = BusinessType.UPDATE)
    public AjaxResult update(@RequestBody DocumentClassification documentClassification) {
        return AjaxResult.success(documentClassificationService.updateById(documentClassification));
    }
    @DeleteMapping("/delete")
    @ApiOperation("文档分类删除")
    @Log(title = "文档分类删除", businessType = BusinessType.DELETE)
    public AjaxResult delete(@RequestBody List<Long> ids) {
        if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID");
        if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID");
        return AjaxResult.success(documentClassificationService.deleteByIds(ids));
    }