运维
未读
Nginx报错400——unkown the request
报错场景 访问请求第一次 OK ,第二次 unkown the request 解决方法 查看反向代理的配置是否出错 server {
location /api {
default_type application/json;
#internal;
keepali
后端技术
未读
SpringBoot报错日志——knif4j无法访问401
场景重现 依赖: <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis<
后端技术
未读
redis常用场景——缓存登录信息
场景重现 当一个boot程序开启拦截器,那么每次拦截请求都需要通过 mysql 查询用户信息,这样会给服务器带来很大的负担,此时可以使用 redis 作为中间件,缓存登录信息 优点: redis 内存读写,速度快 没使用redis缓存前 使用 redis 缓存后
后端技术
未读
springboot报错——Field userMapper in xx.xx required a bean of type 'xx.mapper' that could not be found.
报错内容 Description:
Field userMapper in com.zxb.boot3.ssm.controller.UserController required a bean of type 'com.zxb.boot3.ssm.mapper.UserMapper' that
后端技术
未读
MyBatis-plus笔记——条件构造器和常用接口
wapper介绍 Wapper:条件构造抽象类 AbstractWapper:用于查询条件封装,生成 sql 的 where 条件 QueryWrapper:查询条件封装 UpdateWrapper:Update 条件封装 AbstractLambdaWrapper:使用Lambda语法 Lambd
后端技术
未读
MyBatis-plus笔记——分页插件
插件配置 插件配置类,拦截器添加PaginationInnerInterceptor @Configuration
@MapperScan("com.zxb.mp.mapper") // 扫描指定mapper接口路径
public class MyBatisConfig {
后端技术
未读
MyBatis笔记——MyBatis缓存
什么是MyBatis缓存 当 mybatis 执行sql时,会创建缓存,下次执行相同语句时,会直接使用缓存的结果 优点 减少重复sql的计算时间 MyBatis 一级缓存 一级缓存是SqlSession级别的 SqlSession sqlSession = SqlSessionUtils.getSq
运维
未读
MyBatis-plus笔记——常用注解
@TableName 在开发的过程中,我们经常遇到以上的问题,即实体类所对应的表有固定的前缀,例如 t_ 或 tbl_ 此时,可以使用 @TableName 指定表前缀 @Data
@TableName("t_user")
public class User {
private Long i
后端技术
未读
MyBatis-Plus笔记——基础环境搭建
Spring 基础环境 Spring 基础环境 指的是 Spring + MyBatis + 辅助类 1.引入依赖 <properties>
<maven.compiler.source>22</maven.compiler.source>
<
后端技术
未读
MyBatis——动态SQL
什么是动态SQL 动态SQL是MyBatis中的一种功能,允许你在XML映射文件中编写动态生成的SQL语句。主要用于解决SQL语句需要根据不同情况进行变化的问题。 例如,你可能需要根据用户输入的查询条件生成不同的where子句,或者可能需要根据程序运行时的状态切换不同的join子句等。 MyBati