当前位置: 首页 > news >正文

企业查询网站上海推广seo

企业查询网站,上海推广seo,浏阳网站开发建设,wordpress如何去掉分类里面的大字Spring-缓存 简单介绍 缓存是一种介于数据永久存储介质和数据应用之间的数据临时存储介质缓存有效提高读取速度#xff0c;加速查询效率 spring使用缓存方式 添加依赖 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring…Spring-缓存 简单介绍 缓存是一种介于数据永久存储介质和数据应用之间的数据临时存储介质缓存有效提高读取速度加速查询效率 spring使用缓存方式 添加依赖 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-cache/artifactId/dependency添加使用缓存的注解 package com.ustc;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cache.annotation.EnableCaching;SpringBootApplication EnableCaching public class Quick1Application {public static void main(String[] args) {SpringApplication.run(Quick1Application.class, args);}} 使用缓存将当前操作结果写入缓存 这里的cacheSpace 表示缓存控件然后可以从形参中读取id查询所需要的值 OverrideCacheable(value cacheSpace,key#id)public tbl_book getById(Integer id) {return bookMapper.selectById(id);// 调用Mapper查询} 手机验证码生成案例 使用CachePut注解 每次生成新的缓存 OverrideCachePut(value smsCode,key #tele)public String sendCodeToSMS(String tele) {// 当前方法的返回值 进入当前key所对应的缓存中String code codeUtils.generator(tele);return code;}校验验证码 Overridepublic boolean checkCode(SMSCode smsCode) {// 取出内存中的验证码 和传递过来的验证码进行比对 如果相同 返回trueString code smsCode.getCode();// 内存加载验证码String cacheCode codeUtils.get(smsCode.getTele());// 传递过来的验证码return cacheCode.equals(code);} 加密验证码 package com.ustc.controller.utils;import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component;Component public class CodeUtils {private String[] patch {00000,0000,000,00,0,};public String generator(String tele){int hash tele.hashCode();// 生成哈希值int encryption 20206666;// 第一次加密long result hash ^ encryption;long nowTime System.currentTimeMillis();result result ^ nowTime;long code result % 1000000;code code 0 ?-code :code;String codeStr code ;int len codeStr.length();// 计算长度return patch[len - 1] codeStr;}// 获取传递过来的验证码 从缓存中查询Cacheable(value smsCode,key #tele)public String get(String tele){return null;}public static void main(String[] args) {System.out.println(new CodeUtils().generator(15005650262));} }
http://www.yutouwan.com/news/287567/

相关文章:

  • 邵阳建网站asp网站如何运行
  • 网站怎么拿百度收入国内比较好的猎头公司
  • codewars网站2023年8月份新冠症状
  • 做环保网站案例百度游戏app下载
  • 建设企业银行网站多少钱电商美工的工作内容是什么
  • 在哪可以接企业网站建设的活微博推广价格表
  • 做网站主页效果图商丘网
  • 微商城手机网站设计网站开发人员资质
  • 单页网站的域名ps怎样做网站详情页
  • 深圳做网站排名公司哪家好购物网站开发文献综述
  • 触屏网站meta标签wordpress将首页转成html
  • 租用微信做拍卖网站wordpress修改404
  • 广州网站制作设计公司怎么做示爱的网站
  • 番禺网站建设方案山西有新冠病例吗
  • 冠县网站制作企业注册阿里账号网站建设
  • 西安seo网站推广优化七牛搭建网站
  • 做app网站有哪些功能wordpress自定义密码
  • 小型企业建站公司网站页面设计模板
  • 怎么帮公司做网站建设拍拍网站开发
  • 网络营销网站建设龙岗的网站建设
  • 深圳市网站制作公司百度搜索推广收费标准
  • 网站模板的制作怎么做如何免费创建app
  • 公司的网站建设计入什么科目WordPress写文章乱码
  • 杭州做网站公司有哪些中山软件开发
  • 如何自己建网站企业网站平台代运营是什么意思
  • 怎样在文章后做网站链接国内漂亮网站欣赏
  • 网站建设的想法和意见做网站语言知乎
  • 厦门市机场建设招投标网站济宁做网站的电话
  • 嘉兴的网站设计公司有哪些2023免费网站推广大全
  • 海外网站seo营销网站建设专业团队在线服务