commit e22e1b366a5e2dc725d18d1a5ebc91abf2667bfe Author: FalingCliff Date: Fri May 23 20:17:03 2025 +0800 初始化仓库 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/pom.xml b/pom.xml new file mode 100644 index 0000000..ad99c75 --- /dev/null +++ b/pom.xml @@ -0,0 +1,102 @@ + + + 4.0.0 + com.example + admin_server + 0.0.1-SNAPSHOT + admin_server + admin_server + + 1.8 + UTF-8 + UTF-8 + 2.6.13 + + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-web + + + + com.mysql + mysql-connector-j + 8.2.0 + runtime + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + com.github.xiaoymin + knife4j-openapi3-spring-boot-starter + 4.4.0 + + + org.springframework.boot + spring-boot-devtools + runtime + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.example.admin_server.AdminServerApplication + true + + + + repackage + + repackage + + + + + + + + diff --git a/src/main/java/com/example/admin_server/AdminServerApplication.java b/src/main/java/com/example/admin_server/AdminServerApplication.java new file mode 100644 index 0000000..410dc6d --- /dev/null +++ b/src/main/java/com/example/admin_server/AdminServerApplication.java @@ -0,0 +1,13 @@ +package com.example.admin_server; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class AdminServerApplication { + + public static void main(String[] args) { + SpringApplication.run(AdminServerApplication.class, args); + } + +} diff --git a/src/main/java/com/example/admin_server/controller/MainController.java b/src/main/java/com/example/admin_server/controller/MainController.java new file mode 100644 index 0000000..748a2b6 --- /dev/null +++ b/src/main/java/com/example/admin_server/controller/MainController.java @@ -0,0 +1,15 @@ +package com.example.admin_server.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +public class MainController { + + @GetMapping("/welcome") + public String welcome(){ + return "Hello World"; + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..14f6ed3 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,18 @@ +server: + port: 8080 + +spring: + datasource: + url: jdbc:mysql://localhost:3306/admin_server?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai + username: admin_server + password: iyzHSPYE3DzEThsY + +knife4j: + enable: true + setting: + language: zh-CN + documents: + - group: 默认分组 + name: Knife4j官方文档 + locations: + - com.example.admin_server.controller diff --git a/src/test/java/com/example/admin_server/AdminServerApplicationTests.java b/src/test/java/com/example/admin_server/AdminServerApplicationTests.java new file mode 100644 index 0000000..0989790 --- /dev/null +++ b/src/test/java/com/example/admin_server/AdminServerApplicationTests.java @@ -0,0 +1,13 @@ +package com.example.admin_server; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class AdminServerApplicationTests { + + @Test + void contextLoads() { + } + +}