package com.cm.common.pojo.dtos;

import com.cm.common.pojo.bos.DepartmentBO;
import com.cm.common.pojo.bos.GroupBO;
import com.cm.common.pojo.bos.PositionBO;
import com.cm.common.pojo.bos.RoleBO;

import java.util.List;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: UserAttrInfoBO
 * @Description: 用户属性
 * @Author: WangGeng
 * @Date: 2020/2/7 1:42 下午
 * @Version: 1.0
 **/
public class UserAttrInfoDTO {

    private List<RoleBO> roles;
    private List<DepartmentBO> departments;
    private List<GroupBO> groups;
    private List<PositionBO> positions;
    private String dataAuthority;
    private List<String> baseDepartmentIds;
    private List<String> dataAuthorityUserIds;

    public List<RoleBO> getRoles() {
        return roles;
    }

    public void setRoles(List<RoleBO> roles) {
        this.roles = roles;
    }

    public List<DepartmentBO> getDepartments() {
        return departments;
    }

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

    public List<GroupBO> getGroups() {
        return groups;
    }

    public void setGroups(List<GroupBO> groups) {
        this.groups = groups;
    }

    public List<PositionBO> getPositions() {
        return positions;
    }

    public void setPositions(List<PositionBO> positions) {
        this.positions = positions;
    }

    public String getDataAuthority() {
        return dataAuthority == null ? "" : dataAuthority.trim();
    }

    public void setDataAuthority(String dataAuthority) {
        this.dataAuthority = dataAuthority;
    }

    public List<String> getBaseDepartmentIds() {
        return baseDepartmentIds;
    }

    public void setBaseDepartmentIds(List<String> baseDepartmentIds) {
        this.baseDepartmentIds = baseDepartmentIds;
    }

    public List<String> getDataAuthorityUserIds() {
        return dataAuthorityUserIds;
    }

    public void setDataAuthorityUserIds(List<String> dataAuthorityUserIds) {
        this.dataAuthorityUserIds = dataAuthorityUserIds;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"roles\":")
                .append(roles);
        sb.append(",\"departments\":")
                .append(departments);
        sb.append(",\"groups\":")
                .append(groups);
        sb.append(",\"positions\":")
                .append(positions);
        sb.append(",\"dataAuthority\":")
                .append("\"").append(dataAuthority).append("\"");
        sb.append(",\"baseDepartmentIds\":")
                .append(baseDepartmentIds);
        sb.append(",\"dataAuthorityUserIds\":")
                .append(dataAuthorityUserIds);
        sb.append('}');
        return sb.toString();
    }
}
