package ink.wgink.pojo.dtos.department;

import ink.wgink.pojo.pos.DepartmentPO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: DepartmentDTO
 * @Description: 组织部门
 * @Author: wenc
 * @Date: 2019/1/8 7:43 PM
 * @Version: 1.0
 **/
@ApiModel
public class DepartmentDTO extends DepartmentPO {

    private static final long serialVersionUID = -6682276871851732246L;
    @ApiModelProperty(name = "subDepartments", value = "组织部门子列表")
    private List<DepartmentDTO> subDepartments;

    public List<DepartmentDTO> getSubDepartments() {
        return subDepartments == null ? new ArrayList<>() : subDepartments;
    }

    public void setSubDepartments(List<DepartmentDTO> subDepartments) {
        this.subDepartments = subDepartments;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"subDepartments\":")
                .append(subDepartments);
        sb.append('}');
        return sb.toString();
    }
}
