package com.uas.account.entity;

/**
 * 优软众创用户信息格式
 * 
 * @author hejq
 * @time 创建时间：2017年10月12日
 */
public class UuzcUserDeatil {

	private String uid;

	private String username;

	private String password;

	private String email;

	private String mobile;

	private String salt;

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public UserDetail covert() {
		UserDetail user = new UserDetail();
		user.setEmail(this.email);
		user.setMobile(this.mobile);
		user.setName(this.username);
		user.setUid(this.uid);
		user.setSalt(this.salt);
		return user;
	}

	public User covertUser() {
		User user = new User();
		user.setDialectUID(this.uid);
		user.setUid(this.mobile);
		user.setSecondUID(this.email);
		user.setName(this.username);
		user.setSalt(this.salt);
		if (this.uid != null) {
			user.setAppId("b2b");
		} else {
			user.setAppId("uuzc");
		}
		user.setPassword(this.password);
		return user;
	}

	@Override
	public String toString() {
		return "uid='" + uid + '\'' +
				", username='" + username + '\'' +
				", password='" + password + '\'' +
				", email='" + email + '\'' +
				", mobile='" + mobile + '\'' +
				", salt='" + salt + '\'' +
				'}';
	}
}
