Bladeren bron

plugin test

tanlie 1 jaar geleden
bovenliggende
commit
7b7290e7df

+ 20 - 1
chatgpt/pom.xml

@@ -22,7 +22,7 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
-       <dependency>
+        <dependency>
             <groupId>org.springframework.ai</groupId>
             <artifactId>spring-ai-openai-spring-boot-starter</artifactId>
         </dependency>
@@ -44,6 +44,19 @@
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
         </dependency>
+        <!--fastjson-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>2.0.32</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.32</version>
+        </dependency>
+
     </dependencies>
     <dependencyManagement>
         <dependencies>
@@ -63,6 +76,12 @@
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>io.github.git-commit-id</groupId>
+                <artifactId>git-commit-id-maven-plugin</artifactId>
+                <version>9.0.0</version>
+            </plugin>
+
         </plugins>
     </build>
     <repositories>

+ 0 - 1
chatgpt/src/main/java/cn/qinys/ai/chatgpt/envetlistner/ApplicationStartEventListener.java

@@ -11,7 +11,6 @@ import org.springframework.context.ApplicationListener;
  */
 
 public class ApplicationStartEventListener implements ApplicationListener<ApplicationStartedEvent> {
-
     @Override
     public void onApplicationEvent(ApplicationStartedEvent event) {
             System.err.println(event.getTimeTaken().getSeconds());

+ 32 - 0
chatgpt/src/test/java/cn/qinys/ai/chatgpt/controller/MessageControllerTest.java

@@ -0,0 +1,32 @@
+package cn.qinys.ai.chatgpt.controller;
+
+import cn.hutool.core.io.file.FileReader;
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import org.junit.jupiter.api.Test;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ * description:
+ *
+ * @author: tanlie
+ * @date: 2024/10/1
+ */
+class MessageControllerTest {
+
+    @Test
+    void test1() {
+    }
+
+
+    @Test
+    void readGitProperties() {
+        FileReader fileReader = new FileReader("git.properties", StandardCharsets.UTF_8);
+        String result = fileReader.readString();
+        //JSONObject jsonObject = JSON.parseObject(result);
+        System.err.println(result);
+
+
+    }
+}