package com.sifang.modules.sys.entity;

import com.sifang.modules.sys.common.entity.User;
import com.sifang.modules.sys.util.CrmUtils;

/**
 * @author hongzq
 */
public class Operator {
    private String userId;
    private String userName;
    private String userType;
    private String roleName;

    public static Operator of(String userId, String userName,String userType) {
        Operator operator = new Operator();
        operator.setUserId(userId);
        operator.setUserName(userName);
        operator.setUserType(userType);
        return operator;
    }

    public static Operator of(String userName) {
        Operator operator = new Operator();
        operator.setUserName(userName);
        return operator;
    }

    public static Operator of(String userId, String userName,String userType,String roleName) {
        Operator operator = new Operator();
        operator.setUserId(userId);
        operator.setUserName(userName);
        operator.setUserType(userType);
        operator.setRoleName(roleName);
        return operator;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public static Operator of(User user) {
        return of(user.getId(), CrmUtils.getUserXM(user), user.getUserType(),"");
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public String getUserId() {
        return userId;
    }

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

    public String getUserName() {
        return userName;
    }

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