package cn.pluss.platform.wap;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @author yuchen
 * 
 * @Description 
 */
public class WechantInfoVO {
	
	private String nickName;
	
	private String sex;
	
	private String province;
	
	private String city;
	
	private String country;
	
	private String  headimgurl;

	private String unionId;

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getSex() {
		return sex;
	}

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

	public String getProvince() {
		return province;
	}

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

	public String getCity() {
		return city;
	}

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

	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 String getUnionId() {
		return unionId;
	}

	public void setUnionId(String unionId) {
		this.unionId = unionId;
	}

	public static WechantInfoVO convert(String userInfo) {
		WechantInfoVO vo=new WechantInfoVO();
		JSONObject jsonObject = JSON.parseObject(userInfo);
        String headimgurl = jsonObject.getString("headimgurl");
        String province = jsonObject.getString("province");
        String city = jsonObject.getString("city");
        String country = jsonObject.getString("country");
        String sex = jsonObject.getString("sex");
        String nickname = jsonObject.getString("nickname");
		String unionid = jsonObject.getString("unionid");
        vo.setHeadimgurl(headimgurl);
        vo.setProvince(province);
        vo.setCity(city);
        vo.setCountry(country);
        vo.setSex(sex);
        vo.setNickName(nickname);
        vo.setUnionId(unionid);
		return vo;
		
	}
	
	

}

