package com.sdtool.common.entity.site;

import com.sdtool.common.datas.HttpCode;
import com.sdtool.common.entity.base.BaseEntity;

public class LoginResult extends BaseEntity {

    private int loginStatus;

    private String loginMsg;

    private long userId;

    private String userAccount;

    private String userName;

    private long deptId;

    private String deptName;

    private long supplierCode;

    private String dataSourceId;

    private String accessToken;

    private String userOpenId;

    public LoginResult() {
    }

    public LoginResult(ERPTokenUser tokenUser, String token) {

        this.loginStatus = HttpCode.OK.value();
        this.loginMsg = "";
        this.userId = tokenUser.getId();
        this.userAccount = tokenUser.getAccount();
        this.userName = tokenUser.getUserName();
        this.deptId = tokenUser.getDeptId();
        this.deptName = tokenUser.getDeptName();
        this.userOpenId = tokenUser.getUserOpenId();
        this.supplierCode = tokenUser.getSupplierCode();
        this.dataSourceId = tokenUser.getDataSourceId();
        this.accessToken = token;
    }

    public int getLoginStatus() {
        return loginStatus;
    }

    public void setLoginStatus(int loginStatus) {
        this.loginStatus = loginStatus;
    }

    public String getLoginMsg() {
        return loginMsg;
    }

    public void setLoginMsg(String loginMsg) {
        this.loginMsg = loginMsg;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public long getDeptId() {
        return deptId;
    }

    public void setDeptId(long deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public long getSupplierCode() {
        return supplierCode;
    }

    public void setSupplierCode(long supplierCode) {
        this.supplierCode = supplierCode;
    }

    public String getDataSourceId() {
        return dataSourceId;
    }

    public void setDataSourceId(String dataSourceId) {
        this.dataSourceId = dataSourceId;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public String getUserOpenId() {
        return userOpenId;
    }

    public void setUserOpenId(String userOpenId) {
        this.userOpenId = userOpenId;
    }
}
