public void updateSocialUserAccountByThird( SocialUserAccount socialUserAccount, JSONObject userInfo) { String name = userInfo.getString("name"); String nick = userInfo.getString("nick"); String uid = userInfo.getString("openid"); String url = userInfo.getString("homepage"); socialUserAccount.setWeiboUid(uid); socialUserAccount.setName(name); socialUserAccount.setUrl(url); socialUserAccount.setUserScreenName(nick); socialUserAccount.setType(getSocialTypeInt()); socialUserAccountService.updateSocialUserAccount(socialUserAccount); }
public SocialUserAccount addSocialUserAccountByThird( org.activiti.engine.identity.User user, JSONObject userInfo) { String name = userInfo.getString("name"); String nick = userInfo.getString("nick"); String uid = userInfo.getString("openid"); String url = userInfo.getString("homepage"); SocialUserAccount socialUserAccount = new SocialUserAccount(); socialUserAccount.setWeiboUid(uid); socialUserAccount.setName(name); socialUserAccount.setUrl(url); socialUserAccount.setUserScreenName(nick); socialUserAccount.setType(getSocialTypeInt()); socialUserAccount.setOwnUser(user.getId()); socialUserAccountService.createSocialUserAccount(socialUserAccount); return socialUserAccount; }