From 4374148fbe0afff337b10271ac21dca9663e1cb1 Mon Sep 17 00:00:00 2001
From: maojian <550076202@qq.com>
Date: Mon, 19 Jan 2026 09:36:49 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eai=E6=83=85=E6=84=9F=E6=8A=BD?=
=?UTF-8?q?=E5=8F=96=E6=9C=8D=E5=8A=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ai-service/.classpath | 40 +
ai-service/.gitignore | 1 +
ai-service/.project | 23 +
.../.settings/org.eclipse.core.resources.prefs | 5 +
ai-service/.settings/org.eclipse.jdt.core.prefs | 9 +
ai-service/.settings/org.eclipse.m2e.core.prefs | 4 +
ai-service/pom.xml | 195 ++++
.../src/main/java/com/bw/ai/Application.java | 19 +
.../src/main/java/com/bw/ai/cache/ConfigCache.java | 37 +
.../controller/EmotionTaskReceiveController.java | 32 +
.../service/EmotionExtractService.java | 18 +
.../service/EmotionTaskReceiveService.java | 14 +
.../service/impl/EmotionExtractServiceImpl.java | 160 ++++
.../impl/EmotionTaskReceiveServiceImpl.java | 50 +
.../main/java/com/bw/ai/entity/AppResultDoc.java | 38 +
.../src/main/java/com/bw/ai/entity/Constants.java | 110 +++
.../main/java/com/bw/ai/handler/MainHandler.java | 219 +++++
.../controller/TextTaskReceiveController.java | 39 +
.../ai/textextract/service/TextExtractService.java | 19 +
.../service/TextTaskReceiveService.java | 17 +
.../service/impl/TextExtractServiceImpl.java | 139 +++
.../service/impl/TextTaskReceiveServiceImpl.java | 55 ++
.../src/main/java/com/bw/ai/utils/DataUtil.java | 48 +
.../src/main/java/com/bw/ai/utils/DateUtil.java | 177 ++++
.../main/java/com/bw/ai/utils/DownLoadUtil.java | 1004 ++++++++++++++++++++
.../main/java/com/bw/ai/utils/EncryptionUtil.java | 27 +
.../src/main/java/com/bw/ai/utils/FileUtil.java | 104 ++
.../java/com/bw/ai/utils/GPTResultParseUtil.java | 99 ++
.../src/main/java/com/bw/ai/utils/OtherUtils.java | 33 +
.../src/main/java/com/bw/ai/utils/QueueUtil.java | 18 +
.../java/com/bw/ai/utils/ThrowMessageUtil.java | 23 +
ai-service/src/main/resources/bootstrap.yml | 52 +
ai-service/src/main/resources/emotionPrompt | 26 +
ai-service/src/main/resources/logback-spring.xml | 36 +
ai-service/src/main/resources/moodPrompt | 30 +
ai-service/src/main/resources/opinionPrompt | 38 +
ai-service/src/main/resources/prompt | 35 +
.../main/java/com/bw/ocr/handler/MainHandler.java | 1 -
pom.xml | 1 +
.../java/com/bw/translate/handler/MainHandler.java | 1 -
.../service/impl/TranslateTaskServiceImpl.java | 3 +-
41 files changed, 2995 insertions(+), 4 deletions(-)
create mode 100644 ai-service/.classpath
create mode 100644 ai-service/.gitignore
create mode 100644 ai-service/.project
create mode 100644 ai-service/.settings/org.eclipse.core.resources.prefs
create mode 100644 ai-service/.settings/org.eclipse.jdt.core.prefs
create mode 100644 ai-service/.settings/org.eclipse.m2e.core.prefs
create mode 100644 ai-service/pom.xml
create mode 100644 ai-service/src/main/java/com/bw/ai/Application.java
create mode 100644 ai-service/src/main/java/com/bw/ai/cache/ConfigCache.java
create mode 100644 ai-service/src/main/java/com/bw/ai/emotionextract/controller/EmotionTaskReceiveController.java
create mode 100644 ai-service/src/main/java/com/bw/ai/emotionextract/service/EmotionExtractService.java
create mode 100644 ai-service/src/main/java/com/bw/ai/emotionextract/service/EmotionTaskReceiveService.java
create mode 100644 ai-service/src/main/java/com/bw/ai/emotionextract/service/impl/EmotionExtractServiceImpl.java
create mode 100644 ai-service/src/main/java/com/bw/ai/emotionextract/service/impl/EmotionTaskReceiveServiceImpl.java
create mode 100644 ai-service/src/main/java/com/bw/ai/entity/AppResultDoc.java
create mode 100644 ai-service/src/main/java/com/bw/ai/entity/Constants.java
create mode 100644 ai-service/src/main/java/com/bw/ai/handler/MainHandler.java
create mode 100644 ai-service/src/main/java/com/bw/ai/textextract/controller/TextTaskReceiveController.java
create mode 100644 ai-service/src/main/java/com/bw/ai/textextract/service/TextExtractService.java
create mode 100644 ai-service/src/main/java/com/bw/ai/textextract/service/TextTaskReceiveService.java
create mode 100644 ai-service/src/main/java/com/bw/ai/textextract/service/impl/TextExtractServiceImpl.java
create mode 100644 ai-service/src/main/java/com/bw/ai/textextract/service/impl/TextTaskReceiveServiceImpl.java
create mode 100644 ai-service/src/main/java/com/bw/ai/utils/DataUtil.java
create mode 100644 ai-service/src/main/java/com/bw/ai/utils/DateUtil.java
create mode 100644 ai-service/src/main/java/com/bw/ai/utils/DownLoadUtil.java
create mode 100644 ai-service/src/main/java/com/bw/ai/utils/EncryptionUtil.java
create mode 100644 ai-service/src/main/java/com/bw/ai/utils/FileUtil.java
create mode 100644 ai-service/src/main/java/com/bw/ai/utils/GPTResultParseUtil.java
create mode 100644 ai-service/src/main/java/com/bw/ai/utils/OtherUtils.java
create mode 100644 ai-service/src/main/java/com/bw/ai/utils/QueueUtil.java
create mode 100644 ai-service/src/main/java/com/bw/ai/utils/ThrowMessageUtil.java
create mode 100644 ai-service/src/main/resources/bootstrap.yml
create mode 100644 ai-service/src/main/resources/emotionPrompt
create mode 100644 ai-service/src/main/resources/logback-spring.xml
create mode 100644 ai-service/src/main/resources/moodPrompt
create mode 100644 ai-service/src/main/resources/opinionPrompt
create mode 100644 ai-service/src/main/resources/prompt
diff --git a/ai-service/.classpath b/ai-service/.classpath
new file mode 100644
index 0000000..f7e4a1d
--- /dev/null
+++ b/ai-service/.classpath
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ai-service/.gitignore b/ai-service/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/ai-service/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/ai-service/.project b/ai-service/.project
new file mode 100644
index 0000000..e54a3f0
--- /dev/null
+++ b/ai-service/.project
@@ -0,0 +1,23 @@
+
+
+ ai-service
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.m2e.core.maven2Nature
+
+
diff --git a/ai-service/.settings/org.eclipse.core.resources.prefs b/ai-service/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..839d647
--- /dev/null
+++ b/ai-service/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding/=UTF-8
diff --git a/ai-service/.settings/org.eclipse.jdt.core.prefs b/ai-service/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..71df522
--- /dev/null
+++ b/ai-service/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,9 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/ai-service/.settings/org.eclipse.m2e.core.prefs b/ai-service/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/ai-service/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/ai-service/pom.xml b/ai-service/pom.xml
new file mode 100644
index 0000000..b25d0b6
--- /dev/null
+++ b/ai-service/pom.xml
@@ -0,0 +1,195 @@
+
+
+ 4.0.0
+
+ com.bw
+ opai-service-center
+ 0.0.1-SNAPSHOT
+
+ com.bw
+ ai-service
+ 0.0.1-SNAPSHOT
+ ai-service
+ http://maven.apache.org
+
+ UTF-8
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+ org.springframework.cloud
+ spring-cloud-starter-openfeign
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ org.projectlombok
+ lombok
+
+
+ com.alibaba
+ fastjson
+ 2.0.17
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.3
+
+
+ org.apache.httpcomponents
+ httpmime
+ 4.5.13
+
+
+ commons-lang
+ commons-lang
+ 2.6
+
+
+
+ com.squareup.okhttp3
+ okhttp
+ 4.9.3
+
+
+ org.springframework.kafka
+ spring-kafka
+
+
+
+ org.apache.poi
+ poi
+ 4.1.2
+
+
+
+ org.apache.poi
+ poi-ooxml
+ 4.1.2
+
+
+
+ org.apache.poi
+ poi-scratchpad
+ 4.1.2
+
+
+
+
+ org.apache.poi
+ poi-ooxml-schemas
+ 4.1.2
+
+
+
+
+
+
+
+
+ maven-clean-plugin
+ 3.1.0
+
+
+
+ maven-resources-plugin
+ 3.0.2
+
+
+ maven-compiler-plugin
+ 3.8.0
+
+
+ maven-surefire-plugin
+ 2.22.1
+
+
+ maven-jar-plugin
+ 3.0.2
+
+
+ maven-install-plugin
+ 2.5.2
+
+
+ maven-deploy-plugin
+ 2.8.2
+
+
+
+ maven-site-plugin
+ 3.7.1
+
+
+ maven-project-info-reports-plugin
+ 3.0.0
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ com.bw.ai.Application
+ ZIP
+
+
+ ${project.groupId}
+ ${project.artifactId}
+
+
+
+
+
+
+ repackage
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ 3.1.1
+
+
+ copy
+ package
+
+ copy-dependencies
+
+
+ jar
+ jar
+ runtime
+ ${project.build.directory}/libs
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ai-service/src/main/java/com/bw/ai/Application.java b/ai-service/src/main/java/com/bw/ai/Application.java
new file mode 100644
index 0000000..592bf20
--- /dev/null
+++ b/ai-service/src/main/java/com/bw/ai/Application.java
@@ -0,0 +1,19 @@
+package com.bw.ai;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+
+/**
+ * 系统接口启动类
+ * @author jian.mao
+ * @date 2025年12月30日
+ * @description
+ */
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+}
diff --git a/ai-service/src/main/java/com/bw/ai/cache/ConfigCache.java b/ai-service/src/main/java/com/bw/ai/cache/ConfigCache.java
new file mode 100644
index 0000000..05977bc
--- /dev/null
+++ b/ai-service/src/main/java/com/bw/ai/cache/ConfigCache.java
@@ -0,0 +1,37 @@
+package com.bw.ai.cache;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.Map;
+import java.util.concurrent.LinkedBlockingDeque;
+
+/**
+ * @author jian.mao
+ * @date 2022年11月11日
+ * @description 静态变量类
+ */
+@Slf4j
+public class ConfigCache {
+
+ /**启动条件**/
+ public static boolean isStart = true;
+ /*****文本抽取任务队列*****/
+ public static LinkedBlockingDeque