From 6b6fbcd13926f6ca5dad39e96d0937cea4a70d24 Mon Sep 17 00:00:00 2001 From: SerLiunx <17689543@qq.com> Date: Fri, 8 Aug 2025 15:45:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9F=BA=E6=9C=AC=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E6=90=AD=E5=BB=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 94 ++++++++++++++++++- .../blog/PersonalBlogApplication.java | 23 +++++ src/main/resources/application-dev.yml | 7 ++ src/main/resources/application-local.yml | 0 src/main/resources/application.yml | 12 +++ src/main/resources/banner/banner.txt | 7 ++ 6 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/serliunx/blog/PersonalBlogApplication.java create mode 100644 src/main/resources/application-dev.yml create mode 100644 src/main/resources/application-local.yml create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/banner/banner.txt diff --git a/pom.xml b/pom.xml index f0a9fe4..2a6a793 100644 --- a/pom.xml +++ b/pom.xml @@ -9,9 +9,99 @@ 1.0.0 - 17 - 17 + 21 + 21 UTF-8 + + 3.5.4 + + 1.18.34 + + 9.4.0 + + 3.5.12 + + + + org.springframework.boot + spring-boot-starter-web + ${boot.version} + + + + + com.mysql + mysql-connector-j + ${mysql-connector.version} + + + + + com.baomidou + mybatis-plus-spring-boot3-starter + 3.5.12 + + + + org.springframework.boot + spring-boot-starter-jdbc + + + + + org.springframework.boot + spring-boot-autoconfigure + + + + + + org.springframework.boot + spring-boot-starter-jdbc + ${boot.version} + + + + org.slf4j + slf4j-api + + + + + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + + ${project.artifactId}-${project.version} + + + org.springframework.boot + spring-boot-maven-plugin + ${boot.version} + + + + repackage + + + + + org.projectlombok + lombok + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/serliunx/blog/PersonalBlogApplication.java b/src/main/java/com/serliunx/blog/PersonalBlogApplication.java new file mode 100644 index 0000000..0980ced --- /dev/null +++ b/src/main/java/com/serliunx/blog/PersonalBlogApplication.java @@ -0,0 +1,23 @@ +package com.serliunx.blog; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * 启动类 + * + * @author SerLiunx + * @since 2025/8/8 + */ +@EnableScheduling +@SpringBootApplication +@EnableTransactionManagement +@MapperScan("com.serliunx.blog.mapper") +public class PersonalBlogApplication { + public static void main(String[] args) { + SpringApplication.run(PersonalBlogApplication.class, args); + } +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..7743742 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,7 @@ +server: + port: 18080 +spring: + datasource: + url: jdbc:mysql://localhost:3306/personal_blog?autoReconnect=true&characterEncoding=utf8 + username: root +# password: password, # 密码不建议写在配置文件中, 建议利用Idea中的配置覆盖, 如果是其他IDE请自行斟酌 \ No newline at end of file diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..f4102ed --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,12 @@ +spring: + profiles: + active: dev + banner: + location: banner/banner.txt + charset: UTF-8 + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver +mybatis-plus: + global-config: + banner: false \ No newline at end of file diff --git a/src/main/resources/banner/banner.txt b/src/main/resources/banner/banner.txt new file mode 100644 index 0000000..81d497e --- /dev/null +++ b/src/main/resources/banner/banner.txt @@ -0,0 +1,7 @@ + + _________ .____ .__ + / _____/ ___________| | |__|__ __ ____ ___ ___ + \_____ \_/ __ \_ __ \ | | | | \/ \\ \/ / + / \ ___/| | \/ |___| | | / | \> < +/_______ /\___ >__| |_______ \__|____/|___| /__/\_ \ + \/ \/ \/ \/ \/ , PersonalBlog - 1.0.0, Supported by Spring Boot v${spring-boot.version}