From c654f079bd02d82d4df3cdba8715f78684cc43ce Mon Sep 17 00:00:00 2001 From: wenxin <1731551615@qq.com> Date: Sun, 24 Nov 2024 08:44:46 +0000 Subject: [PATCH] Initial commit --- .gitignore | 33 +++++++ LICENSE | 9 ++ README.md | 3 + pom.xml | 94 +++++++++++++++++++ .../linxyun/homework/HomeworkApplication.java | 15 +++ src/main/resources/application.yml | 35 +++++++ src/main/resources/static/index.html | 6 ++ .../homework/HomeworkApplicationTests.java | 13 +++ 8 files changed, 208 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 pom.xml create mode 100644 src/main/java/com/linxyun/homework/HomeworkApplication.java create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/static/index.html create mode 100644 src/test/java/com/linxyun/homework/HomeworkApplicationTests.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### 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/LICENSE b/LICENSE new file mode 100644 index 0000000..c07e9da --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2024 wenxin + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9a849a9 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# sb-mp-template + +springboot + mybatis-plus + lombok + druid \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8525c28 --- /dev/null +++ b/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + com.linxyun + homework + 0.0.1-SNAPSHOT + homework + homework + + 17 + UTF-8 + UTF-8 + 2.7.6 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + mysql + mysql-connector-java + 8.0.33 + + + + + com.baomidou + mybatis-plus-boot-starter + 3.5.9 + + + com.alibaba + druid-spring-boot-starter + 1.2.22 + + + org.projectlombok + lombok + 1.18.34 + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 17 + 17 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.linxyun.homework.HomeworkApplication + true + + + + repackage + + repackage + + + + + + + + diff --git a/src/main/java/com/linxyun/homework/HomeworkApplication.java b/src/main/java/com/linxyun/homework/HomeworkApplication.java new file mode 100644 index 0000000..a1df4fc --- /dev/null +++ b/src/main/java/com/linxyun/homework/HomeworkApplication.java @@ -0,0 +1,15 @@ +package com.linxyun.homework; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@MapperScan("com.linxyun.homework.mapper") +public class HomeworkApplication { + + public static void main(String[] args) { + SpringApplication.run(HomeworkApplication.class, args); + } + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..ac1f6ca --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,35 @@ +# 应用服务 WEB 访问端口 +server: + port: 8080 + +spring: #springboot的配置 + datasource: #定义数据源 + #127.0.0.1为本机测试的ip,3306是mysql的端口号。serverTimezone是定义时区,照抄就好,mysql高版本需要定义这些东西 + #useSSL也是某些高版本mysql需要问有没有用SSL连接 + url: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=GMT%2B8&useSSL=FALSE + username: root #数据库用户名,root为管理员 + password: 123456 #该数据库用户的密码 + # 使用druid数据源 + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + +# mybatis-plus相关配置 +mybatis-plus: + # xml扫描,多个目录用逗号或者分号分隔(告诉 Mapper 所对应的 XML 文件位置) + mapper-locations: classpath:mapper/*.xml + # 指定 MyBatis 别名包扫描路径,用于给包中的类注册别名。注册后,在 Mapper 对应的 XML 文件中可以直接使用类名,无需使用全限定类名。 + type-aliases-package: com.linxyun.homework.domain + # 以下配置均有默认值,可以不设置 + global-config: + db-config: + # 表名前缀 + tablePrefix: tab_ + #主键类型 AUTO:"数据库ID自增" INPUT:"用户输入ID",ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: auto + configuration: + # 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射 + map-underscore-to-camel-case: true + # 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段 + call-setters-on-nulls: true + # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl \ No newline at end of file diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html new file mode 100644 index 0000000..89bb8ba --- /dev/null +++ b/src/main/resources/static/index.html @@ -0,0 +1,6 @@ + + +

hello word!!!

+

this is a html page

+ + \ No newline at end of file diff --git a/src/test/java/com/linxyun/homework/HomeworkApplicationTests.java b/src/test/java/com/linxyun/homework/HomeworkApplicationTests.java new file mode 100644 index 0000000..a099d9a --- /dev/null +++ b/src/test/java/com/linxyun/homework/HomeworkApplicationTests.java @@ -0,0 +1,13 @@ +package com.linxyun.homework; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class HomeworkApplicationTests { + + @Test + void contextLoads() { + } + +}