ServiceFileTreeController.java 2.01 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.model.ServiceFileTreeDO;
import com.subsidy.service.ServiceFileTreeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2024-04-08
 */
@RestController
@Api(tags = "文件目录树")
@RequestMapping("/serviceFileTree")
public class ServiceFileTreeController {

    @Autowired
    private ServiceFileTreeService serviceFileTreeService;

    @PostMapping("trees")
    @ApiOperation("##2024.4##查看某公司的目录树 companyId serviceId")
    public ResponseVO trees(@RequestBody ServiceFileTreeDO serviceFileTreeDO){
        return ResponseData.generateCreatedResponse(0,serviceFileTreeService.trees(serviceFileTreeDO));
    }

    @PostMapping("addTree")
    @ApiOperation("##2024.4##添加树节点  companyId serviceId parentId treeName")
    public ResponseVO addTree(@RequestBody ServiceFileTreeDO serviceFileTreeDO){
        return ResponseData.generateCreatedResponse(0,serviceFileTreeService.addTree(serviceFileTreeDO));
    }

    @PostMapping("updateTree")
    @ApiOperation("##2024.4##修改树节点  id treeName")
    public ResponseVO updateTree(@RequestBody ServiceFileTreeDO serviceFileTreeDO){
        return ResponseData.generateCreatedResponse(0,serviceFileTreeService.updateTree(serviceFileTreeDO));
    }

    @PostMapping("deleteTree")
    @ApiOperation("##2024.4##删除树节点 id ")
    public ResponseVO deleteTree(@RequestBody ServiceFileTreeDO serviceFileTreeDO){
        return ResponseData.generateCreatedResponse(0,serviceFileTreeService.deleteTree(serviceFileTreeDO));
    }

}