我正在尝试将我的应用程序与 facebook 连接起来。我从
http://spring.io/guides/gs/accessing-facebook/
添加了所有声明的依赖项,但错误似乎没有消失。附上截图下方给出的代码。谁能建议可能是什么问题。
错误是无法解决@EnableInMemoryConnectionRepository。无法解析 UserIdSource。
package controllers;
import org.springframework.context.annotation.Bean;
import org.springframework.social.connect.ConnectionFactoryLocator;
import org.springframework.social.connect.ConnectionRepository;
import org.springframework.social.connect.web.ConnectController;
import org.springframework.social.facebook.config.annotation.EnableFacebook;
@EnableFacebook(appId="someAppId", appSecret="shhhhhh!!!")
@EnableInMemoryConnectionRepository
public class FacebookConfig {
@Bean
public ConnectController connectController(ConnectionFactoryLocator connectionFactoryLocator, ConnectionRepository connectionRepository) {
return new ConnectController(connectionFactoryLocator, connectionRepository);
}
@Bean
public UserIdSource userIdSource() {
return new UserIdSource() {
@Override
public String getUserId() {
return "testuser";
}
};
}
}