登录
首页 » Java » APO缓存接口数据

APO缓存接口数据

于 2023-01-10 发布 文件大小:5.17 kB
0 98
下载积分: 2 下载次数: 1

代码说明:

//设置缓存 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; }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • A316246694049_2732800
    A MATLAB-based three-dimensional viewer
    2008-04-29 00:42:32下载
    积分:1
  • 1
    jQuery表格增加删除行响应式代码基于jquery.1.11.3.min.js制作,表格增加、删除功能。(JQuery table add-delete line response code based on jquery.1.11.3.min.js production, table add-delete function.)
    2019-01-09 21:15:06下载
    积分:1
  • 基于springboot和vue 前后端分离后台管理系统
    【实例简介】 * 前端采用Vue、Element UI。 * 后端采用Spring Boot、Spring Security、Redis & Jwt。 * 权限认证使用Jwt,支持多终端认证系统。 * 支持加载动态权限菜单,多方式轻松权限控制。 * 高效率开发,使用代码生成器可以一键生成前后端代码。
    2021-08-16 00:30:59下载
    积分:1
  • BPlusTree
    基于JAVA的B+树数据结构,B+树是改进的平衡二叉树,查询效率更高。(JAVA-based B+-tree data structure, B+ tree is an improved balanced binary tree, the query more efficient.)
    2011-11-10 10:48:34下载
    积分:1
  • tankwar999
    用jwt GUI进行编写的一个小游戏,然后是java的多线程进行控制的(this is a small project to play of the name is TankWar)
    2020-06-16 05:40:01下载
    积分:1
  • Android文件上传例子 含服务器端源码
    Android文件上传 源码
    2013-06-28下载
    积分:1
  • SelectionModelDemo
    说明:  表格选择模式,当用户对表格做数据域位的选取时会产生ListSelectionListener事件(Table selection mode, when users place on the table to do the selection of data fields will produce ListSelectionListener events)
    2010-04-07 10:44:39下载
    积分:1
  • preprocessing-master
    image processing otus single level
    2016-11-04 20:41:22下载
    积分:1
  • log4j-pig-master
    说明:  基于Spring Boot 2.4、 Spring Cloud 2020 & Alibaba、 OAuth2 的微服务RBAC 权限管理系统。 记得上边点个star 关注更新(The micro service RBAC privilege management system based on spring boot 2.4, spring cloud 2020 & Alibaba, oauth2. Remember to click a star above to follow the update)
    2021-04-12 22:28:26下载
    积分:1
  • 宿舍管理系统
    基于java+jsp+mysql的宿舍管理系统,有宿舍管理模块,学生管理模块,能实现对宿舍的增删改查
    2022-01-26 19:14:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载