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

无极网站建设企业官网网站模板下载

无极网站建设,企业官网网站模板下载,建设项目信息类网站,大型网站建设兴田德润简介天行健#xff0c;君子以自强不息#xff1b;地势坤#xff0c;君子以厚德载物。 每个人都有惰性#xff0c;但不断学习是好好生活的根本#xff0c;共勉#xff01; 文章均为学习整理笔记#xff0c;分享记录为主#xff0c;如有错误请指正#xff0c;共同学习进步。… 天行健君子以自强不息地势坤君子以厚德载物。 每个人都有惰性但不断学习是好好生活的根本共勉 文章均为学习整理笔记分享记录为主如有错误请指正共同学习进步。 Redis配置类 Redis配置类1Redis配置类2 在使用redis时会用到RedisTemplate工具需要配置配置类以此来连接工厂、序列化存入的键值。 这里配置了两个不同的配置类内容大致形同细节略有不同可挑选使用。 Redis配置类1 具备序列化、工厂连接、键值字符串序列化、hash键值字符串序列化 package com.data.config;import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.RedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer;/*** ClassDescription:* Author李白* Date2023/7/25 14:44*/ Configuration public class RedisTemplateConfig {Bean(name redisTemplate)public RedisTemplate redisTemplate(RedisConnectionFactory factory){System.out.println(redis序列化--);RedisTemplate redisTemplate new RedisTemplate();RedisSerializer redisSerializer new StringRedisSerializer();//连接工厂redisTemplate.setConnectionFactory(factory);//键序列化redisTemplate.setKeySerializer(redisSerializer);//值序列化redisTemplate.setValueSerializer(redisSerializer);//key hashMap序列化redisTemplate.setHashKeySerializer(redisSerializer);//value hashMap序列化redisTemplate.setHashValueSerializer(redisSerializer);return redisTemplate;}} Redis配置类2 具备序列化、工厂连接、键值序字符串列化、hash键值Json序列化 package com.data.config;import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer;/*** ClassDescription:* Author李白* Date2023/7/25 14:44*/ Configuration public class RedisTemplateConfig {BeanSuppressWarnings(all)public RedisTemplateString, Object redisTemplate(RedisConnectionFactory factory) {RedisTemplateString, Object template new RedisTemplateString, Object();template.setConnectionFactory(factory);Jackson2JsonRedisSerializer jackson2JsonRedisSerializer new Jackson2JsonRedisSerializer(Object.class);ObjectMapper om new ObjectMapper();om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);jackson2JsonRedisSerializer.setObjectMapper(om);StringRedisSerializer stringRedisSerializer new StringRedisSerializer();// key采用String的序列化方式template.setKeySerializer(stringRedisSerializer);// hash的key也采用String的序列化方式template.setHashKeySerializer(stringRedisSerializer);// value序列化方式采用jacksontemplate.setValueSerializer(jackson2JsonRedisSerializer);// hash的value序列化方式采用jacksontemplate.setHashValueSerializer(jackson2JsonRedisSerializer);template.afterPropertiesSet();return template;}}
http://www.hkea.cn/news/14265026/

相关文章:

  • 个人网站建设设计长沙seo培训班
  • 电子商务网站建设需要注意什么企业网页设计
  • 国外的调查网站上做问卷html网页框架
  • 做网站卖机器怎么弄工程公司名称大全集最新免费
  • 网站页面优化方法遵义网站建设公司电话多少
  • 做视频网站需要什么哪家公司做网站专业
  • 营销型网站建设口碑好怎么制作网站数据包导入小程序
  • 网站建设一般多少费用建站软件大全
  • 营销网站制作设计深圳房产网
  • 设计logo免费网站聊城开发区建设局网站
  • 凡科建站代理九亭 网站建设
  • 长春做公司网站的江门建设银行网站
  • 网站首页背景图片品牌创意设计
  • wifi扩展器做网站期货软件定制开发公司
  • 常见的网站建设程序有哪些银川seo公司
  • 点了网站域名会跳转昆山住房城乡建设局网站查询
  • 专做国外旅游的网站湛江网站建设湛江
  • 做网站的简称wordpress oss ftp
  • 湖北网站建设电话wordpress关注公众号
  • 清河做网站多少钱邯郸广告公司网站建设
  • 房山营销型网站建设微信公众号运营要求
  • 二级域名网站免费建站wordpress 媒体备份
  • 免费做网站教程wordpress头部文字改不了
  • 阿里云做网站经费百度怎么推广自己的产品
  • 衡水精品网站建设报价wordpress能放视频播放器
  • 流量网站怎么做的wordpress代理服务器
  • 做外贸没有企业网站昌平网站开发公司
  • 如何做网站数据分析大学电子商务专业就业方向
  • 互联网网站怎么做建管家企业网站
  • 做网站一定要认证吗合肥做网站怎么样