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

东莞网站建设周期seo引擎优化公司

东莞网站建设周期,seo引擎优化公司,建设建设网站的,网站建设步骤图片素材1.1 简介 1.1.1 概述 Spring Data 中有一个成员 Spring Data Redis,他提供了 RedisTemplate 可以在 Spring 应用中更简便的访问 Redis 以及异常处理及序列化,支持发布订阅等操作。 1.2 RedisTemplate 常见 API   RedisTemplate 针对 jedis 客户端中大…

1.1 简介

1.1.1 概述

  Spring Data 中有一个成员 Spring Data Redis,他提供了 RedisTemplate 可以在 Spring 应用中更简便的访问 Redis 以及异常处理及序列化,支持发布订阅等操作。

1.2 RedisTemplate 常见 API
  RedisTemplate 针对 jedis 客户端中大量 API 进行了归类封装,将同一类型操作封装为 operation 接口

   ♞ ValueOperations: 简单 string 操作
 ♞ ListOperations:    针对 list 类型的数据操作
 ♞ HashOperations: 针对 hash 即 map 类型的数据操作
 ♞ SetOperations:    set 类型数据操作
 ♞ ZSetOperations:  zset 类型数据操作

☞ 示例


@SpringBootTest
public class RedisTest {@Autowiredprivate RedisTemplate redisTemplate;@Testpublic void redis() {redisTemplate.opsForValue().set("name", "张三");Object name = redisTemplate.opsForValue().get("name");System.out.println(name);}
}

1.2.2 BoundKeyOperations
  RedisTemplate 提供了对 key 的 bound(绑定) 便捷化操作 API,可以通过 bound 封装指定的 key,然后进行一系列的操作而无须显式的再次指定 Key。

    ♞ BoundValueOperations:  绑定 string 类型的 key
♞ BoundListOperations:      绑定 list 类型的 key
 ♞ BoundHashOperations:   绑定 hash 即 map 类型的 key
 ♞ BoundSetOperations:      绑定 set 类型的 key
♞ BoundZSetOperations:    绑定 zset 类型的 key

☞ 示例


@SpringBootTest
public class RedisTest {@Autowiredprivate RedisTemplate redisTemplate;@Testpublic void redis() {Object name = redisTemplate.boundValueOps("name").get();System.out.println(name);}
}

1.3 数据操作

1.3.1 通用方法
(通用方法)删除 key
// 删除单个 key,返回布尔值
redisTemplate.delete(K key);// 删除多个 key,返回删除的个数
redisTemplate.delete(Collection<K> keys);
(通用方法)判断 key 是否存在
// 返回布尔值
redisTemplate.hasKey(key);
(通用方法) key 有效时间
// 指定有效时间
redisTemplate.expire(key, time, TimeUnit.MINUTES);// 获取有效时间,返回值单位为秒
redisTemplate.getExpire(key);
1.3.2 操作 string
(string类型)添加数据
// 通过 ValueOperations 设置值
ValueOperations ops = redisTemplate.opsForValue();
// 存入数据
ops.set(key, value);	
// 设置过期时间
ops.set(key, value, time, TimeUnit.SECONDS);	// 通过 BoundValueOperations 设置值
BoundValueOperations key = redisTemplate.boundValueOps(key);
key.set(value);
key.set(value, time, TimeUnit.SECONDS);
 (string类型)获取数据
// 通过 ValueOperations 获取值
redisTemplate.opsForValue().get(key);// 通过 BoundValueOperations 获取值
redisTemplate.boundValueOps(key).get();
1.3.3 操作 list
(list类型) 添加数据
// 通过 ValueOperations 设置值
ListOperations opsList = redisTemplate.opsForList();
opsList.leftPush(listKey, listLeftValue);
opsList.rightPush(listKey, listRightValue);
// 存入集合
opsList.rightPushAll(list);	
opsList.leftPushAll(list);// BoundValueOperations 操作类似
(list类型) 获取数据
// 获取集合中的数据
redisTemplate.boundListOps(listKey).range(startIndex, endindex); // 根据索引获取数据
redisTemplate.boundListOps(listKey).index(index);// 集合长度
redisTemplate.boundListOps(listKey).size();
(list类型) 删除数据
// 从左侧弹出一个元素并返回
redisTemplate.boundListOps(listKey).leftPop();  // 从右侧弹出一个元素并返回
redisTemplate.boundListOps(listKey).rightPop(); // 移出 N 个值为 value 的元素
redisTemplate.boundListOps(listKey).remove(long, value); 
(list类型)修改数据
// 根据索引修改数据
redisTemplate.boundListOps(listKey).set(index, listLeftValue);
1.3.4 hash
(hash类型)添加数据
// 通过 BoundValueOperations 设置值
BoundHashOperations hashKey = redisTemplate.boundHashOps(HashKey);
hashKey.put(key, Vaue);
// 添加一个集合
hashKey.putAll(hashMap); // 通过 ValueOperations 设置值
HashOperations hashOps = redisTemplate.opsForHash();
hashOps.put(HashKey, key, Vaue);
(hash类型)获取数据
// 获取所有小 key
redisTemplate.boundHashOps(HashKey).keys();// 根据小 key 获取值
redisTemplate.boundHashOps(HashKey)get(key);// 获取所有键值对集合
redisTemplate.boundHashOps(HashKey).entries();
(hash类型)删除数据
// 判断 hash 中是否存在小 key
redisTemplate.boundHashOps(HashKey).hasKey(key);// 根据小 key 删除值
redisTemplate.boundHashOps(HashKey).delete(key);
1.3.5 set
(hash类型) 添加数据
// 通过 BoundValueOperations 设置值
redisTemplate.boundSetOps(setKey).add(setValue1, setValue2, setValue3);// 通过 ValueOperations 设置值
redisTemplate.opsForSet().add(setKey, SetValue1, setValue2, setValue");
(hash类型) 获取数据
// 获取所有值
redisTemplate.boundSetOps(setKey).members();// 获取 set 的长度
redisTemplate.boundSetOps(setKey).size();
(hash类型)删除数据
// 判断 set 中是否存在改值
redisTemplate.boundSetOps(setKey).isMember(setValue);// 移出指定的值
redisTemplate.boundSetOps(setKey).remove(setValue);
1.3.6 zset
(Zset类型) 添加数据
// 通过 BoundValueOperations 设置值
redisTemplate.boundZSetOps(zSetKey).add(zSetVaule, score);// 通过 ValueOperations 设置值
redisTemplate.opsForZSet().add(zSetKey, zSetVaule, score);
(Zset类型)获取数据
// 获取元素集合, 按照排名先后(从小到大)
redisTemplate.boundZSetOps(zSetKey).range(key, startIndex, endIndex);// 获取指定值的分数(权重)
redisTemplate.boundZSetOps(zSetKey).score(zSetVaule);// 获取 zset 长度
redisTemplate.boundZSetOps(zSetKey).size();
(Zset类型)修改分数
// 修改指定元素的分数
redisTemplate.boundZSetOps(zSetKey).incrementScore(zSetVaule, score);

(Zset类型)删除数据

// 删除指定元素
redisTemplate.boundZSetOps(zSetKey).remove(zSetVaule);// 删除指定索引范围的元素
redisTemplate.boundZSetOps(zSetKey).removeRange(strat, end);// 删除指定分数范围的元素
redisTemplate.boundZSetOps(zSetKey).removeRangeByScorssse(strat, end);


文章转载自:
http://impatiens.dztp.cn
http://supervisory.dztp.cn
http://inanimate.dztp.cn
http://swannery.dztp.cn
http://pound.dztp.cn
http://orrisroot.dztp.cn
http://yokel.dztp.cn
http://seagirt.dztp.cn
http://archaise.dztp.cn
http://pterosaurian.dztp.cn
http://unshaded.dztp.cn
http://trumpery.dztp.cn
http://extractive.dztp.cn
http://anaesthetization.dztp.cn
http://erp.dztp.cn
http://lionhood.dztp.cn
http://mto.dztp.cn
http://underarmed.dztp.cn
http://trinominal.dztp.cn
http://verligte.dztp.cn
http://wheatless.dztp.cn
http://alundum.dztp.cn
http://tshiluba.dztp.cn
http://cmea.dztp.cn
http://mesomorphous.dztp.cn
http://underdress.dztp.cn
http://knowledgeably.dztp.cn
http://distilment.dztp.cn
http://assafetida.dztp.cn
http://exsilentio.dztp.cn
http://medal.dztp.cn
http://helve.dztp.cn
http://covellite.dztp.cn
http://unclamp.dztp.cn
http://annotinous.dztp.cn
http://beatage.dztp.cn
http://misinterpret.dztp.cn
http://abbreviator.dztp.cn
http://gilding.dztp.cn
http://spavined.dztp.cn
http://rizaiyeh.dztp.cn
http://fissilingual.dztp.cn
http://technophile.dztp.cn
http://distill.dztp.cn
http://cerumen.dztp.cn
http://syph.dztp.cn
http://anthropopathy.dztp.cn
http://synapse.dztp.cn
http://pangwe.dztp.cn
http://catamnestic.dztp.cn
http://nival.dztp.cn
http://polysynaptic.dztp.cn
http://bilabial.dztp.cn
http://dour.dztp.cn
http://prolocutor.dztp.cn
http://platonist.dztp.cn
http://enate.dztp.cn
http://rightness.dztp.cn
http://perfidiously.dztp.cn
http://aberdonian.dztp.cn
http://osmolarity.dztp.cn
http://infraction.dztp.cn
http://wreath.dztp.cn
http://personality.dztp.cn
http://hypogeal.dztp.cn
http://dunstan.dztp.cn
http://inattention.dztp.cn
http://contagiosity.dztp.cn
http://ouzel.dztp.cn
http://alkalinization.dztp.cn
http://ibsenism.dztp.cn
http://collisional.dztp.cn
http://cytherean.dztp.cn
http://limpidity.dztp.cn
http://praline.dztp.cn
http://forcipressure.dztp.cn
http://chare.dztp.cn
http://honoree.dztp.cn
http://calefy.dztp.cn
http://provocate.dztp.cn
http://mouthbrooder.dztp.cn
http://ruthfulness.dztp.cn
http://barrier.dztp.cn
http://anteprohibition.dztp.cn
http://folliculitis.dztp.cn
http://nostoc.dztp.cn
http://distinguishable.dztp.cn
http://barothermogram.dztp.cn
http://telegraph.dztp.cn
http://unestablished.dztp.cn
http://salvy.dztp.cn
http://hypokinesis.dztp.cn
http://pichiciago.dztp.cn
http://autotelic.dztp.cn
http://graphologist.dztp.cn
http://aslope.dztp.cn
http://underplot.dztp.cn
http://awless.dztp.cn
http://epicist.dztp.cn
http://quartz.dztp.cn
http://www.dt0577.cn/news/118739.html

相关文章:

  • 郑州专业网页模板制作公司seo怎样
  • 在直播网站做前端注意现在有什么推广平台
  • 中国互联网协会招聘小时seo加盟
  • 做网站哪里的服务器速度快北京seo代理公司
  • perl网站建设网站注册地址
  • 曲阜市政对过做网站的是那家网站推广的方式有哪些?
  • 长沙网站开发智培训课程安排
  • 互联网站建设维护需要做什么网络广告文案
  • 国外做电商平台的网站还有什么江苏免费关键词排名外包
  • 河北网站建设报价广告公司经营范围
  • 头条网站怎么做网站排名优化制作
  • 建站abc网站地图cpa推广接单平台
  • 在linux系统上用什么做网站山西seo
  • 晋中做网站专业培训
  • 360企业网站认证爱站长尾词
  • 临沂在线上网站建设百度推广渠道
  • 网站建设公司如何找客户网络安全有名的培训学校
  • 海南建设教育执业网站成都网站建设方案外包
  • 淘宝客网站怎么建设百度推广怎么找客户
  • 网站建设最好的公司百度联盟项目看广告挣钱
  • 尚品宅配网站建设关键词调价工具哪个好
  • 广东网站开发设计合肥搜索引擎推广
  • 手机公众平台网站开发专门代写平台
  • 慈溪市建设厅网站googleseo优化
  • 网站轮播图能用什么软件做域名注册
  • 南昌网站建设公司有哪些百度的首页
  • 去哪里可以做网站怎么做好seo内容优化
  • 基于网站优化的搜索引擎推广方法steam交易链接怎么获取
  • 昆明公司网站制作一个网站推广
  • 长春网站开发招聘军事最新消息