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

APO缓存接口数据

于 2023-01-10 发布 文件大小:5.17 kB
0 59
下载积分: 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 个回复

  • 网上在线留言代码 ,在线订购 含有验证码
    网上在线留言代码 ,在线订购 含有验证码-Online message code, a verification code online ordering
    2022-07-19 16:34:38下载
    积分:1
  • javaformat
    编程规范 包括理论部分和实践部分,理论部分介绍软件开发公司的编程规范,实践部分将自己开发的程序使用编程规范规范化。 (Normative part of programming, including theory and practice of the theoretical part of programming software development company norms, the practice will use its own procedures for the development of standardized programming norms.)
    2009-04-08 09:31:23下载
    积分:1
  • 引导页和日历及GridView的拖动、仿qq侧滑菜单
    模仿微信引导页,日历查看,GridView的拖动
    2015-06-12下载
    积分:1
  • java examples of procedures related to the production database interface is to l...
    java 程序实例 涉及到界面制作 数据库 是学习java很好的实例-java examples of procedures related to the production database interface is to learn from the examples of good java
    2022-09-13 18:45:03下载
    积分:1
  • H
    说明:  全速率语音突发的的发送端总程序,其中包括预编码,卷积编码,交织,调制等步骤的matlab程序,内付详细说明文档(Matlab program, which pay full rate speech sudden sender program, including pre-coding, convolutional coding, interleaving, modulation step detailed documentation)
    2013-04-10 20:13:42下载
    积分:1
  • javaMyeclipse
    学生选课系统,用的java写的,之前做的项目,也有不足的地方希望大家不要介意(Student elective system, with the java to write, before doing the project, there are insufficient places hope that we do not mind)
    2017-04-10 14:02:17下载
    积分:1
  • java简单的泥
    Java实现简易Mud-Java Simple Mud
    2022-03-05 20:53:15下载
    积分:1
  • java局域网版的中国象棋
    本项目包括客户端和服务器端,客户端可以通过ip地址链接到服务器端,从而实现两个客户端的象棋对战!
    2023-07-09 07:45:03下载
    积分:1
  • swfupload实例
    SWFUpload1 SWF多文件无刷新上传,利用flash完成多文件上传操作。服务器端可以用Struts、Servlet、JSP完成,这里用Struts1.x完成上传 1、 首先看下目录结构 SWFUpload 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
    2022-02-05 08:03:05下载
    积分:1
  • iostream
    输入输出流 综合应用实例 可是自学者更轻松的理解 输入输出流的知识(Input and output streams integrated application自学者but easier to understand input and output flow of knowledge)
    2008-06-22 19:46:34下载
    积分:1
  • 696518资源总数
  • 105901会员总数
  • 40今日下载