摘要:Spring Cloud Gateway 启动报错(因为web依赖) 报错信息: Spring Cloud Gateway启动一直报错 详细错误信息 Parameter 0 of method modifyRequestBodyGatewayFilterFactory in org.springfr
阅读全文
摘要:SpringCloud学习公共依赖 <!-- 子模块继承之后,提供作用:锁定版本+子modlue不用写groupId和version --> <dependencyManagement> <dependencies> <!--spring boot 2.2.2--> <dependency> <gr
阅读全文
摘要:SpringBoot——Actuator 1.1 快速开始 未来每一个微服务在运算部署以后,我们都需要对其进行监控、追踪、审计和控制等等。Springboot就抽取了Actuator场景,使得我们每个微服务快速引用即可获得生产级别的应用监控、审计等功能。 那么,我们要怎么用呢? 首先,导入我们的场景
阅读全文
摘要:SpringBoot监控项目( spring-boot-admin) 创建admin监控服务器 第一步:创建一个新的springboot项目 第二步:修改pom.xml文件 <dependency> <groupId>de.codecentric</groupId> <artifactId>spri
阅读全文
摘要:SproingBoot单元测试 JUnit5简介 Spring Boot 2.2.0 版本开始引入 JUnit 5 作为单元测试默认库 JUnit 5官方文档 [https://junit.org/junit5/docs/current/user-guide/#writing-tests-annot
阅读全文
摘要:SpringBoot自定义启动类 starter starter机制 SpringBoot中整合了很多的第三方依赖,使用起来只需要配置依赖和配置属性就可直接使用,非常方便。 我们在开发中可能会遇到一个模块多个场景重复使用的情况,这时就可以吧模块抽象出来,自定义成启动类,在配置文件中进行相关配置就可使
阅读全文
摘要:Springboot切换配置文件 运行方式切换 第一种方式(yml和properties) 1、编辑配置文件(三个,总配置,测试环境,开发环境) application.yml spring: profiles: active: dev application-dev.yml com: name:
阅读全文
摘要:json表示格式 json格式化转化在线工具 [https://www.sojson.com/] 数组方式 [ ]、对象方式 { } 1、数组类型: int型数组: { "arr" : [1, 2, 3, 4] } string数组 { "arr" : ["a", "b", "c", "d"] }
阅读全文
摘要:@RequestBody、@RequestParam和@PathVariable的区别 一、注解之间的区别 @RequsetParam是用于接收URL的查询串中的相应参数及请求体中的参数; @PathVariable 是用于接收URL中占位符的参数,@Requestmapper("/{id}") @
阅读全文
摘要:git常用命令 #初始化 git remote add origin "git地址" #配置远程git仓库版本 git init #初始化git仓库 git clone "git地址" #克隆仓库 #提交 git add . #跟踪所有变动的文件 git add <file> #跟踪指定文件 git
阅读全文