public interface UsersConnectionRepository
| 限定符和类型 | 方法和说明 |
|---|---|
ConnectionData |
addConnection(ConnectionData connection)
绑定.
|
org.springframework.util.MultiValueMap<String,ConnectionData> |
findAllConnections(String userId)
获取 userId 的所有绑定信息.
|
List<ConnectionData> |
findAllListConnections(String userId)
根据 userId 获取 ConnectionData list.
|
List<ConnectionData> |
findConnectionByProviderIdAndProviderUserId(String providerId,
String providerUserId)
根据 providerId 与 providerUserId 获取 ConnectionData list.
|
ConnectionData |
findConnectionByTokenId(Long tokenId)
根据 tokenId 查找
ConnectionData注意: 这里不做 spring cache 缓存处理, 这个接口主要用于 refreshToken 的定时任务, 只调用一次, 缓存无意义 |
List<ConnectionData> |
findConnections(String userId,
String providerId)
获取 userId 和 providerId 的所以绑定信息.
|
List<ConnectionData> |
findConnectionsToUsers(org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameters,
String providerUsersCriteriaSql,
String userId)
根据 userId 通过指定 providerUsersCriteriaSql 与 parameters 的 sql 获取 ConnectionData list
|
org.springframework.util.MultiValueMap<String,ConnectionData> |
findConnectionsToUsers(String userId,
org.springframework.util.MultiValueMap<String,String> providerUserIds)
获取 userId 和 providerUserIds 的所以绑定信息.
|
ConnectionData |
findPrimaryConnection(String userId,
String providerId)
根据 userId 与 providerId 获取 ConnectionData.
|
Set<String> |
findUserIdsConnectedTo(String providerId,
Set<String> providerUserIds)
Find the ids of the users who are connected to the specific provider user accounts.
|
ConnectionData |
getConnection(String userId,
ConnectionKey connectionKey)
根据 userId 和 connectionKey 获取 ConnectionData.
|
ConnectionData |
getPrimaryConnection(String userId,
String providerId)
获取 userId 和 providerId 的所以 rank 值最小的绑定信息.
|
void |
removeConnection(String userId,
ConnectionKey connectionKey)
解除绑定.
|
void |
removeConnections(String userId,
String providerId)
解除绑定.
|
ConnectionData |
updateConnection(ConnectionData connection)
Update a Connection already added to this repository.
|
ConnectionData |
updateConnectionByTokenId(AuthTokenPo token)
根据
AuthTokenPo#getId() 更新 ConnectionData. |
List<ConnectionData> findConnectionByProviderIdAndProviderUserId(String providerId, String providerUserId)
providerId - 第三方服务商, 如: qq, githubproviderUserId - 第三方用户 IdSet<String> findUserIdsConnectedTo(String providerId, Set<String> providerUserIds)
providerId - 第三方服务商, 如: qq, githubproviderUserIds - the set of provider user ids e.g. ("987665", "435796", "584444").org.springframework.util.MultiValueMap<String,ConnectionData> findAllConnections(String userId)
ConnectionDatas that exist between the user and that provider.
For example, if the user is connected once to Facebook and twice to Twitter, the returned map would contain two entries with the following structure:
{
"qq" -> Connection("Jack") ,
"github" -> Connection("Tomas"), Connection("Jessica")
}
The returned map is sorted by providerId and entry values are ordered by rank.
Returns an empty map if the user has no connections.userId - the userIdList<ConnectionData> findConnections(String userId, String providerId)
userId - 本地账户用户 IdproviderId - the provider id e.g. "qq"org.springframework.util.MultiValueMap<String,ConnectionData> findConnectionsToUsers(String userId, org.springframework.util.MultiValueMap<String,String> providerUserIds)
userId - 本地账户用户 IdproviderUserIds - 第三方用户 IdConnectionData getPrimaryConnection(String userId, String providerId) throws NotConnectedException
userId - 本地账户用户 IdproviderId - the provider id e.g. "qq"NotConnectedException - if the user is not connected to the provider of the APIConnectionData addConnection(ConnectionData connection)
connection - the new connection to add to this repositoryDuplicateConnectionException - if the user already has this connectionConnectionData updateConnection(ConnectionData connection)
connection - the existing connection to update in this repositoryvoid removeConnections(String userId, String providerId)
userId - 本地账户用户 IdproviderId - the provider id e.g. "qq"void removeConnection(String userId, ConnectionKey connectionKey)
userId - 本地账户用户 IdconnectionKey - the connection keyConnectionData findPrimaryConnection(String userId, String providerId)
userId - 本地账户用户 IdproviderId - the provider id e.g. "qq"ConnectionData getConnection(String userId, ConnectionKey connectionKey) throws NoSuchConnectionException
userId - 本地账户用户 IdconnectionKey - connectionKeyNoSuchConnectionException - no such connection exceptionList<ConnectionData> findAllListConnections(String userId)
userId - 本地账户用户 IdList<ConnectionData> findConnectionsToUsers(org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameters, String providerUsersCriteriaSql, String userId)
parameters - sql 的 where 条件 与 对应参数providerUsersCriteriaSql - providerUsersCriteriaSqluserId - 本地账户用户 IdConnectionData updateConnectionByTokenId(AuthTokenPo token)
AuthTokenPo#getId() 更新 ConnectionData.token - AuthTokenPoConnectionData, 还可以顺便更新 spring cacheConnectionData findConnectionByTokenId(Long tokenId)
ConnectionDatatokenId - AuthTokenPo#getId()Copyright © 2021. All rights reserved.