package easydo.technology.core;

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

import easydo.technology.utils.SecurityUtils;
import zmo.technology.lite.core.ZeroException;

public  class SpringRequestUser {
    private long userID;
    private long deptID;
    private List<FactoryProjectInfo> projectInfos;
    private boolean projectUser;

    public SpringRequestUser() throws ZeroException {
        super();
        try {
            projectUser = false;
            userID = SecurityUtils.getCurrentUserId();
        } catch (Exception e) {
            throw new ZeroException(30112, e.toString());
        }
    }

    public long getUserID() {
        return userID;
    }

    public void setDeptID(long deptID) {
        this.deptID = deptID;
    }

    public long getDeptID() {
        return deptID;
    }

    public void addProjectInfo(FactoryProjectInfo projectInfo) {
        projectInfos = new ArrayList<>();
        projectInfos.add(projectInfo);
        projectUser = true;
    }

    public void setProjectInfos(List<FactoryProjectInfo> projectInfos) {
        this.projectInfos = projectInfos;
    }

    public List<FactoryProjectInfo> getProjectInfos() {
        return projectInfos;
    }

    public void setProjectUser(boolean projectUser) {
        this.projectUser = projectUser;
    }

    public boolean isProjectUser() {
        return projectUser;
    }
}

