Search in sources :

Example 1 with ApplicationClientCacheKeyBuilder

use of com.albedo.java.modules.sys.cache.ApplicationClientCacheKeyBuilder in project albedo by somowhere.

the class ApplicationServiceImpl method getByClient.

@Override
public ApplicationDo getByClient(String clientId, String clientSecret) {
    LbqWrapper<ApplicationDo> wrapper = Wraps.<ApplicationDo>lbQ().select(ApplicationDo::getId).eq(ApplicationDo::getClientId, clientId).eq(ApplicationDo::getClientSecret, clientSecret);
    Function<CacheKey, Object> loader = k -> super.getObj(wrapper, Convert::toLong);
    CacheKey cacheKey = new ApplicationClientCacheKeyBuilder().key(clientId, clientSecret);
    return getByKey(cacheKey, loader);
}
Also used : Wraps(com.albedo.java.plugins.database.mybatis.conditions.Wraps) ApplicationClientCacheKeyBuilder(com.albedo.java.modules.sys.cache.ApplicationClientCacheKeyBuilder) ApplicationDo(com.albedo.java.modules.sys.domain.ApplicationDo) LbqWrapper(com.albedo.java.plugins.database.mybatis.conditions.query.LbqWrapper) ApplicationDto(com.albedo.java.modules.sys.domain.dto.ApplicationDto) CacheKeyBuilder(com.albedo.java.common.core.cache.model.CacheKeyBuilder) Function(java.util.function.Function) ApplicationService(com.albedo.java.modules.sys.service.ApplicationService) ApplicationRepository(com.albedo.java.modules.sys.repository.ApplicationRepository) Service(org.springframework.stereotype.Service) AbstractDataCacheServiceImpl(com.albedo.java.plugins.database.mybatis.service.impl.AbstractDataCacheServiceImpl) Convert(cn.hutool.core.convert.Convert) CacheKey(com.albedo.java.common.core.cache.model.CacheKey) Convert(cn.hutool.core.convert.Convert) ApplicationDo(com.albedo.java.modules.sys.domain.ApplicationDo) ApplicationClientCacheKeyBuilder(com.albedo.java.modules.sys.cache.ApplicationClientCacheKeyBuilder) CacheKey(com.albedo.java.common.core.cache.model.CacheKey)

Aggregations

Convert (cn.hutool.core.convert.Convert)1 CacheKey (com.albedo.java.common.core.cache.model.CacheKey)1 CacheKeyBuilder (com.albedo.java.common.core.cache.model.CacheKeyBuilder)1 ApplicationClientCacheKeyBuilder (com.albedo.java.modules.sys.cache.ApplicationClientCacheKeyBuilder)1 ApplicationDo (com.albedo.java.modules.sys.domain.ApplicationDo)1 ApplicationDto (com.albedo.java.modules.sys.domain.dto.ApplicationDto)1 ApplicationRepository (com.albedo.java.modules.sys.repository.ApplicationRepository)1 ApplicationService (com.albedo.java.modules.sys.service.ApplicationService)1 Wraps (com.albedo.java.plugins.database.mybatis.conditions.Wraps)1 LbqWrapper (com.albedo.java.plugins.database.mybatis.conditions.query.LbqWrapper)1 AbstractDataCacheServiceImpl (com.albedo.java.plugins.database.mybatis.service.impl.AbstractDataCacheServiceImpl)1 Function (java.util.function.Function)1 Service (org.springframework.stereotype.Service)1