package com.liangjian.dataplatform.member.entity.vo;

import com.liangjian.dataplatform.member.entity.po.secondary.WeixinUserInfo;

import java.util.Date;
import java.util.List;

/**
 * @Author: 黄子奇
 * @Date: 2019/11/14
 */
public class WeixinUserInfoVo {
    private String id;
    private String secretPhone;
    private boolean subscribe;
    private String openid;
    private String nickname;
    private Integer sex;
    private String language;
    private String city;
    private String province;
    private String country;
    private String headimgurl;
    private Date subscribeTime;
    private String remark;
    private Integer groupid;
    private List<Integer> tagidList;
    private String subscribeScene;
    private Integer qrScene;
    private String qrSceneStr;
    private String unionid;

    public static WeixinUserInfoVo fromPo(WeixinUserInfo po) {
        WeixinUserInfoVo vo = new WeixinUserInfoVo();
        vo.id = po.getId();
        vo.secretPhone = po.getSecretPhone();
        vo.subscribe = po.getSubscribe().equals(1);
        vo.openid = po.getOpenid();
        vo.nickname = po.getNickname();
        vo.sex = po.getSex();
        vo.language = po.getLanguage();
        vo.city = po.getCity();
        vo.province = po.getProvince();
        vo.country = po.getCountry();
        vo.headimgurl = po.getHeadimgurl();
        vo.subscribeTime = new Date(po.getSubscribeTime()*1000L);
        vo.remark = po.getRemark();
        vo.groupid = po.getGroupid();
        //TODO taglist暂时没有数据，先不赋值
        vo.subscribeScene = po.getSubscribeScene();
        vo.qrScene = po.getQrScene();
        vo.qrSceneStr = po.getQrSceneStr();
        vo.unionid = po.getUnionid();
        return vo;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSecretPhone() {
        return secretPhone;
    }

    public void setSecretPhone(String secretPhone) {
        this.secretPhone = secretPhone;
    }

    public boolean isSubscribe() {
        return subscribe;
    }

    public void setSubscribe(boolean subscribe) {
        this.subscribe = subscribe;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getHeadimgurl() {
        return headimgurl;
    }

    public void setHeadimgurl(String headimgurl) {
        this.headimgurl = headimgurl;
    }

    public Date getSubscribeTime() {
        return subscribeTime;
    }

    public void setSubscribeTime(Date subscribeTime) {
        this.subscribeTime = subscribeTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getGroupid() {
        return groupid;
    }

    public void setGroupid(Integer groupid) {
        this.groupid = groupid;
    }

    public List<Integer> getTagidList() {
        return tagidList;
    }

    public void setTagidList(List<Integer> tagidList) {
        this.tagidList = tagidList;
    }

    public String getSubscribeScene() {
        return subscribeScene;
    }

    public void setSubscribeScene(String subscribeScene) {
        this.subscribeScene = subscribeScene;
    }

    public Integer getQrScene() {
        return qrScene;
    }

    public void setQrScene(Integer qrScene) {
        this.qrScene = qrScene;
    }

    public String getQrSceneStr() {
        return qrSceneStr;
    }

    public void setQrSceneStr(String qrSceneStr) {
        this.qrSceneStr = qrSceneStr;
    }

    public String getUnionid() {
        return unionid;
    }

    public void setUnionid(String unionid) {
        this.unionid = unionid;
    }
}
