热加载配置
1. 根目录 pom.xml 文件中加入
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>runtime</scope>
</dependency>
2. src > resources > application.yml 添加配置文件
spring:
devtools:
restart:
enabled: true #设置开启热部署
additional-paths: src/main/java #重启目录
exclude: WEB-INF
3. 打开编译器自动构建项目
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210510155309589.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0dyZWF0V3pp,size_16,color_FFFFFF,t_70)
4. 搜索框中搜索 registry
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210510155553639.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0dyZWF0V3pp,size_16,color_FFFFFF,t_70)
数据库删除操作
@RequestMapping("/delete")
public String delete() {
UserExample userExample = new UserExample();
userExample.createCriteria().andUserNameEqualTo("李四");
userMapper.deleteByExample(userExample);
return "success";
}