SpringBoot入门学习(二)

记录学习,不进行正文展示

目录

1、application.yml和Application的快速创建

2、application.yml(推荐)

3、pom.xml

4、断言(多用于测试)

SpringBoot入门学习(二)_第1张图片

1、application.yml和Application的快速创建

安装插件

SpringBoot入门学习(二)_第2张图片

SpringBoot入门学习(二)_第3张图片

2、application.yml(推荐)

spring:
  datasource:
    driver-class-name: org.h2.Driver
    schema: classpath:db/schema-h2.sql
    data: classpath:db/data-h2.sql
    url: jdbc:h2:mem:test
    username: root
    password: 123
    logging:
      level:
      com.qinluyu: debug

3、pom.xml


    
        1.8
    
    
    
        spring-boot-starter-parent
        org.springframework.boot
        2.0.1.RELEASE
    
    
        
    
        org.springframework.boot
        spring-boot-starter-web
    
        
        
            org.springframework.boot
            spring-boot-starter-test
        
        
        
            mysql
            mysql-connector-java
            5.1.45
        
        
        
            tk.mybatis
            mapper-spring-boot-starter
            2.0.0
        
        
        
            org.springframework.boot
            spring-boot-starter-thymeleaf
        
        
        
            com.github.pagehelper
            pagehelper-spring-boot-starter
            1.2.3
        
    

4、断言(多用于测试)

Assert.assertEquals(26,list.size());

不适用前

SpringBoot入门学习(二)_第4张图片

使用后

SpringBoot入门学习(二)_第5张图片

5、lombok

import lombok.Data;

@Data
public class User {
    private Long id;
    private String name;
    private Integer age;
    private String email;
}

你可能感兴趣的:(学习,SpringBoot,后端,学习,spring,spring,boot,java,maven)