From 26d6fcdf7f16c0b7c16c8348e29f1a57845328d5 Mon Sep 17 00:00:00 2001 From: huangge1199 Date: Tue, 13 May 2025 22:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 2 + .gitignore | 33 +++++++ pom.xml | 91 +++++++++++++++++++ .../aiagent/LongAiAgentApplication.java | 13 +++ .../aiagent/controller/HealthController.java | 21 +++++ src/main/resources/application.yml | 24 +++++ .../aiagent/LongAiAgentApplicationTests.java | 13 +++ 7 files changed, 197 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/com/huangge1199/aiagent/LongAiAgentApplication.java create mode 100644 src/main/java/com/huangge1199/aiagent/controller/HealthController.java create mode 100644 src/main/resources/application.yml create mode 100644 src/test/java/com/huangge1199/aiagent/LongAiAgentApplicationTests.java diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3b41682 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/mvnw text eol=lf +*.cmd text eol=crlf 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..0d5c05a --- /dev/null +++ b/pom.xml @@ -0,0 +1,91 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.4.5 + + + com.huangge1199 + long-ai-agent + 0.0.1-SNAPSHOT + long-ai-agent + long-ai-agent + + + + + + + + + + + + + + + 21 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.projectlombok + lombok + true + 1.18.36 + + + org.springframework.boot + spring-boot-starter-test + test + + + cn.hutool + hutool-all + 5.8.37 + + + com.github.xiaoymin + knife4j-openapi3-jakarta-spring-boot-starter + 4.4.0 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.projectlombok + lombok + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + diff --git a/src/main/java/com/huangge1199/aiagent/LongAiAgentApplication.java b/src/main/java/com/huangge1199/aiagent/LongAiAgentApplication.java new file mode 100644 index 0000000..8ab3ce0 --- /dev/null +++ b/src/main/java/com/huangge1199/aiagent/LongAiAgentApplication.java @@ -0,0 +1,13 @@ +package com.huangge1199.aiagent; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class LongAiAgentApplication { + + public static void main(String[] args) { + SpringApplication.run(LongAiAgentApplication.class, args); + } + +} diff --git a/src/main/java/com/huangge1199/aiagent/controller/HealthController.java b/src/main/java/com/huangge1199/aiagent/controller/HealthController.java new file mode 100644 index 0000000..25cdf88 --- /dev/null +++ b/src/main/java/com/huangge1199/aiagent/controller/HealthController.java @@ -0,0 +1,21 @@ +package com.huangge1199.aiagent.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * HealthController + * + * @author huangge1199 + * @since 2025/5/12 12:39:40 + */ +@RestController +@RequestMapping("/health") +public class HealthController { + + @GetMapping + public String healthCheck() { + return "OK"; + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..7172289 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,24 @@ +spring: + application: + name: long-ai-agent +server: + port: 8123 + servlet: + context-path: /api +# springdoc-openapi???? +springdoc: + swagger-ui: + path: /swagger-ui.html + tags-sorter: alpha + operations-sorter: alpha + api-docs: + path: /v3/api-docs + group-configs: + - group: 'default' + paths-to-match: '/**' + packages-to-scan: com.huangge1199.aiagent.controller +# knife4j +knife4j: + enable: true + setting: + language: zh_cn \ No newline at end of file diff --git a/src/test/java/com/huangge1199/aiagent/LongAiAgentApplicationTests.java b/src/test/java/com/huangge1199/aiagent/LongAiAgentApplicationTests.java new file mode 100644 index 0000000..b6efa21 --- /dev/null +++ b/src/test/java/com/huangge1199/aiagent/LongAiAgentApplicationTests.java @@ -0,0 +1,13 @@ +package com.huangge1199.aiagent; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class LongAiAgentApplicationTests { + + @Test + void contextLoads() { + } + +}