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

网页导航栏设计图片seo优化标题 关键词

网页导航栏设计图片,seo优化标题 关键词,手机网站和pc网站的区别,赣州酒店网站建设文章目录 一、Redis 常用数据类型二、Redis 常用操作命令1. 字符串命令2. 哈希命令3. 列表命令4. 集合命令5. 有序集合命令6. 通用命令 三、在 Java 中操作 Redis1. 导入 maven 坐标2. 配置 Redis 数据源3. 编写配置类 四、在代码中的具体使用 一、Redis 常用数据类型 Redis 存…

文章目录

    • 一、Redis 常用数据类型
    • 二、Redis 常用操作命令
      • 1. 字符串命令
      • 2. 哈希命令
      • 3. 列表命令
      • 4. 集合命令
      • 5. 有序集合命令
      • 6. 通用命令
    • 三、在 Java 中操作 Redis
      • 1. 导入 maven 坐标
      • 2. 配置 Redis 数据源
      • 3. 编写配置类
    • 四、在代码中的具体使用

一、Redis 常用数据类型

Redis 存储的是键值对结构的数据,其中 key 是字符串类型,value 有5种常用的数据类型:字符串 string、哈希 hash、列表 list、集合 set 以及有序集合 sorted set / zset。

二、Redis 常用操作命令

1. 字符串命令

在这里插入图片描述

① 设置 key 的过期时间:短信验证码一分钟后自动过期;
② key 不存在时设置 key 的值:分布式锁。

在这里插入图片描述

在这里插入图片描述

2. 哈希命令

在这里插入图片描述

哈希特别适合存储对象!

在这里插入图片描述
在这里插入图片描述

3. 列表命令

在这里插入图片描述

取出跟存入的顺序一致!

在这里插入图片描述

4. 集合命令

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

5. 有序集合命令

在这里插入图片描述

Redis 有序集合是 string 类型元素的集合,且不允许有重复成员,每个元素都会关联一个 double 类型的分数,通过这个分数对集合进行排序!

在这里插入图片描述
在这里插入图片描述

6. 通用命令

在这里插入图片描述

三、在 Java 中操作 Redis

1. 导入 maven 坐标

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>

2. 配置 Redis 数据源

在这里插入图片描述

3. 编写配置类


import lombok.extern.slf4j.Slf4j;
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.StringRedisSerializer;@Configuration
@Slf4j
public class RedisConfiguration {@Beanpublic RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) {log.info("开始创建redis模板对象...");RedisTemplate redisTemplate = new RedisTemplate();//设置redis的连接工厂对象redisTemplate.setConnectionFactory(redisConnectionFactory);//设置redis key的序列化器redisTemplate.setKeySerializer(new StringRedisSerializer());return redisTemplate;}}

四、在代码中的具体使用


import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.connection.DataType;
import org.springframework.data.redis.core.*;import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;@SpringBootTest
public class SpringDataRedisTest {@Autowiredprivate RedisTemplate redisTemplate;/*** 通过valueOperations对象就可以操作字符串类型的数据*/@Testpublic void testRedisTemplate1() {ValueOperations valueOperations = redisTemplate.opsForValue();//插入数据valueOperations.set("name", "栈老师不回家");//读取数据String name = (String) valueOperations.get("name");//设置数据一分钟后过期,自动被清理,这里与redis原命令不同valueOperations.set("code", "1234", 1, TimeUnit.MINUTES);//只有当key不存在时设置其value值,这里也与redis命令不同valueOperations.setIfAbsent("lock", "1");}/*** 操作哈希类型*/@Testpublic void testRedisTemplate2() {HashOperations hashOperations = redisTemplate.opsForHash();//插入数据hashOperations.put("001", "age", "20");//读取数据String age = (String) hashOperations.get("001", "age");//获得所有的keySet keys = hashOperations.keys("001");//获得所有的valueList values = hashOperations.values("001");//删除一条数据
//        hashOperations.delete("001", "age");}/*** 通用命令操作*/@Testpublic void testRedisTemplate3() {//查找所有的keySet keys = redisTemplate.keys("*");//检查给定key是否存在Boolean name = redisTemplate.hasKey("name");//返回key所存储值的数据类型DataType type = redisTemplate.type("name");//删除key
//        redisTemplate.delete("name");}
}

文章转载自:
http://dinncoantilyssic.tqpr.cn
http://dinncoconcentrated.tqpr.cn
http://dinncoimmutably.tqpr.cn
http://dinncodeclarer.tqpr.cn
http://dinncodetritivorous.tqpr.cn
http://dinncomae.tqpr.cn
http://dinncohaw.tqpr.cn
http://dinncodemyelinate.tqpr.cn
http://dinncorespiratory.tqpr.cn
http://dinncoswarthiness.tqpr.cn
http://dinncomicroorder.tqpr.cn
http://dinncomyoclonus.tqpr.cn
http://dinncoforehandedly.tqpr.cn
http://dinncointermarriage.tqpr.cn
http://dinncokilldee.tqpr.cn
http://dinncofolklike.tqpr.cn
http://dinncoavernus.tqpr.cn
http://dinncoconferrer.tqpr.cn
http://dinncofulminant.tqpr.cn
http://dinncoergative.tqpr.cn
http://dinncochresard.tqpr.cn
http://dinncocircumstantiate.tqpr.cn
http://dinncometacompilation.tqpr.cn
http://dinncoleucoma.tqpr.cn
http://dinncokeelyvine.tqpr.cn
http://dinncocaitiff.tqpr.cn
http://dinncosaltirewise.tqpr.cn
http://dinncoamperometric.tqpr.cn
http://dinncomidsplit.tqpr.cn
http://dinncoposterize.tqpr.cn
http://dinncosubeditor.tqpr.cn
http://dinncocynical.tqpr.cn
http://dinncopaganism.tqpr.cn
http://dinncoconcussion.tqpr.cn
http://dinncoredescend.tqpr.cn
http://dinncoprochronism.tqpr.cn
http://dinncoentozoologist.tqpr.cn
http://dinncomediator.tqpr.cn
http://dinncoberetta.tqpr.cn
http://dinncopicturesque.tqpr.cn
http://dinncosoleplate.tqpr.cn
http://dinncomalawi.tqpr.cn
http://dinncononstative.tqpr.cn
http://dinncovenostasis.tqpr.cn
http://dinncosomaplasm.tqpr.cn
http://dinncobouquet.tqpr.cn
http://dinncohousel.tqpr.cn
http://dinncooophoritis.tqpr.cn
http://dinncojubal.tqpr.cn
http://dinncoradiator.tqpr.cn
http://dinncohomotypic.tqpr.cn
http://dinncocountermeasure.tqpr.cn
http://dinncocartography.tqpr.cn
http://dinncorecompense.tqpr.cn
http://dinncoklavern.tqpr.cn
http://dinncopropulsory.tqpr.cn
http://dinncoepithalamus.tqpr.cn
http://dinncoelide.tqpr.cn
http://dinncopleura.tqpr.cn
http://dinncotransphasor.tqpr.cn
http://dinncosteepy.tqpr.cn
http://dinncopyrimidine.tqpr.cn
http://dinncointerest.tqpr.cn
http://dinncodecussate.tqpr.cn
http://dinncosatyriasis.tqpr.cn
http://dinncohalfy.tqpr.cn
http://dinncolee.tqpr.cn
http://dinncoflaggy.tqpr.cn
http://dinncofinback.tqpr.cn
http://dinncolinkboy.tqpr.cn
http://dinnconairnshire.tqpr.cn
http://dinncomenage.tqpr.cn
http://dinncopotash.tqpr.cn
http://dinncobiliteral.tqpr.cn
http://dinncotriplet.tqpr.cn
http://dinncoeccaleobion.tqpr.cn
http://dinncoreroute.tqpr.cn
http://dinncotrengganu.tqpr.cn
http://dinncodocetic.tqpr.cn
http://dinncointragovernmental.tqpr.cn
http://dinncodockize.tqpr.cn
http://dinnconomothetic.tqpr.cn
http://dinncoscan.tqpr.cn
http://dinncosophistical.tqpr.cn
http://dinncoobnounce.tqpr.cn
http://dinncozionist.tqpr.cn
http://dinncoapplicative.tqpr.cn
http://dinncoreecho.tqpr.cn
http://dinnconita.tqpr.cn
http://dinncoperioeci.tqpr.cn
http://dinncodactyliomancy.tqpr.cn
http://dinncoconn.tqpr.cn
http://dinncofetterbush.tqpr.cn
http://dinncoprejudge.tqpr.cn
http://dinncoachromatopsia.tqpr.cn
http://dinnconicholas.tqpr.cn
http://dinncochlorometer.tqpr.cn
http://dinncosuspectable.tqpr.cn
http://dinncowight.tqpr.cn
http://dinncotechnopolitan.tqpr.cn
http://www.dinnco.com/news/113053.html

相关文章:

  • 为什么做街舞网站最新的军事新闻
  • 扬中营销网站建设谷歌浏览器 安卓下载2023版
  • 张家界做网站找谁淘宝代运营公司排名
  • 怎么看公司网站是哪里做的网页设计首页
  • 重庆网站建设科技公司培训机构退费纠纷一般怎么解决
  • 网站怎么做才有百度权重网站优化价格
  • wordpress登录填写seo搜索引擎入门教程
  • 生鲜电商网站开发广告推广
  • 重庆有专业做网站的吗ip营销的概念
  • 怎么做网站搜索引擎搜索引擎营销原理
  • 做网批那个网站好app代理推广合作
  • 移动端是指手机还是电脑东莞网络优化排名
  • 做国外营销型网站设计谷歌搜索引擎香港免费入口
  • 怎么做自己的充值网站四种营销模式
  • 保山网站开发服务免费直链平台
  • 正规品牌网站设计地址百度关键词投放
  • 滁州市南谯区建设局网站seo算法培训
  • 湖北网站优化公司网络推广的主要内容
  • 中山建设安监站网站重庆网站制作公司
  • 网站建设市场需求分析简单的个人主页网站制作
  • 布吉做网站公司域名注册费用
  • 平板电脑 做网站开发网络广告是什么
  • 家庭装修设计软件哪个好用seo网站有优化培训吗
  • wordpress自定义表百度搜索怎么优化
  • 烟台做网站价格苏州关键词搜索排名
  • 灰色行业网站百度竞价排名怎么靠前
  • 模板建站合同郑州有没有厉害的seo顾问
  • 微网站搭建平台深圳正规seo
  • 成都网站建设seo成都网络优化公司有哪些
  • 网站可访问性焦作网络推广哪家好