Loading

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页
摘要: 2、units 3、include 4、GENERAL 1) daemonize no Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程 2)pidfile /var/run/redis.pid 当Redis以守护进程方式运行时,Redis默认会把pid写入/va 阅读全文
posted @ 2020-09-01 20:50 青岑 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 在以前的 SpringMVC中,国际化需要以下3步骤 1)、编写国际化配置文件; 2)、使用ResourceBundleMessageSource管理国际化资源文件 3)、在页面使用fmt:message取出国际化内容 SpringBoot中实现国际化的步骤: 1)编写国际化配置文件,抽取页面需要显 阅读全文
posted @ 2020-09-01 18:26 青岑 阅读(5374) 评论(0) 推荐(0) 编辑
摘要: 1、引入 thymeleaf 切换thymeleaf版本 <properties> <thymeleaf.version>3.0.9.RELEASE</thymeleaf.version> <!-- 布局功能的支持程序 thymeleaf3主程序 layout2以上版本 --> <!-- thyme 阅读全文
posted @ 2020-09-01 15:57 青岑 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 1)所有的 /webjars/**, 都去classpath:/META-INF/resources/webjars/ 找资源 webjars:以jar包的方式引入静态资源; 2)/** 访问当前项目的任何资源,都去(静态资源的文件夹)下寻找 "classpath:/META-INF/resourc 阅读全文
posted @ 2020-09-01 15:52 青岑 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 1、默认配置 1)日志的使用 //记录器 Logger logger = LoggerFactory.getLogger(getClass()); @Test public void contextLoads() { //System.out.println(); //日志的级别; //由低到高 t 阅读全文
posted @ 2020-08-25 23:17 青岑 阅读(922) 评论(0) 推荐(0) 编辑
摘要: 获取:HttpServletRequest ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletRequest 阅读全文
posted @ 2020-08-21 22:48 青岑 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 熔断是什么? 熔断机制是应对雪崩效应的一种微服务链路保护机制。当扇形链路的某个微服务出错不可用或者响应 时间太长时,会进行服务的降级,从而熔断该节点微服务的调用,快速返回错误的响应信息。 当检测到该节点微服务调用响应正常后,恢复调用链路 在Spring Cloud框架中。熔断机制通过Hystrix实 阅读全文
posted @ 2020-08-20 23:19 青岑 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Hystrix的服务降级,既可以配置在服务提供端,也可以配置在服务调用端, 但一般来说,配置在服务调用端! 服务提供者端: 1)业务类 : 添加fallback方法 @Service public class PaymentService { public String paymentInfo_ok 阅读全文
posted @ 2020-08-19 23:36 青岑 阅读(978) 评论(0) 推荐(0) 编辑
摘要: 1)是什么2)日志级别3)如何实现日志打印功能① 添加日志bean配置类@Configuration public class FeignConfig { @Bean Logger.Level feignLoggerLevel() { return Logger.Level.FULL; } } ②、在yml中添加如下配置logging: level: # feign日志以什么级别监控哪个接口 co... 阅读全文
posted @ 2020-08-18 00:01 青岑 阅读(736) 评论(0) 推荐(0) 编辑
摘要: 这里做一个简单的demo演示 1)新建module cloud-consumer-feign-order80 这里标注了各个文件和包!!! 2) 添加依赖 <dependencies> <!--openfeign--> <dependency> <groupId>org.springframewor 阅读全文
posted @ 2020-08-17 23:54 青岑 阅读(1233) 评论(0) 推荐(0) 编辑
摘要: 1、IRule 简介 是一个接口其作用是:根据特定算法从服务列表中选取一个要访问的服务IRule的继承结构如下:IRule的主要实现类:2、如何替换Ribbon默认的轮询规则①、自定义配置类MySelfRule 将IRule的一个实现类添加到spring容器中@Configuration public class MySelfRule { @Bean public IRule myRule(){ ... 阅读全文
posted @ 2020-08-17 23:52 青岑 阅读(548) 评论(0) 推荐(0) 编辑
摘要: 为什么会产生eureka的自我保护机制? 为了防止EurekaClient(服务提供者)可以正常运行,但是与EurekaServer网络拥挤的情况下, EurekaServer不会将EurekaClient服务剔除 什么是Eureka的自我保护进制 默认情况下,如果Eureka在一定时间内没有收到某 阅读全文
posted @ 2020-08-16 14:24 青岑 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 笔记写在这里,其实只是为了方便了以后黏贴,其实对各位没什么帮助,在这里提醒下! 而且我这没有全部粘贴,只是copy了大概的 1)搭建zookeeper服务并启动 这里就不再赘述了,直接去我的博客下看zookeeper在linux上的搭建 2) 支付服务注册进zookeeper 步骤如下: 项目结构: 阅读全文
posted @ 2020-08-16 13:05 青岑 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 1、比较MP 的代码生成器 和 Mybatis MBG 代码生成器: MP 的代码生成器都是基于 java 代码来生成。MBG 基于 xml 文件进行代码生成 MyBatis 的代码生成器可生成: 实体类、Mapper 接口、Mapper 映射文件 MP 的代码生成器可生成: 实体类(可以选择是否支 阅读全文
posted @ 2020-08-16 11:16 青岑 阅读(809) 评论(0) 推荐(0) 编辑
摘要: 1、EntityWrapper_Condition简介 Mybatis-Plus 通过 EntityWrapper(MP 封装的一个查询条件构造器)或者 Condition(继承Wrapper) 来让用户自由的构建查询条件,简单便捷,没有额外的负担, 能够有效提高开发效率 2、selectPage方 阅读全文
posted @ 2020-08-16 09:00 青岑 阅读(6118) 评论(1) 推荐(0) 编辑
摘要: 格式化代码: ctrl + alt + L 查看上一次浏览的代码:ctrl + alt + <— 查看方法在哪儿被调用:ctrl + B 阅读全文
posted @ 2020-08-15 10:35 青岑 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 3.1 通用 CRUD 1) 提出问题: 假设我们已存在一张 tbl_employee 表,且已有对应的实体类 Employee,实现 tbl_employee 表的 CRUD 操作我们需要做什么呢? 2) 实现方式: 基于 Mybatis 需要编写 EmployeeMapper 接口,并手动编写 阅读全文
posted @ 2020-08-14 22:52 青岑 阅读(559) 评论(0) 推荐(0) 编辑
摘要: 1)加入maven 依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>t 阅读全文
posted @ 2020-08-14 22:27 青岑 阅读(2535) 评论(0) 推荐(1) 编辑
摘要: 进入spring官网SpringCloud项目下:https://spring.io/projects/spring-cloud Boot和Cloud 依赖关系的详细介绍: 在浏览器上输入 https://start.spring.io/actuator/info 在线格式化json串,这里就是bo 阅读全文
posted @ 2020-08-14 22:19 青岑 阅读(1376) 评论(0) 推荐(0) 编辑
摘要: 项目结构如下 1)引入依赖 特别说明: Mybatis 及 Mybatis-Spring 依赖请勿加入项目配置,以免引起版本冲突!!! Mybatis-Plus 会自动帮你维护! 还有一点:我的mysql是8.0的,如果用 <artifactId>mysql-connector-java</arti 阅读全文
posted @ 2020-08-14 07:18 青岑 阅读(476) 评论(0) 推荐(0) 编辑
摘要: 1、Mybatis 逆向工程是什么? MyBatis Generator 简称mbg,是一个专门为Mybatis框架使用者定制的代码生成器,可以快速的根据表生成对应的 映射文件、接口和bean类。支持基本的增删改查,以及QBC(Query By Criteria)风格的条件查询。 2、如何使用 首先 阅读全文
posted @ 2020-08-10 21:56 青岑 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1、if标签 <select id="getEmpsByConditionIf" resultType="com.atguigu.mybatis.bean.Employee"> select * from tbl_employee where 1=1 <if test="id!=null"> and 阅读全文
posted @ 2020-08-05 23:53 青岑 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 1、insert_获取自增主键的值 <!-- 增加 mybatis 也是利用 statement.getGeneratedKeys()来获取自增主键值 useGeneratedKeys ="true" 使用自增主键获取主键值策略 keyProperty : mybatis获取到主键值后,将其封装到j 阅读全文
posted @ 2020-08-05 23:40 青岑 阅读(573) 评论(0) 推荐(1) 编辑
摘要: 1、peoperties mybatis可以使用properties来引入外部properties配置文件的内容 - resource:引入类路径下的资源 - url:引入网络或者磁盘路径下的资源 db.properties: jdbc.driver = com.mysql.jdbc.Driver 阅读全文
posted @ 2020-08-02 23:35 青岑 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 1、栈的一个实际需求 2、栈的介绍 3、栈的应用场景 4、数组模拟栈 代码实现: public class ArrayStackDemo { public static void main(String[] args) { //测试ArrayStack是否正确 ArrayStack stack = 阅读全文
posted @ 2020-08-01 23:53 青岑 阅读(186) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页