package com.cm.common.plugin.pojo.bos.user;

import com.cm.common.plugin.pojo.bos.UserResourceBO;
import com.cm.common.plugin.pojo.bos.department.DepartmentResourceBO;

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

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: UserDepartmentResourceBO
 * @Description: 用户部门资源
 * @Author: WangGeng
 * @Date: 2020/9/16 18:14
 * @Version: 1.0
 **/
public class UserDepartmentResourceBO extends UserResourceBO {

    public UserDepartmentResourceBO() {
        super();
    }

    public UserDepartmentResourceBO(UserResourceBO userResourceBO) {
        super();
        super.setUserId(userResourceBO.getUserId());
        super.setUserUsername(userResourceBO.getUserUsername());
        super.setUserName(userResourceBO.getUserName());
        super.setUserPhone(userResourceBO.getUserPhone());
        super.setUserEmail(userResourceBO.getUserEmail());
        super.setUserAvatar(userResourceBO.getUserAvatar());
    }

    private List<DepartmentResourceBO> departments;

    public List<DepartmentResourceBO> getDepartments() {
        if (departments == null) {
            return new ArrayList<>();
        }
        return departments;
    }

    public void setDepartments(List<DepartmentResourceBO> departments) {
        this.departments = departments;
    }
}
