SpringBoot
springboot 注解开发接口demo
## Maven配置依赖 ```xml org.projectlombok lombok 1.18.20 provided com.baomidou mybatis-plus-boot-starter 3.4.2 mysql mysql-connector-java 6.0.5 com.alibab ......
SpringBoot项目中实现读写分离
**背景介绍** 面对日益增加的系统访问量,数据库的吞吐量面临着巨大瓶颈。 对于同一时刻有大量并发读操作和较少写操作类型的应用系统来说,将数据库拆分为主库和从库,主库负责处理事务性的增删改操作,从库负责处理查询操作,能够有效的避免由数据更新导致的行锁,使得整个系统的查询性能得到极大的改善。 通过读写 ......
springboot嵌入tomcat原理
一、spring自动配置原理 spring启动的时候只需要添加SpringbootApplication注解,然后运行SpringApplication.run方法就可以进行自动配置运行 1.1 springbootapplication注解是一个组合复合注解,说主要的三个注解 SpringBoot ......
Springboot 最细节全面的接口传参接参介绍,总有你喜欢的一种方式
转: Springboot 最细节全面的接口传参接参介绍,总有你喜欢的一种方式 Springboot传参 ......
Redis在SpringBoot项目中的应用
在项目中使用redis作为缓存,提高用户访问速度。 **实现思路** * 保存缓存:当用户进行页面访问时,前端会向后端发送请求。后端则会向数据库中获取数据,此时我们在请求向数据库获取数据之前先从redis缓存中尝试获取数据,如果redis缓存中存在我们需要的数据,即可直接返回。如果不存在,则在请求向 ......
[SprigMVC/SpringBoot] JSON序列化专题之日期序列化问题:接口报Jackson框架错误“InvalidDefinitionException: Java 8 date/time type `java.time.LocalDateTime` not supported by default:...”
# 1 问题描述 请求接口时,`service`层返回到`controller`层的数据结构为`List>`,而`Map`中存在一个`key`=`date`,value type=`java.time.LocalDate`的`Entry`,且日志报如下错误: ``` log InvalidDefin ......
SpringBoot集成Redis
### 依赖包: ``` org.springframework.boot spring-boot-starter-data-redis org.apache.commons commons-pool2 ``` ### 配置文件 如果是 properties 文件,使用: ``` spring.re ......
SpringBoot04_分模块开发实例
注水预警:这篇博客很水 # 一、结构介绍 由于这部分代码比较多,建的文件也比较多,所以选择直接上传到了 gitee 的 仓库 中,提交更新也是一步步来的,应该会比博客更清晰。 分别创建三个模块,每个模块都有自己的数据库和端口号,模块之间通过 resthttp 的方式调用。 机制 SpringBoot中的starter是一种非常重要的机制(自动化配置),能够抛弃以前繁杂的配置,将其统一集 ......
springboot整合log4j解决依赖冲突
首先将web模块的日志排除 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <grou ......
SpringBoot的基础
## 1、获取配置文件的值:@Value的方式 - yml配置文件 ```yml redis: host: 199.22.22.34 ``` ### 1.1、用法1:普通用法 ```java @Value("${redis.host}") private String sunServerPath; ......
SpringBoot 多环境部署
#### 多个配置文件 * application.yaml * application-dev.yaml * application-test.yaml * application-prod.yaml #### 加载顺序 * 默认加载 application.yaml * profiles.act ......
SpringBoot整合OSS文件上传
# 一、注册阿里云账号并开通OSS服务 1、登录阿里云账号  2、创建一个bucket 
学习redis一段时间了,现在开始使用springboot整合redis,实现Java与redis数据库的连接与一系列的使用。 但刚开始就给我来了个下马威,直接寄,连接不上redis,在swagger的报错如下: **Unable to connect to Redis; nested except ......
SpringBoot集成kafka全面实战
一、前戏1、在项目中连接kafka,因为是外网,首先要开放kafka配置文件中的如下配置(其中IP为公网IP), advertised.listeners=PLAINTEXT://112.126.74.249:9092 2、在开始前我们先创建两个topic:topic1、topic2,其分区和副本数 ......
springboot接入influxdb
转载请注明出处: 1.添加maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> ......
springboot项目启动访问任何html页面报类型转换错误:Failed to convert value of type...
问题: 2023-05-30T21:35:57.495+08:00 WARN 19900 [nio-8080-exec-8] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.ann ......
基于JAVA的springboot+vue学生综合测评系统,附源码+数据库+论文+PPT
**1、项目介绍** 本学生综合测评系统以springboot作为框架,b/s模式以及MySql作为后台运行的数据库,同时使用Tomcat用为系统的服务器。本系统主要包括首页,个人中心,学生管理,试题信息管理,测评试题管理,管理员管理,综合测评管理,系统管理,综合考试管理等功能,通过这些功能的实现基 ......
springboot 雪花算法生成的发送到前端id精度丢失
添加注解: @JsonFormat(shape = JsonFormat.Shape.STRING) 用法: ......
springboot启动源码
每个Spring Boot项目都有一个主程序启动类,在主程序启动类中有一个启动项目的main()方法, 在该方法中通过执行SpringApplication.run()即可启动整个Spring Boot程序。 问题:那么SpringApplication.run()方法到底是如何做到启动Spring ......
分页 springboot
maven <!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter --> <dependency> <groupId>com.github.pagehelper</gr ......
springboot-解决项目编译后resources下文件生成乱码问题
SpringBoot项目下resources文件 项目编译之后resources下文件会生成乱码,是说明maven打包的时候出现问题缺少一个插件 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resour ......
SpringBoot指标监控功能
# SpringBoot指标监控功能 >随时查看SpringBoot运行状态,将状态以josn格式返回 ## 添加Actuator功能 Spring Boot Actuator可以帮助程序员监控和管理SpringBoot应用,比如健康检查、内存使用情况统计、线程使用情况统计等。 >使用方法 1. 在 ......
springboot使用jdbc连接mysql(不用配置文件)
1、连接mysql的工具类: package com.jzproject.common.mysql; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import org.springframework ......