package ink.wgink.pojo.dtos.group;

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

import java.io.Serializable;

/**
 * @ClassName: GroupUserDTO
 * @Description: 组用户
 * @Author: wenc
 * @Date: 2019/1/12 8:35 PM
 * @Version: 1.0
 **/
@ApiModel
public class GroupUserDTO implements Serializable {

    private static final long serialVersionUID = -7816367859713543194L;
    private String userId;
    private String groupId;
    private String userUsername;
    private String userName;
    private String userPhone;
    private String userEmail;
    private String groupName;
    private Integer userType;
    private Integer userState;
    private String userAvatar;

    public GroupUserDTO() {

    }

    public GroupUserDTO(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 getGroupId() {
        return groupId == null ? "" : groupId.trim();
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    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 getGroupName() {
        return groupName == null ? "" : groupName.trim();
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    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("\"").append(userId).append("\"");
        sb.append(",\"groupId\":")
                .append("\"").append(groupId).append("\"");
        sb.append(",\"userUsername\":")
                .append("\"").append(userUsername).append("\"");
        sb.append(",\"userName\":")
                .append("\"").append(userName).append("\"");
        sb.append(",\"userPhone\":")
                .append("\"").append(userPhone).append("\"");
        sb.append(",\"userEmail\":")
                .append("\"").append(userEmail).append("\"");
        sb.append(",\"groupName\":")
                .append("\"").append(groupName).append("\"");
        sb.append(",\"userType\":")
                .append(userType);
        sb.append(",\"userState\":")
                .append(userState);
        sb.append(",\"userAvatar\":")
                .append("\"").append(userAvatar).append("\"");
        sb.append('}');
        return sb.toString();
    }
}
