package ink.wgink.pojo.dtos.role;

import ink.wgink.pojo.dtos.user.UserDTO;
import io.swagger.annotations.ApiModel;

import java.io.Serializable;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: RoleUserDTO
 * @Description: 角色用户
 * @Author: WangGeng
 * @Date: 2021/2/18 11:31
 * @Version: 1.0
 **/
@ApiModel
public class RoleUserDTO implements Serializable {

    private static final long serialVersionUID = -1587518239154577015L;
    private String userId;
    private String roleId;
    private String userUsername;
    private String userName;
    private String userPhone;
    private String userEmail;
    private String roleName;
    private Integer userType;
    private Integer userState;
    private String userAvatar;

    public RoleUserDTO() {

    }

    public RoleUserDTO(UserDTO userDTO) {
        this.userId = userDTO.getUserId();
        this.userUsername = userDTO.getUserUsername();
        this.userName = userDTO.getUserName();
        this.userPhone = userDTO.getUserPhone();
        this.userEmail = userDTO.getUserEmail();
        this.userType = userDTO.getUserType();
        this.userState = userDTO.getUserState();
        this.userAvatar = userDTO.getUserAvatar();
    }

    public String getUserId() {
        return userId == null ? "" : userId.trim();
    }

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

    public String getRoleId() {
        return roleId == null ? "" : roleId.trim();
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getUserUsername() {
        return userUsername == null ? "" : userUsername.trim();
    }

    public void setUserUsername(String userUsername) {
        this.userUsername = userUsername;
    }

    public String getUserName() {
        return userName == null ? "" : userName.trim();
    }

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

    public String getUserPhone() {
        return userPhone == null ? "" : userPhone.trim();
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserEmail() {
        return userEmail == null ? "" : userEmail.trim();
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    public String getRoleName() {
        return roleName == null ? "" : roleName.trim();
    }

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

    public Integer getUserType() {
        return userType;
    }

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

    public Integer getUserState() {
        return userState;
    }

    public void setUserState(Integer userState) {
        this.userState = userState;
    }

    public String getUserAvatar() {
        return userAvatar == null ? "" : userAvatar.trim();
    }

    public void setUserAvatar(String userAvatar) {
        this.userAvatar = userAvatar;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"userId\":\"")
                .append(userId).append('\"');
        sb.append(",\"groupId\":\"")
                .append(roleId).append('\"');
        sb.append(",\"userUsername\":\"")
                .append(userUsername).append('\"');
        sb.append(",\"userName\":\"")
                .append(userName).append('\"');
        sb.append(",\"userPhone\":\"")
                .append(userPhone).append('\"');
        sb.append(",\"userEmail\":\"")
                .append(userEmail).append('\"');
        sb.append(",\"groupName\":\"")
                .append(roleName).append('\"');
        sb.append(",\"userType\":")
                .append(userType);
        sb.append(",\"userState\":")
                .append(userState);
        sb.append(",\"userAvatar\":\"")
                .append(userAvatar).append('\"');
        sb.append('}');
        return sb.toString();
    }
}
