Java Code Examples for org.springframework.social.connect.ConnectionValues#setProfileUrl()

The following examples show how to use org.springframework.social.connect.ConnectionValues#setProfileUrl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QQAdapter.java    From cola with MIT License 5 votes vote down vote up
@Override
public void setConnectionValues(QQ api, ConnectionValues values) {
	QQUserInfo userInfo = api.getUserInfo();

	//openid 唯一标识
	values.setProviderUserId(userInfo.getOpenId());
	values.setDisplayName(userInfo.getNickname());
	values.setImageUrl(userInfo.getFigureurl_2());
	values.setProfileUrl(null);
}
 
Example 2
Source File: GitHubAdapter.java    From pre with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setConnectionValues(GitHub api, ConnectionValues values) {
    GitHubUserInfo userInfo = api.getUserInfo();
    values.setProviderUserId(String.valueOf(userInfo.getId()));
    values.setDisplayName(userInfo.getUsername());
    values.setProfileUrl("https://github.com/" + userInfo.getId());
    values.setImageUrl(userInfo.getAvatarUrl());
}
 
Example 3
Source File: GiteeAdapter.java    From pre with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setConnectionValues(Gitee api, ConnectionValues values) {
    GiteeUserInfo userInfo = api.getUserInfo();
    values.setProviderUserId(String.valueOf(userInfo.getId()));
    values.setDisplayName(userInfo.getName());
    values.setProfileUrl(userInfo.getHtmlUrl());
    values.setImageUrl(userInfo.getAvatarUrl());
}
 
Example 4
Source File: QQAdapter.java    From pre with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 将服务提供商个性化的用户信息映射到ConnectionValues标准的数据化结构上
 * @param qq
 * @param connectionValues
 */
@Override
public void setConnectionValues(QQ qq, ConnectionValues connectionValues) {
    QQUserInfo userInfo = qq.getUserInfo();
    //显示的用户名称
    connectionValues.setDisplayName(userInfo.getNickname());
    //用户的头像
    connectionValues.setImageUrl(userInfo.getFigureurl_qq_1());
    //个人主页
    connectionValues.setProfileUrl(null);
    //QQ的唯一标识
    connectionValues.setProviderUserId(userInfo.getOpenId());
}
 
Example 5
Source File: QQAdapter.java    From paascloud-master with Apache License 2.0 5 votes vote down vote up
/**
 * Sets connection values.
 *
 * @param api    the api
 * @param values the values
 */
@Override
public void setConnectionValues(QQ api, ConnectionValues values) {
	QQUserInfo userInfo = api.getUserInfo();

	values.setDisplayName(userInfo.getNickname());
	values.setImageUrl(userInfo.getFigureUrlQq1());
	values.setProfileUrl(null);
	values.setProviderUserId(userInfo.getOpenId());
}
 
Example 6
Source File: QQAdapter.java    From FEBS-Security with Apache License 2.0 5 votes vote down vote up
@Override
public void setConnectionValues(QQ api, ConnectionValues values) {
    QQUserInfo qqUserInfo = api.getUserInfo();
    values.setDisplayName(qqUserInfo.getNickname());
    values.setImageUrl(qqUserInfo.getFigureurl_qq_2());
    values.setProfileUrl(null);
    values.setProviderUserId(qqUserInfo.getOpenId());
}
 
Example 7
Source File: GooglePlusAdapter.java    From google-plus-java-api with Apache License 2.0 5 votes vote down vote up
public void setConnectionValues(Plus api, ConnectionValues values) {
    Person person = api.getPeopleOperations().get("me");
    values.setProviderUserId(person.getId());
    values.setDisplayName(person.getName().getFormatted());
    values.setProfileUrl(person.getUrl());
    values.setImageUrl(person.getImage().getUrl());
}