package com.hotwj.platform.resourceManagement.safeOrganStructure;

import cn.hutool.core.lang.tree.Tree;
import com.hotwj.platform.resourceManagement.companySafetyManager.domain.bo.HotCompanySafetyManagerBo;
import com.hotwj.platform.resourceManagement.companySafetyManager.service.IHotCompanySafetyManagerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 安全组织架构
 *
 * @author shihongwei
 * @date 2025-12-15
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/resourceManagement/safeOrganStrucure")
@Tag(name = "安全组织架构", description = "安全组织架构模块")
public class OrganStructureController {

    private final IHotCompanySafetyManagerService hotCompanySafetyManagerService;

    /**
     * 系统管理员结构图（树形）
     */
    //@SaCheckPermission("resourceManagement:safeOrganStrucure:systemAdminTree")
    @GetMapping("/systemAdminTree")
    @Operation(summary = "查询系统管理员组织树（支持按部门筛选）")
    public R<Tree<Long>> systemAdminTree(HotCompanySafetyManagerBo bo) {
        return R.ok(hotCompanySafetyManagerService.buildSystemAdminTree(bo));
    }
}
