com.github.shawven.security.connect.provider.qq.connet.QQAdapter Maven / Gradle / Ivy
package com.github.shawven.security.connect.provider.qq.connet;
import com.github.shawven.security.connect.provider.qq.api.QQ;
import com.github.shawven.security.connect.provider.qq.api.QQUserInfo;
import org.springframework.social.connect.ApiAdapter;
import org.springframework.social.connect.ConnectionValues;
import org.springframework.social.connect.UserProfile;
public class QQAdapter implements ApiAdapter {
@Override
public boolean test(QQ api) {
return true;
}
@Override
public void setConnectionValues(QQ api, ConnectionValues values) {
QQUserInfo userInfo = api.getUserInfo();
values.setDisplayName(userInfo.getNickname());
values.setImageUrl(userInfo.getFigureurl_qq_1());
values.setProfileUrl(null);
values.setProviderUserId(userInfo.getOpenId());
}
@Override
public UserProfile fetchUserProfile(QQ api) {
// TODO Auto-generated method stub
return null;
}
@Override
public void updateStatus(QQ api, String message) {
//do noting
}
}