package com.aircraft.modules.system.domain.vo;

import com.aircraft.modules.system.domain.EmArea;
import com.aircraft.modules.system.domain.EmScenic;
import com.aircraft.modules.system.domain.enums.AreaTreeType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class AreaTreeVo implements Serializable {

    private Long id;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "节点类型")
    private AreaTreeType type;

    @ApiModelProperty(value = "子机构")
    private List<AreaTreeVo> sons;

    public AreaTreeVo() {
    }

    public AreaTreeVo(EmScenic scenic) {
        this.id = scenic.getId();
        this.name = scenic.getName();
        this.type = AreaTreeType.scenic;
    }

    public AreaTreeVo(String name) {
        this.name = name;
    }

    public AreaTreeVo(EmArea area) {
        this.id = area.getId();
        this.name = area.getName();
        this.type = AreaTreeType.area;
    }
}
