package com.ruoyi.app.controller.doubleDefense;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.doubledefense.domain.ContractorTreeSelect;
import com.ruoyi.doubledefense.service.IContractorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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;

/**
 * 承包商Controller
 *
 * @author ruoyi
 * @date 2023-08-04
 */
@Api(tags = "APP承包商")
@RestController
@RequestMapping("/app/doubledefense/contractor")
public class ContractorForAppController extends BaseController
{
    @Autowired
    private IContractorService contractorService;


    /**
     * 查询承包商用户列表
     */
    @ApiOperation("查询承包商Tree包含下面的用户")
    @GetMapping("/tree")
    public AjaxResult tree()
    {
        List<ContractorTreeSelect> treeSelects = contractorService.selectContractorTreeListForApp(true);
        return AjaxResult.success(treeSelects);
    }

}
