Authored by mlge

鉴定结果查询--缓存修改

... ... @@ -230,7 +230,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
}
result = productChainMapper.selectByTagId(tagId);
if(result != null){
clientCache.set(kb.getKey(), 10 * 60 , result );//10分钟
clientCache.setEx(kb, result,10 * 60 );//10分钟
}
logger.info("queryTransactionIdByTagId from db success! tagId={},result={}", tagId,result);
return result;
... ... @@ -288,7 +288,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
result = identifyRelationMapper.selectByauthUid(authUid);
if(result != null){
clientCache.set(kb.getKey(), 2 * 60 * 60, result );//两小时
clientCache.setEx(kb, result, 2 * 60 * 60 );//两小时
}
return result;
}
... ... @@ -304,7 +304,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
}
result = identifyRecordsMapper.selectByTagAndNfcId(tagId, nfcUid);
if(result != null){
clientCache.set(kb.getKey(), 5 * 60, result );
clientCache.setEx(kb, result, 5 * 60 );
}
return result;
}
... ... @@ -319,13 +319,13 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
RedisKeyBuilder kb = new RedisKeyBuilder().appendFixed("ufo:product:identifyResultInfo:").
appendVar(tagId).appendVar(":").appendVar(nfcUid);
clientCache.set(kb.getKey(), 5 * 60, result );
clientCache.setEx(kb, result,5 * 60 );
}
private ProductIdentifyResp getIdentifyFromCache(String tagId, String nfcUid) {
RedisKeyBuilder kb = new RedisKeyBuilder().appendFixed("ufo:product:identifyResultInfo:").
appendVar(tagId).appendVar(":").appendVar(nfcUid);
ProductIdentifyResp identifyResp = clientCache.get(kb.getKey(), ProductIdentifyResp.class);
ProductIdentifyResp identifyResp = clientCache.get(kb, ProductIdentifyResp.class);
return identifyResp;
}
... ...