package ink.wgink.pojo.dtos.user;

import ink.wgink.pojo.pos.DepartmentPO;
import ink.wgink.pojo.pos.GroupPO;
import ink.wgink.pojo.pos.PositionPO;
import ink.wgink.pojo.pos.RolePO;

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<RolePO> roles;
    private List<DepartmentPO> departments;
    private List<GroupPO> groups;
    private List<PositionPO> positions;
    private String dataRight;
    private List<String> rootDepartmentIds;
    private List<String> dataAuthorityUserIds;

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

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

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

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

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

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

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

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

    public String getDataRight() {
        return dataRight == null ? "" : dataRight.trim();
    }

    public void setDataRight(String dataRight) {
        this.dataRight = dataRight;
    }

    public List<String> getRootDepartmentIds() {
        return rootDepartmentIds;
    }

    public void setRootDepartmentIds(List<String> rootDepartmentIds) {
        this.rootDepartmentIds = rootDepartmentIds;
    }

    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(dataRight).append("\"");
        sb.append(",\"baseDepartmentIds\":")
                .append(rootDepartmentIds);
        sb.append(",\"dataAuthorityUserIds\":")
                .append(dataAuthorityUserIds);
        sb.append('}');
        return sb.toString();
    }
}
