首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > APO缓存接口数据

APO缓存接口数据

  • 资源大小:5.17 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: Java 缓存 APO 接口 数据

资 源 简 介

//设置缓存 private void setCache(Long timeOut, TimeUnit timeUnit, String key, Object result) throws Exception { if (timeOut.equals(0L)) { stringRedisTemplate.opsForValue().set(key, JsonUtils.toJson(result)); } else { stringRedisTemplate.opsForValue().set(key, JsonUtils.toJson(result), timeOut, timeUnit); } } //查询缓存 private Object queryCache(long start, String methodName, String key) throws Exception { //缓存的接口返回结果必须是RSResponse Object result = JsonUtils.toBean(RSResponse.class, stringRedisTemplate.opsForValue().get(key)); long time = System.currentTimeMillis() - start; logger.info("REST API Method【Cache】:" + methodName + ",Time:" + time + "ms"); return result; }

文 件 列 表

Cache
.DS_Store
Cache.java
CacheAspect.java
RSResponse.java
VIP VIP
  • 睥睨 5小时前 成为了本站会员

  • ? 6小时前 成为了本站会员

  • IATWAY 1天前 成为了本站会员

  • 大智若愚 1天前 成为了本站会员

  • Mason 1天前 成为了本站会员

  • 1天前 成为了本站会员

  • Half_Punch 2天前 成为了本站会员

  • liqing71718 2天前 成为了本站会员

  • 伟国 2天前 成为了本站会员

  • songy 2天前 成为了本站会员

0.219065s