mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-20 10:42:15 +08:00
优化缓存
This commit is contained in:
@@ -101,9 +101,9 @@ public class SimpleAccessTokenService implements AccessTokenService {
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.NOT_SUPPORTED)
|
||||
@Caching(put = {
|
||||
@CachePut(cacheNames = "oauth2-access-token", key = "'refresh:'+#token.refreshToken"),
|
||||
@CachePut(cacheNames = "oauth2-access-token", key = "'token:'+#token.accessToken"),
|
||||
@CachePut(cacheNames = "oauth2-access-token", key = "'cgo'+#token.clientId+#token.grantType+#token.ownerId")
|
||||
@CachePut(cacheNames = "oauth2-access-token", key = "'refresh:'+#result.refreshToken"),
|
||||
@CachePut(cacheNames = "oauth2-access-token", key = "'token:'+#result.accessToken"),
|
||||
@CachePut(cacheNames = "oauth2-access-token", key = "'cgo'+#result.clientId+#result.grantType+#result.ownerId")
|
||||
})
|
||||
public OAuth2AccessToken saveOrUpdateToken(OAuth2AccessToken token) {
|
||||
Assert.notNull(token, "token can not be null!");
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SimpleClientConfigRepository implements OAuth2ClientConfigRepositor
|
||||
}
|
||||
|
||||
@Override
|
||||
@Cacheable(key = "'ownerId:'+#id")
|
||||
@Cacheable(key = "'ownerId:'+#ownerId")
|
||||
public OAuth2Client getClientByOwnerId(String ownerId) {
|
||||
return DefaultDSLQueryService.createQuery(oAuth2ClientDao).where("ownerId", ownerId).single();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user