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

jsp做的网站源码阿里云网站备案后

jsp做的网站源码,阿里云网站备案后,营销策略的概念和内容,wordpress js漏洞提前总结#xff0c;因此项目已多处使用Redis1 故此我创建的Redis工厂只添加了Redis2并不影响Redis1。但如若还有Redis3、4、5可按照下述方法继续往Redis工厂里添加 下述代码添加到 RedisConfig import org.springframework.beans.factory.annotation.Autowired; import org…提前总结因此项目已多处使用Redis1 故此我创建的Redis工厂只添加了Redis2并不影响Redis1。但如若还有Redis3、4、5可按照下述方法继续往Redis工厂里添加 下述代码添加到 RedisConfig import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.redis.core.BoundSetOperations; import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Component;Value(${custom.redis.host})private String customRedisHost;Value(${custom.redis.port})private int customRedisPort;Bean(customRedisConnectionFactory)public RedisConnectionFactory customRedisConnectionFactory() {LettuceConnectionFactory lettuceConnectionFactory new LettuceConnectionFactory(customRedisHost, customRedisPort);lettuceConnectionFactory.setDatabase(1);return lettuceConnectionFactory;}Bean(customRedisTemplate)public RedisTemplateObject, Object customRedisTemplate(RedisConnectionFactory customRedisConnectionFactory) {RedisTemplateObject, Object redisTemplate new RedisTemplate();redisTemplate.setConnectionFactory(customRedisConnectionFactory);redisTemplate.setDefaultSerializer(new StringRedisSerializer()); // 默认使用StringRedisSerializerreturn redisTemplate;}yml文件 custom:redis:host: 127.0.0.1port: 6379database: 1#password:Redis工具类 package com.ruoyi.common.core.redis;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.redis.core.BoundSetOperations; import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Component;import java.util.*; import java.util.concurrent.TimeUnit;/*** spring redis 工具类** author ruoyi**/ SuppressWarnings(value { unchecked, rawtypes }) Component public class Redis2Cache {AutowiredQualifier(customRedisTemplate)public RedisTemplate redisTemplate;/*** 缓存基本的对象Integer、String、实体类等** param key 缓存的键值* param value 缓存的值*/public T void setCacheObject(final String key, final T value){redisTemplate.opsForValue().set(key, value);}/*** 缓存基本的对象Integer、String、实体类等** param key 缓存的键值* param value 缓存的值* param timeout 时间* param timeUnit 时间颗粒度*/public T void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit){redisTemplate.opsForValue().set(key, value, timeout, timeUnit);}/*** 设置有效时间** param key Redis键* param timeout 超时时间* return true设置成功false设置失败*/public boolean expire(final String key, final long timeout){return expire(key, timeout, TimeUnit.SECONDS);}/*** 设置有效时间** param key Redis键* param timeout 超时时间* param unit 时间单位* return true设置成功false设置失败*/public boolean expire(final String key, final long timeout, final TimeUnit unit){return redisTemplate.expire(key, timeout, unit);}/*** 获得缓存的基本对象。** param key 缓存键值* return 缓存键值对应的数据*/public T T getCacheObject(final String key){ValueOperationsString, T operation redisTemplate.opsForValue();return operation.get(key);}/*** 删除单个对象** param key*/public boolean deleteObject(final String key){return redisTemplate.delete(key);}/*** 删除集合对象** param collection 多个对象* return*/public long deleteObject(final Collection collection){return redisTemplate.delete(collection);}/*** 缓存List数据** param key 缓存的键值* param dataList 待缓存的List数据* return 缓存的对象*/public T long setCacheList(final String key, final ListT dataList){Long count redisTemplate.opsForList().rightPushAll(key, dataList);return count null ? 0 : count;}/*** 获得缓存的list对象** param key 缓存的键值* return 缓存键值对应的数据*/public T ListT getCacheList(final String key){return redisTemplate.opsForList().range(key, 0, -1);}/*** 缓存Set** param key 缓存键值* param dataSet 缓存的数据* return 缓存数据的对象*/public T BoundSetOperationsString, T setCacheSet(final String key, final SetT dataSet){BoundSetOperationsString, T setOperation redisTemplate.boundSetOps(key);IteratorT it dataSet.iterator();while (it.hasNext()){setOperation.add(it.next());}return setOperation;}/*** 获得缓存的set** param key* return*/public T SetT getCacheSet(final String key){return redisTemplate.opsForSet().members(key);}/*** 缓存Map** param key* param dataMap*/public T void setCacheMap(final String key, final MapString, T dataMap){if (dataMap ! null) {redisTemplate.opsForHash().putAll(key, dataMap);}}/*** 获得缓存的Map** param key* return*/public T MapString, T getCacheMap(final String key){return redisTemplate.opsForHash().entries(key);}/*** 往Hash中存入数据** param key Redis键* param hKey Hash键* param value 值*/public T void setCacheMapValue(final String key, final String hKey, final T value){redisTemplate.opsForHash().put(key, hKey, value);}/*** 获取Hash中的数据** param key Redis键* param hKey Hash键* return Hash中的对象*/public T T getCacheMapValue(final String key, final String hKey){HashOperationsString, String, T opsForHash redisTemplate.opsForHash();return opsForHash.get(key, hKey);}/*** 删除Hash中的数据* * param key* param hKey*/public void delCacheMapValue(final String key, final String hKey){HashOperations hashOperations redisTemplate.opsForHash();hashOperations.delete(key, hKey);}/*** 获取多个Hash中的数据** param key Redis键* param hKeys Hash键集合* return Hash对象集合*/public T ListT getMultiCacheMapValue(final String key, final CollectionObject hKeys){return redisTemplate.opsForHash().multiGet(key, hKeys);}/*** 获得缓存的基本对象列表** param pattern 字符串前缀* return 对象列表*/public CollectionString keys(final String pattern){return redisTemplate.keys(pattern);} }
http://www.hkea.cn/news/14522134/

相关文章:

  • 蒲城网站建设数据服务网站策划方案
  • dw静态个人简历网站模板下载现在室内设计师好做吗
  • 官方网站下载拼多多app网站开发技能证书
  • WordPress建站经验做网站公司在丹麦
  • 深圳网站建设创想营销为知笔记 编辑wordpress
  • 网站dedecms模板怎么查看修改啊黄冈网站推广软件视频
  • 什么外贸网站做箱包好深圳招聘网站排名
  • app平台网站搭建在线制图免费版
  • 专业做医院网站建设做网站必要吗
  • 做淘宝差不多的网站吗网站中的文字滑动怎么做的
  • 做视频网站收费侵权吗外贸公司英文网站建设
  • 花多少钱能把网站做到页面wordpress边栏显示
  • 电商网站代码模板wordpress 人流量 插件
  • wordpress加dzseo网络推广培训班
  • 做商城网站还要服务器网站建设艾金手指科杰
  • 安阳网站制作怎么制作公众号的链接
  • 手机访问跳转手机网站wordpress评论提交特效
  • 网站导航下拉菜单代码商城建站费用
  • 网站降权查下网站空间到期了
  • 恒一信息深圳网站建设公司2建站平台 discuz
  • 大连网站开发企业辽宁鞍山网站建设公司
  • 山西中小学网站建设文登建设局网站
  • 四川省建设主管部门网站上海专业网站建站品
  • 优化网站浏览量怎么看深圳网页设计公司推荐
  • 论坛的网站制作简单网站建设的费用
  • 外国的免费网站网站松江网站设计
  • 教学网站知识库主题 wordpress
  • 影楼手机网站设计佛山专业的做网站
  • 公司网站建设方案书怎么写成都装修办公室公司
  • 建设软件网站哪里有做空包网站的