package com.zksy.visualization.domain.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * @author Administrator
 * @version 1.0
 * @project dh-server-micro
 * @description 设备树查询
 * @date 2024/12/23 14:39:56
 */
@Data
public class DeviceTreeResponse {
    @ApiModelProperty(value = "数据内容", required = true)
    private List<ValueVO> value;

    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModel(description = "组织结构树节点")
    public static class ValueVO {

        @ApiModelProperty(value = "节点ID", example = "001", required = true)
        private String id;

        @ApiModelProperty(value = "节点名称", example = "根节点", required = true)
        private String name;

        @ApiModelProperty(value = "路径", example = "")
        private String path;

        @ApiModelProperty(value = "父节点ID", example = "")
        @JsonProperty("pId") // 明确指定 JSON 属性名
        private String pId;

        @ApiModelProperty(value = "节点类型", example = "org_base", required = true)
        private String type;

        @ApiModelProperty(value = "是否为父节点", example = "true", required = true)
        private Boolean isParent;

        @ApiModelProperty(value = "图标类型", example = "/bResource/static/image/treeIcons/org_org_base", required = true)
        private String iconType;

        @ApiModelProperty(value = "检查状态", example = "1", required = true)
        private Integer checkStat;

        @ApiModelProperty(value = "排序", example = "1", required = true)
        private Integer sort;

        @ApiModelProperty(value = "是否选中", example = "false", required = true)
        private Boolean isCheck;

        @ApiModelProperty(value = "节点类型（如：org）", example = "org", required = true)
        private String nodeType;

        @ApiModelProperty(value = "设备可见性", example = "1", required = true)
        private Integer deviceVisible;

        @ApiModelProperty(value = "是否有更多子节点", example = "false", required = true)
        private Boolean hasMoreNode;

        @ApiModelProperty(value = "是否禁止绑定用户", example = "0", required = true)
        private Integer forbidBindUser;

        @ApiModelProperty(value = "组织扩展信息", required = true)
        private OrgExt orgExt;
    }

    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModel(description = "组织扩展信息")
    public static class OrgExt {

        @ApiModelProperty(value = "组织编码", example = "001", required = true)
        private String orgCode;

        @ApiModelProperty(value = "组织唯一标识码", example = "", required = false)
        private String orgSn;

        @ApiModelProperty(value = "组织类型", example = "", required = false)
        private String orgType;

        @ApiModelProperty(value = "业务类型", example = "1", required = true)
        private Integer busiType;

        @ApiModelProperty(value = "重复添加标志", example = "1", required = true)
        private Integer repeatAddFlag;

        @ApiModelProperty(value = "树名称", example = "", required = false)
        private String treeName;
    }
}