04 2021 档案
摘要:隔离级别隔离级别是指若干个并发的事务之间的隔离程度,与我们开发时候主要相关的场景包括:脏读取、重复读、幻读。对于脏读、不可重复读和幻读详见:何为脏读、不可重复读、幻读 我们可以看org.springframework.transaction.annotation.Isolation枚举类中定义了五个
阅读全文
摘要://构建条件 QueryWrapper<ErpGroup> wrapper = new QueryWrapper<>(); // wrapper.eq("deleted","0"); String username = userAuthUtil.getUserName().get(); if(!us
阅读全文
摘要:import java.util.ArrayList; import java.util.List; public class TreeNode { protected Long id; protected Long parentId; public List<TreeNode> getChildr
阅读全文
摘要:JWT json web token JSON: 轻量级的可读性高的跨语言的数据交换格式 用户登录,前后端分离项目 1、登录验证账号密码,在验证成功的情况下执行下面操作 2、使用UUID生成对应token 3、将token缓存到redis中 redis: key=token, value=user_
阅读全文
摘要:https://dev.mysql.com/downloads/mysql/ 下载 解压然后设置环境变量 新建配置文件my.ini [mysqld] #设置3306端口 #port=3306 port=3406 #设置mysql的安装目录 basedir=E:\wsm\mysql-8.0.23-wi
阅读全文
摘要:Windows 下安装 下载地址:https://github.com/tporadowski/redis/releases。 Redis 支持 32 位和 64 位。这个需要根据你系统平台的实际情况选择,这里我们下载 Redis-x64-xxx.zip压缩包,解压后,将文件夹重新命名为 redis
阅读全文
摘要::: 和 -> 都是java8新特性中lambda表达式的一种,主要是大大减少了代码量,提高效率 lambda表达式通常都是采用左边方法右边参数的写法,例如: stu -> stu.getStuId() 同时这个写法也可以写成 stu :: stu.getAge 注意这里没有方法后面的括号,可以看如
阅读全文
摘要:package com.example.ep.test.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.
阅读全文
摘要:引入依赖 https://mvnrepository.com/ <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-generator</artifactId> <version>3.4.1</version>
阅读全文
摘要:基本数据类型都有一个默认值,如int的默认值是0,boolean的默认值是false, 包装类没有默认值,初始化值是NULL。 Integer变量必须实例化后才能使用,而int变量不需要 Integer实际是对象的引用,当new一个Integer时,实际上是生成一个指针指向此对象;而int则是直接存
阅读全文
摘要:说明: QueryWrapper(LambdaQueryWrapper) 和 UpdateWrapper(LambdaUpdateWrapper) 的父类用于生成 sql 的 where 条件, entity 属性也用于生成 sql 的 where 条件注意: entity 生成的 where 条件
阅读全文
摘要:官网文档地址: https://mp.baomidou.com/guide/ https://mybatis.plus/guide/ 一、引入依赖 https://mvnrepository.com/ <dependency> <groupId>com.baomidou</groupId> <art
阅读全文
摘要:一、在resources目录下创建文件 generatorConfig.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Ge
阅读全文
摘要:一、引入依赖 https://mvnrepository.com/ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <ve
阅读全文
摘要:一、引入外部依赖 https://mvnrepository.com/ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> <versio
阅读全文
摘要:一、引入外部依赖 https://mvnrepository.com/ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-activemq</artifactId> <ve
阅读全文
摘要:将A、B、C代码合并模块D,我们把它当做一个辅助构建模块,然后让A、B、C模块都依赖于D模块,这样的话就可以成功编译A、B和C模块 要想把A、B、C三个模块整合在一起编译,需要借助build-helper-maven-plugin插件,这个插件在Maven构建周期提供一些辅助功能,下面列出插件的提供
阅读全文
摘要:<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>o
阅读全文
摘要:package com.example.query; import java.io.Serializable; public class UserQuery implements Serializable { private Integer id; private String username;
阅读全文
摘要:HTTP状态码 当浏览者访问一个网页时,浏览者的浏览器会向网页所在服务器发出请求。当浏览器接收并显示网页前,此网页所在的服务器会返回一个包含HTTP状态码的信息头(server header)用以响应浏览器的请求。 HTTP状态码的英文为HTTP Status Code。 下面是常见的HTTP状态码
阅读全文
摘要:一、引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <d
阅读全文
摘要:https://mvnrepository.com/ pom.xml中加入: <build> <plugins> <plugin> <!-- <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugi
阅读全文
摘要:一、File -> New -> Project 或 Close Project -> Create New Project 一开始创建父工程,所以不用选中create from archetype,点击next 父工程创建后,由于是父工程,所以建议删除其中的src文件,接下来创建子项目,鼠标移到项
阅读全文
摘要:SpringBoot Maven install 报错 Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project demo
阅读全文
摘要:https://blog.csdn.net/u014411966/article/details/78164752
阅读全文
摘要:package org.sang; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry;
阅读全文
摘要:package com.example.service; import com.example.pojo.User; public interface UserService { User getUserByUsername(String username); } package com.examp
阅读全文
摘要:一、引入pom依赖 https://mvnrepository.com/ <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>3.0.0</version>
阅读全文
摘要:package com.example.interceptor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import org.
阅读全文
摘要:Filter 过滤器 是Java EE 提供的只能处理 ServletRequest 和 ServletResponse 里的相关信息,不能处理与Spring相关的信息 package com.example.interceptor; import org.slf4j.Logger; import
阅读全文
摘要:一、数据库表添加数据 二、代码 package com.example.pojo; import java.io.Serializable; import java.util.List; public class Menu implements Serializable { private Inte
阅读全文
摘要:一、创建数据库表 DROP TABLE IF EXISTS `vhr`.`user`; CREATE TABLE `vhr`.`user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(45) NOT NULL
阅读全文
摘要:一、添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> <version>2.4.4</version> </depen
阅读全文
摘要:angular.js:15697 TypeError: $http(...).success is not a function at Object.<anonymous> (books:136) at Object.invoke (angular.js:5208) at S.instance (a
阅读全文
摘要:<!-- <insert id="addBook" parameterType="com.example.pojo.Book"> INSERT INTO book(name,author) VALUES (#{name},#{author}) </insert> <insert id="addBoo
阅读全文
摘要:一、https://code.angularjs.org/ 下载 Angularjs 二、添加依赖 <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3
阅读全文
摘要:Idea的SpringBoot工程里遇到Could not autowire. No beans of ‘BookService’ type found。 解决办法: 换成@Resource spring中注解@Resource 与@Autowire 区别1.@Autowired按byType自动注
阅读全文
摘要:一、添加依赖 https://mvnrepository.com/ <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <versio
阅读全文
摘要:SpringBoot默认加入了jackson-databind作为JSON处理器。 package com.example.pojo; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.a
阅读全文
摘要:SpringBoot默认日志框架是 Logback, 使用 INFO 级别输出到控制台 日志级别:TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF 如果要SpringBoot将控制台中的日志写到日志文件中,需要在application.propert
阅读全文
摘要:org.thymeleaf.exceptions.TemplateInputException: Error resolving template [index], template might not exist or might not be accessible by any of the c
阅读全文
摘要:一、引入thymeleaf依赖 https://mvnrepository.com/ 1 <dependency> 2 <groupId>org.springframework.boot</groupId> 3 <artifactId>spring-boot-starter-thymeleaf</a
阅读全文