From a6cf0a7010589d2d5511197933a37e7bb90c4d69 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Wed, 11 May 2022 20:01:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=9B=86=E6=88=90=20mybatis-plus=20?= =?UTF-8?q?=E5=92=8C=20mybatis-plus=20=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 38 ++++++++++++++----- .../xxyopen/novel/NovelApplication.java | 2 + 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 662b4ce..fbcc022 100644 --- a/pom.xml +++ b/pom.xml @@ -15,28 +15,46 @@ <description>Spring Boot 3 + Vue 3 构建的前后端分离小说系统</description> <properties> <java.version>17</java.version> + <mybatis-plus.version>3.5.1</mybatis-plus.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> - </dependency> - <dependency> - <groupId>org.mybatis.spring.boot</groupId> - <artifactId>mybatis-spring-boot-starter</artifactId> - <version>2.2.2</version> <exclusions> + <!-- Exclude the Tomcat dependency --> <exclusion> <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-jdbc</artifactId> + <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> + <!-- Use Jetty instead --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-undertow</artifactId> + </dependency> + + <!-- mybatis-plus 相关 --> + <dependency> + <groupId>com.baomidou</groupId> + <artifactId>mybatis-plus-boot-starter</artifactId> + <version>${mybatis-plus.version}</version> + </dependency> + <dependency> + <groupId>com.baomidou</groupId> + <artifactId>mybatis-plus-generator</artifactId> + <version>${mybatis-plus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity-engine-core</artifactId> + <version>2.3</version> + <scope>compile</scope> + <optional>true</optional> + </dependency> + <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> diff --git a/src/main/java/io/github/xxyopen/novel/NovelApplication.java b/src/main/java/io/github/xxyopen/novel/NovelApplication.java index 36a117a..fb91b74 100644 --- a/src/main/java/io/github/xxyopen/novel/NovelApplication.java +++ b/src/main/java/io/github/xxyopen/novel/NovelApplication.java @@ -1,9 +1,11 @@ package io.github.xxyopen.novel; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication +@MapperScan("io.github.xxyopen.novel.dao.mapper") public class NovelApplication { public static void main(String[] args) {