package com.example.demo.model;

import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;

/**
 * 部门实体。
 * <p>对应数据库 dept 表，支持树形层级结构。</p>
 */
@Schema(description = "部门实体")
public class Department {

    @Schema(description = "部门ID", example = "1")
    private Long deptId;

    @Schema(description = "部门名称", example = "技术部")
    private String deptName;

    @Schema(description = "上级部门ID", example = "0")
    private Long parentDeptId;

    @Schema(description = "排序号", example = "1")
    private Integer sortOrder;

    @Schema(description = "负责人", example = "李四")
    private String leader;

    @Schema(description = "状态：0-停用，1-启用", example = "1")
    private Integer status;

    @Schema(description = "子部门列表")
    private List<Department> children;

    public Department() {}

    public Department(Long deptId, String deptName, Long parentDeptId,
                      Integer sortOrder, String leader, Integer status) {
        this.deptId = deptId;
        this.deptName = deptName;
        this.parentDeptId = parentDeptId;
        this.sortOrder = sortOrder;
        this.leader = leader;
        this.status = status;
    }

    public Long getDeptId() { return deptId; }
    public void setDeptId(Long deptId) { this.deptId = deptId; }
    public String getDeptName() { return deptName; }
    public void setDeptName(String deptName) { this.deptName = deptName; }
    public Long getParentDeptId() { return parentDeptId; }
    public void setParentDeptId(Long parentDeptId) { this.parentDeptId = parentDeptId; }
    public Integer getSortOrder() { return sortOrder; }
    public void setSortOrder(Integer sortOrder) { this.sortOrder = sortOrder; }
    public String getLeader() { return leader; }
    public void setLeader(String leader) { this.leader = leader; }
    public Integer getStatus() { return status; }
    public void setStatus(Integer status) { this.status = status; }
    public List<Department> getChildren() { return children; }
    public void setChildren(List<Department> children) { this.children = children; }
}
