添加注释
This commit is contained in:
+3
@@ -12,6 +12,9 @@ import org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* 第三方登录的配置类
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSocial
|
||||
public class SocialConfig extends SocialConfigurerAdapter{
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
package com.micro.fast.security.core.social.qq.api;
|
||||
|
||||
/**
|
||||
* QQ用户信息的实体类
|
||||
* @author lsy
|
||||
*/
|
||||
public class QQUserInfo {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import org.springframework.social.oauth2.TokenStrategy;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 获取qq用户信息的实现类
|
||||
* 获取qq用户信息的实现类,qqApi用于组装QQServiceProvider
|
||||
* @author lsy
|
||||
*/
|
||||
public class QQImpl extends AbstractOAuth2ApiBinding implements QQ {
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@ import org.springframework.social.connect.ConnectionValues;
|
||||
import org.springframework.social.connect.UserProfile;
|
||||
|
||||
/**
|
||||
* QQ的ApiAdapter ,用于组装QQConnectionFactory
|
||||
* @author lsy
|
||||
*/
|
||||
public class QQAdapter implements ApiAdapter<QQ> {
|
||||
@@ -37,12 +38,12 @@ public class QQAdapter implements ApiAdapter<QQ> {
|
||||
connectionValues.setImageUrl(qqUserInfo.getFigureurl_qq_1());
|
||||
//设置用户的主页
|
||||
connectionValues.setProfileUrl(null);
|
||||
//服务商提供的用户的id
|
||||
//服务商提供的用户的openID
|
||||
connectionValues.setProviderUserId(qqUserInfo.getOpenId());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 用户的主页,QQ没有此功能
|
||||
* @param qq
|
||||
* @return
|
||||
*/
|
||||
|
||||
+4
@@ -3,6 +3,10 @@ package com.micro.fast.security.core.social.qq.connet;
|
||||
import com.micro.fast.security.core.social.qq.api.QQ;
|
||||
import org.springframework.social.connect.support.OAuth2ConnectionFactory;
|
||||
|
||||
/**
|
||||
* QQ授权连接工厂对象
|
||||
* @author lsy
|
||||
*/
|
||||
public class QQConnectionFactory extends OAuth2ConnectionFactory<QQ> {
|
||||
/**
|
||||
* 使用连接工厂创建连接
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider;
|
||||
import org.springframework.social.oauth2.OAuth2Template;
|
||||
|
||||
/**
|
||||
* 获取QQ用户信息服务的提供方
|
||||
* 获取QQ用户信息服务的提供方类,用于组装QQConnectionFactory
|
||||
* @author lsy
|
||||
*/
|
||||
public class QQServiceProvider extends AbstractOAuth2ServiceProvider<QQ> {
|
||||
|
||||
Reference in New Issue
Block a user