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

邯郸做网站的公司wordpress所有页面都显示不出来

邯郸做网站的公司,wordpress所有页面都显示不出来,网站规划html,网站安装出现dirRedis简介: rRedis服务开启与停止: 服务开启: 在Redis配置文件中输入cmd进入命令行输入redis-server redis-cli.exe -h -p:连接到redis服务 设置密码:在redis.windows.conf中找到requirepass 密码 服务停止: 在服务开启的界面按ctrlc Redis数据类…

Redis简介:

rRedis服务开启与停止:

服务开启:

在Redis配置文件中输入cmd进入命令行输入redis-server

redis-cli.exe -h -p:连接到redis服务

设置密码:在redis.windows.conf中找到requirepass 密码

服务停止:

在服务开启的界面按ctrl+c

Redis数据类型:

各种数据类型的特点:

Redis常用命令:

在java中操作Reids:

Redis的java客户端:

1.导入Spring Data Redis的maven坐标

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

2.配置Redis数据源

sky:datasource:driver-class-name: com.mysql.cj.jdbc.Driverhost: localhostport: 3306database: sky_take_outusername: rootpassword: CHC52099maintainTimeStats: trueredis:host: localhostport: 6379database: 10

3.编写配置类,创建RedisTemplate对象

package com.sky.config;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;}
}

4.通过RedisTemplate对象操作Redis

package com.sky.test;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.core.*;import java.util.concurrent.TimeUnit;@SpringBootTest
public class SpringDataRedis {@Autowiredprivate RedisTemplate redisTemplate;@Testpublic void testRedisTemplate() {System.out.println(redisTemplate);ValueOperations valueOperations = redisTemplate.opsForValue();HashOperations hashOperations = redisTemplate.opsForHash();ListOperations listOperations = redisTemplate.opsForList();SetOperations setOperations = redisTemplate.opsForSet();ZSetOperations zSetOperations = redisTemplate.opsForZSet();}/*** 操作字符串类型的数据*/@Testpublic void testString() {redisTemplate.opsForValue().set("hello", "world");System.out.println(redisTemplate.opsForValue().get("hello"));redisTemplate.opsForValue().setIfAbsent("hello", "sky");redisTemplate.opsForValue().setIfPresent("hello", "sky",3, TimeUnit.MINUTES);}@Testpublic void testHash(){redisTemplate.opsForHash().put("sky","name","sky");redisTemplate.opsForHash().put("sky","age",18);System.out.println(redisTemplate.opsForHash().get("sky","name"));System.out.println(redisTemplate.opsForHash().get("sky","age"));}
}

设置营业状态:

需求说明:

controller层:

package com.sky.controller.admin;import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController("adminShopController")
@RequestMapping("/admin/shop")
@Api(tags = "店铺相关接口")
@Slf4j
public class ShopController {@Autowiredprivate RedisTemplate redisTemplate;/*** 设置店铺营业状态** @param status* @return*/@RequestMapping("/{status}")@ApiOperation("设置店铺状态")public Result setStatus(@PathVariable Integer status) {log.info("设置店铺状态为:{}", status == 1 ? "营业中" : "打烊了");redisTemplate.opsForValue().set("SHOP_STATUS", status);return Result.success();}@GetMapping("/status")@ApiOperation("获取店铺营业状态")public Result<Integer> getStatus() {Integer status = (Integer) redisTemplate.opsForValue().get("SHOP_STATUS");log.info("获取店铺营业状态为:{}", status == 1 ? "营业中" : "打烊了");return Result.success(status);}}

然后拿接口文档测试没有问题


文章转载自:

http://1IKwUMX3.rpzth.cn
http://LwVOvjEm.rpzth.cn
http://CTSNtKFD.rpzth.cn
http://0iUvtJRf.rpzth.cn
http://7IMn86ff.rpzth.cn
http://kSmNpjLt.rpzth.cn
http://6TAz9MOz.rpzth.cn
http://UAhjbSVM.rpzth.cn
http://dEDNYHKn.rpzth.cn
http://ViIV1MAD.rpzth.cn
http://fnJ2zhpR.rpzth.cn
http://C86m1y1v.rpzth.cn
http://5tJhq3lh.rpzth.cn
http://QZn3ll3q.rpzth.cn
http://z3T1W4bJ.rpzth.cn
http://xM2PpSST.rpzth.cn
http://hou3lecV.rpzth.cn
http://ZA1TnWEh.rpzth.cn
http://YaKvgE1T.rpzth.cn
http://KQ3YFrrK.rpzth.cn
http://tGwaBg7U.rpzth.cn
http://hWt2OVUr.rpzth.cn
http://UbcoTCno.rpzth.cn
http://cxDGyTlY.rpzth.cn
http://rXvnaHKe.rpzth.cn
http://3e08MtXB.rpzth.cn
http://AXztzcQU.rpzth.cn
http://ekHzyjp7.rpzth.cn
http://v5os80Rb.rpzth.cn
http://v3tueeza.rpzth.cn
http://www.dtcms.com/wzjs/708432.html

相关文章:

  • 青岛做外贸网站常州网站建设解决方案
  • 北京网站建设 案例设计logo免费生成器
  • wordpress旅游网站wordpress电商平台插件
  • 缅甸做菠菜网站门户网站seo前期
  • 怎么用源码做网站wordpress后台用户名和密码
  • 手机端网站怎么制作上海企业登记在线服务平台
  • 找到网站后台地址专业装饰企业展厅设计公司
  • 广州网站建设好做吗网页设计视频教程-响应式手机网站制作
  • 上海网站建设 永灿做学校网站的目的是什么
  • 做海报的免费网站专门做中式的设计网站
  • 百度中搜到网站名字龙岗做商城网站建设
  • 视频聚合网站怎么做不侵权建湖人才网招工
  • 做网站建设的手机网站编辑
  • 怎么做网站给国外看见昌平网站建设推广优化seo
  • wordpress添加网站地图做网站联系方式
  • 扬州网站优化做网站首选智投未来1
  • 网站导航营销的优点中国出口贸易网官网
  • 织梦音乐网站程序韩国做 mp4下载网站
  • 西安大型网站建设公司排名什么网站可以接室内设计做
  • 高端旅游网站制作安徽网站优化厂家报价
  • 懂的建设网站模版建站
  • 宁波网站建设哪家好兼职做海报网站
  • 网站上传后怎么打开discuz应用中心
  • 教资报名网站设置关于网站建设的建议
  • 东莞网站主页制作优秀企业网站
  • 关键词带淘宝的网站不收录山东省建设厅举报网站
  • 如何做原创小说网站wordpress的阅读量
  • 钟祥建设局网站公司网站找谁做
  • 中国建设银行十堰分行网站服装企业网站建设可行性分析
  • 怎么做好网站开发 设计做网站的公司叫什么