package ink.wgink.pojo.dtos.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @author WangGeng
 */
@ApiModel
public class UserDTO implements Serializable {

    private static final long serialVersionUID = -4381097524161926625L;
    @ApiModelProperty(name = "userId", value = "用户ID")
    private String userId;
    @ApiModelProperty(name = "userUsername", value = "用户名")
    private String userUsername;
    @ApiModelProperty(name = "userName", value = "用户昵称")
    private String userName;
    @ApiModelProperty(name = "userPhone", value = "用户电话")
    private String userPhone;
    @ApiModelProperty(name = "userEmail", value = "用户邮件")
    private String userEmail;
    @ApiModelProperty(name = "userUKey", value = "UKey")
    private String userUKey;
    @ApiModelProperty(name = "userType", value = "用户类型，1：系统用户，2：普通用户")
    private Integer userType;
    @ApiModelProperty(name = "userState", value = "用户状态，0：正常，1：冻结")
    private Integer userState;
    @ApiModelProperty(name = "userExpiredDate", value = "超时时间，空表示永不超时")
    private String userExpiredDate;
    @ApiModelProperty(name = "userAvatar", value = "用户头像ID")
    private String userAvatar;
    @ApiModelProperty(name = "lastLoginAddress", value = "最后登录IP")
    private String lastLoginAddress;
    @ApiModelProperty(name = "lastLoginTime", value = "最后登录时间")
    private String lastLoginTime;
    @ApiModelProperty(name = "userLongitude", value = "用户经度")
    private String userLongitude;
    @ApiModelProperty(name = "userLatitude", value = "用户纬度")
    private String userLatitude;
    @ApiModelProperty(name = "departmentIds", value = "组织部门ID")
    private String departmentIds;
    @ApiModelProperty(name = "departmentNames", value = "组织部门名称")
    private String departmentNames;
    @ApiModelProperty(name = "roleIds", value = "角色ID")
    private String roleIds;
    @ApiModelProperty(name = "roleNames", value = "角色名称")
    private String roleNames;
    @ApiModelProperty(name = "positionIds", value = "职位ID")
    private String positionIds;
    @ApiModelProperty(name = "positionNames", value = "职位名称")
    private String positionNames;
    @ApiModelProperty(name = "loginType", value = "登录类型")
    private Integer loginType;
    @ApiModelProperty(name = "gmtCreate", value = "创建时间")
    private String gmtCreate;

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

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

    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 getUserUKey() {
        return userUKey == null ? "" : userUKey;
    }

    public void setUserUKey(String userUKey) {
        this.userUKey = userUKey;
    }

    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 getUserExpiredDate() {
        return userExpiredDate == null ? "" : userExpiredDate;
    }

    public void setUserExpiredDate(String userExpiredDate) {
        this.userExpiredDate = userExpiredDate;
    }

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

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

    public String getLastLoginAddress() {
        return lastLoginAddress == null ? "" : lastLoginAddress.trim();
    }

    public void setLastLoginAddress(String lastLoginAddress) {
        this.lastLoginAddress = lastLoginAddress;
    }

    public String getLastLoginTime() {
        return lastLoginTime == null ? "" : lastLoginTime.trim();
    }

    public void setLastLoginTime(String lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getUserLongitude() {
        return userLongitude == null ? "" : userLongitude.trim();
    }

    public void setUserLongitude(String userLongitude) {
        this.userLongitude = userLongitude;
    }

    public String getUserLatitude() {
        return userLatitude == null ? "" : userLatitude.trim();
    }

    public void setUserLatitude(String userLatitude) {
        this.userLatitude = userLatitude;
    }

    public String getDepartmentIds() {
        return departmentIds == null ? "" : departmentIds.trim();
    }

    public void setDepartmentIds(String departmentIds) {
        this.departmentIds = departmentIds;
    }

    public String getDepartmentNames() {
        return departmentNames == null ? "" : departmentNames.trim();
    }

    public void setDepartmentNames(String departmentNames) {
        this.departmentNames = departmentNames;
    }

    public String getRoleIds() {
        return roleIds == null ? "" : roleIds.trim();
    }

    public void setRoleIds(String roleIds) {
        this.roleIds = roleIds;
    }

    public String getRoleNames() {
        return roleNames == null ? "" : roleNames.trim();
    }

    public void setRoleNames(String roleNames) {
        this.roleNames = roleNames;
    }

    public String getPositionIds() {
        return positionIds == null ? "" : positionIds.trim();
    }

    public void setPositionIds(String positionIds) {
        this.positionIds = positionIds;
    }

    public String getPositionNames() {
        return positionNames == null ? "" : positionNames.trim();
    }

    public void setPositionNames(String positionNames) {
        this.positionNames = positionNames;
    }

    public Integer getLoginType() {
        return loginType;
    }

    public void setLoginType(Integer loginType) {
        this.loginType = loginType;
    }

    public String getGmtCreate() {
        return gmtCreate == null ? "" : gmtCreate.trim();
    }

    public void setGmtCreate(String gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    protected void setUserDTO(UserDTO userDTO) {
        this.userId = userDTO.getUserId();
        this.userUsername = userDTO.getUserUsername();
        this.userName = userDTO.getUserName();
        this.userPhone = userDTO.getUserPhone();
        this.userEmail = userDTO.getUserEmail();
        this.userUKey = userDTO.getUserUKey();
        this.userType = userDTO.getUserType();
        this.userState = userDTO.getUserState();
        this.userExpiredDate = userDTO.getUserExpiredDate();
        this.userAvatar = userDTO.getUserAvatar();
        this.lastLoginAddress = userDTO.getLastLoginAddress();
        this.lastLoginTime = userDTO.getLastLoginTime();
        this.userLongitude = userDTO.getUserLongitude();
        this.userLatitude = userDTO.getUserLatitude();
        this.departmentIds = userDTO.getDepartmentIds();
        this.departmentNames = userDTO.getDepartmentNames();
        this.roleIds = userDTO.getRoleIds();
        this.roleNames = userDTO.getRoleNames();
        this.positionIds = userDTO.getPositionIds();
        this.positionNames = userDTO.getPositionNames();
        this.loginType = userDTO.getLoginType();
        this.gmtCreate = userDTO.getGmtCreate();
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"userId\":\"")
                .append(userId).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(",\"userUKey\":\"")
                .append(userUKey).append('\"');
        sb.append(",\"userType\":")
                .append(userType);
        sb.append(",\"userState\":")
                .append(userState);
        sb.append(",\"userExpiredDate\":")
                .append(userExpiredDate);
        sb.append(",\"userAvatar\":\"")
                .append(userAvatar).append('\"');
        sb.append(",\"lastLoginAddress\":\"")
                .append(lastLoginAddress).append('\"');
        sb.append(",\"lastLoginTime\":\"")
                .append(lastLoginTime).append('\"');
        sb.append(",\"userLongitude\":\"")
                .append(userLongitude).append('\"');
        sb.append(",\"userLatitude\":\"")
                .append(userLatitude).append('\"');
        sb.append(",\"departmentIds\":\"")
                .append(departmentIds).append('\"');
        sb.append(",\"departmentNames\":\"")
                .append(departmentNames).append('\"');
        sb.append(",\"roleIds\":\"")
                .append(roleIds).append('\"');
        sb.append(",\"roleNames\":\"")
                .append(roleNames).append('\"');
        sb.append(",\"positionIds\":\"")
                .append(positionIds).append('\"');
        sb.append(",\"positionNames\":\"")
                .append(positionNames).append('\"');
        sb.append(",\"loginType\":")
                .append(loginType);
        sb.append(",\"gmtCreate\":\"")
                .append(gmtCreate).append('\"');
        sb.append('}');
        return sb.toString();
    }
}
