package org.springblade.manager.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.manager.entity.WbsTreeContract;
import org.springblade.manager.service.IWbsTreeContractService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 合同段wbs树 控制器
 *
 * @author liuyc
 * @since 2022-06-28
 */
@RestController
@AllArgsConstructor
@RequestMapping("/wbsTreeContract")
@Api(value = "合同段wbs树", tags = "合同段wbs树接口")
public class WbsTreeContractController extends BladeController {

    private final IWbsTreeContractService iWbsTreeContractService;

    @GetMapping("/searchNodeAllTable")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "查询当前节点下所有元素表信息", notes = "传入节点primaryKeyId")
    public R searchNodeAllTable(String primaryKeyId) {
        List<WbsTreeContract> list = iWbsTreeContractService.searchNodeAllTable(primaryKeyId);
        if (list.size() > 0) {
            return R.data(list);
        }
        return R.fail(200, "未查询到信息");
    }


}
