package com.usky.system.service.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.usky.system.domain.SysUser;
import lombok.Data;

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

/**
 * @description：TODO
 * @author： fu
 * @create： 2024-08-01 11:40
 */
@Data
public class UserTreeNode extends TreeNode{

    /**
     * 节点ID
     */
    private Long id;

    /**
     * 节点名称
     */
    private String label;

     /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<TreeNode> children;

    /** 用户ID */
    private Long userId;

    /** 部门ID */
    private Long deptId;

    /** 用户账号 */
    private String userName;

    /** 用户昵称 */
    private String nickName;

    /** 用户邮箱 */
    private String email;

    /** 手机号码 */
    private String phonenumber;

    /** 用户性别 */
    private String sex;

    /** 用户头像 */
    private String avatar;

    /** 地址 */
    private String address;

    /** 岗位 */
    private String post;

    public UserTreeNode(SysUser user) {
        this.id = user.getUserId();
        this.label = user.getNickName();
        this.userId = user.getUserId();
        this.deptId = user.getDeptId();
        this.userName = user.getUserName();
        this.nickName = user.getNickName();
        this.email = user.getEmail();
        this.phonenumber = user.getPhonenumber();
        this.sex = user.getSex();
        this.avatar = user.getAvatar();
        this.address = user.getAddress();
        this.post = user.getPost();
        this.children = new ArrayList<>();
    }
}

