---恢复内容开始---

 

项目结构

springboot与redis

gradle配置文件:

dependencies {
    compile('org.springframework.boot:spring-boot-starter-cache')
    compile('org.springframework.boot:spring-boot-starter-data-redis')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2')
    compile('org.springframework.boot:spring-boot-starter-jdbc')
    runtime('mysql:mysql-connector-java')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}

 

application.yml

 

spring:
   datasource:
    url: jdbc:mysql://localhost:3306/test?characterEncoding=utf8&useSSL=false
    username: root
    password: root
    driver-class-name: com.mysql.jdbc.Driver
   redis:
     host: 140.143.1.xx  //ip地址
mybatis:
  configuration:
    map-underscore-to-camel-case: true #开启驼峰命名匹配

 

student实体类

public class Student implements Serializable {
    private Integer id;
    private String name;
    private Integer age;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
View Code

相关文章:

  • 2022-12-23
  • 2022-01-17
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
猜你喜欢
  • 2021-12-13
  • 2021-10-01
  • 2022-12-23
  • 2021-12-26
  • 2021-09-21
  • 2021-09-11
  • 2021-12-01
相关资源
相似解决方案