From b9826e235c147bc5ca9b8cfd3f2a818460e25caf Mon Sep 17 00:00:00 2001 From: wanggeng888 <450292408@qq.com> Date: Thu, 21 Jan 2021 17:03:17 +0800 Subject: [PATCH] f --- .gitignore | 35 ++++++++ pom.xml | 89 +++++++++++++++++++ .../businesscard/BusinessCardApplication.java | 13 +++ src/main/resources/application.yml | 55 ++++++++++++ src/main/resources/mybatis/mybatis-config.xml | 17 ++++ .../BusinessCardApplicationTests.java | 13 +++ 6 files changed, 222 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/cn/com/tenlion/businesscard/BusinessCardApplication.java create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/mybatis/mybatis-config.xml create mode 100644 src/test/java/cn/com/tenlion/businesscard/BusinessCardApplicationTests.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..181ca6e --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ +.mvn +mvnw* + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..dad4ca9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,89 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.4.2 + + + cn.com.tenlion + business-card + 0.0.1-SNAPSHOT + business-card + 名片系统 + + + 1.8 + 1.1.9 + 5.1.1 + + + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.springframework.boot + spring-boot-starter-web + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.1.4 + + + + mysql + mysql-connector-java + runtime + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + com.github.pagehelper + pagehelper + ${pagehelper.version} + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + diff --git a/src/main/java/cn/com/tenlion/businesscard/BusinessCardApplication.java b/src/main/java/cn/com/tenlion/businesscard/BusinessCardApplication.java new file mode 100644 index 0000000..a5b42c7 --- /dev/null +++ b/src/main/java/cn/com/tenlion/businesscard/BusinessCardApplication.java @@ -0,0 +1,13 @@ +package cn.com.tenlion.businesscard; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class BusinessCardApplication { + + public static void main(String[] args) { + SpringApplication.run(BusinessCardApplication.class, args); + } + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..02eed40 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,55 @@ +server: + port: 8888 + servlet: + context-path: /businesscard + +spring: + main: + allow-bean-definition-overriding: true + servlet: + multipart: + max-file-size: 1GB + max-request-size: 1GB + datasource: + druid: + url: jdbc:mysql://127.0.0.1:3306/db_business_card?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC + db-type: mysql + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: root + initial-size: 2 + min-idle: 2 + max-active: 10 + # 配置获取连接等待超时的时间 + max-wait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + time-between-eviction-runs-millis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + min-evictable-idle-time-millis: 300000 + validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 10 + # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 + filter: + commons-log: + connection-logger-name: stat,wall,log4j + stat: + log-slow-sql: true + slow-sql-millis: 2000 + # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 + connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 + # 合并多个DruidDataSource的监控数据 + use-global-data-source-stat: true + +mybatis: + config-location: classpath:mybatis/mybatis-config.xml + mapper-locations: classpath*:mybatis/mapper/**/*.xml + +logging: + level: + root: error + com.cm: debug \ No newline at end of file diff --git a/src/main/resources/mybatis/mybatis-config.xml b/src/main/resources/mybatis/mybatis-config.xml new file mode 100644 index 0000000..e61e1dc --- /dev/null +++ b/src/main/resources/mybatis/mybatis-config.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/cn/com/tenlion/businesscard/BusinessCardApplicationTests.java b/src/test/java/cn/com/tenlion/businesscard/BusinessCardApplicationTests.java new file mode 100644 index 0000000..99398d8 --- /dev/null +++ b/src/test/java/cn/com/tenlion/businesscard/BusinessCardApplicationTests.java @@ -0,0 +1,13 @@ +package cn.com.tenlion.businesscard; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class BusinessCardApplicationTests { + + @Test + void contextLoads() { + } + +}