Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
88773e55
提交
88773e55
authored
8月 18, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
事件分析优化
上级
f5510d77
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
122 行增加
和
67 行删除
+122
-67
EventAnalysisController.java
...va/com/zzsn/event/controller/EventAnalysisController.java
+51
-35
EventHomeController.java
...a/com/zzsn/event/controller/yjzx/EventHomeController.java
+13
-2
LlmService.java
src/main/java/com/zzsn/event/llm/LlmService.java
+5
-15
LlmServiceImpl.java
src/main/java/com/zzsn/event/llm/LlmServiceImpl.java
+4
-10
AnalysisServiceImpl.java
...java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
+22
-3
NetWorkEventTask.java
src/main/java/com/zzsn/event/task/NetWorkEventTask.java
+2
-2
application-dev.yml
src/main/resources/application-dev.yml
+25
-0
没有找到文件。
src/main/java/com/zzsn/event/controller/EventAnalysisController.java
浏览文件 @
88773e55
差异被折叠。
点击展开。
src/main/java/com/zzsn/event/controller/yjzx/EventHomeController.java
浏览文件 @
88773e55
...
...
@@ -174,8 +174,19 @@ public class EventHomeController {
*/
@GetMapping
(
"/hotWordRecommend"
)
public
Result
<?>
hotWordRecommend
(
@RequestParam
String
networkName
)
{
String
prompt
=
"请根据提供的百度/新浪热榜中的网络事件,再结合网络上资讯,推荐一些简短的关键词。以json格式输出:[\"关键词1\",\"关键词2\"]"
;
String
result
=
llmService
.
model
(
null
,
prompt
,
networkName
);
String
prompt
=
"你是一个专业信息采集助手,根据用户专题描述生成关键词表达式:\n"
+
"1. 用 + 表示与关系(必须同现),| 表示或关系(任一出现),用()分组\n"
+
"2. 执行三步操作:\n"
+
" (1) 提取核心实体(如企业/产品名)\n"
+
" (2) 将抽象词拆解为3-5个具体场景词(如\"动向\"→\"上升|下降|波动|结构调整\")\n"
+
" (3) 扩展同义词/行业关联词\n"
+
"3. 排除时间词,+号不超过2个,单组|内词不超过5个\n"
+
"4. 输出仅含表达式\n"
+
"\n"
+
"示例: \n"
+
"描述:苹果新款iPhone发布引发市场反响\n"
+
"输出:(苹果|iPhone)+(発売|価格|予約状況|市場シェア|消費者反応)"
;
String
result
=
llmService
.
model
(
null
,
null
,
prompt
,
networkName
);
if
(
result
.
startsWith
(
"```json"
))
{
result
=
result
.
substring
(
7
,
result
.
length
()
-
3
);
}
else
if
(
result
.
startsWith
(
"```"
))
{
...
...
src/main/java/com/zzsn/event/llm/LlmService.java
浏览文件 @
88773e55
...
...
@@ -8,21 +8,11 @@ public interface LlmService {
/**
* glm模型调用
*
* @param model 模型类型
* @param system 提示词
* @param content 引用内容
* @return 大模型响应结果
*/
String
model
(
String
model
,
String
system
,
String
content
);
/**
* 采集词推荐(定制自定义专题)
*
* @param modelType 模型类型
* @param modelName 模型名称
* @param prompt 提示词
* @param content 输入的内容
* @author lkg
* @date 2025/8/16
* @param system 提示词
* @param content 引用内容
* @return 大模型响应结果
*/
String
crawlerWord
(
String
modelName
,
String
prompt
,
String
content
);
String
model
(
String
modelType
,
String
modelName
,
String
system
,
String
content
);
}
src/main/java/com/zzsn/event/llm/LlmServiceImpl.java
浏览文件 @
88773e55
...
...
@@ -45,11 +45,14 @@ public class LlmServiceImpl implements LlmService {
private
LlmProperties
llmProperties
;
@Override
public
String
model
(
String
modelType
,
String
system
,
String
content
)
{
public
String
model
(
String
modelType
,
String
modelName
,
String
system
,
String
content
)
{
if
(
StringUtils
.
isEmpty
(
modelType
))
{
modelType
=
llmProperties
.
getDefaultModelType
();
}
LlmProperties
.
ModelConfig
modelConfig
=
llmProperties
.
getModelConfig
(
modelType
);
if
(
StringUtils
.
isNotEmpty
(
modelName
))
{
modelConfig
.
setDefaultModel
(
modelName
);
}
if
(
modelType
.
equalsIgnoreCase
(
"zhipu"
))
{
return
glmModel
(
modelConfig
,
system
,
content
);
}
else
if
(
modelType
.
equalsIgnoreCase
(
"qwen"
))
{
...
...
@@ -62,15 +65,6 @@ public class LlmServiceImpl implements LlmService {
return
null
;
}
@Override
public
String
crawlerWord
(
String
modelName
,
String
prompt
,
String
content
)
{
LlmProperties
.
ModelConfig
modelConfig
=
llmProperties
.
getModelConfig
(
"qwen"
);
if
(
StringUtils
.
isNotEmpty
(
modelName
))
{
modelConfig
.
setDefaultModel
(
modelName
);
}
return
qwenModel
(
modelConfig
,
prompt
,
content
);
}
/**
* glm模型调用
*
...
...
src/main/java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
浏览文件 @
88773e55
...
...
@@ -311,8 +311,27 @@ public class AnalysisServiceImpl implements AnalysisService {
if
(
llmConfig
==
null
)
{
return
null
;
}
String
result
=
llmService
.
model
(
llmConfig
.
getLlmName
(),
llmConfig
.
getLlmPrompt
(),
content
);
result
=
result
.
replaceAll
(
"```json"
,
""
).
replaceAll
(
"```"
,
""
);
String
result
=
llmService
.
model
(
llmConfig
.
getLlmName
(),
null
,
llmConfig
.
getLlmPrompt
(),
content
);
AnalysisColumnEnum
analysisColumnEnum
=
AnalysisColumnEnum
.
getByCode
(
llmConfig
.
getColumnCode
());
String
startHeader
=
null
;
if
(
analysisColumnEnum
!=
null
)
{
String
resType
=
analysisColumnEnum
.
getResType
();
if
(
resType
.
equals
(
"array"
))
{
startHeader
=
"["
;
}
else
if
(
resType
.
equals
(
"object"
))
{
startHeader
=
"{"
;
}
}
if
(
startHeader
!=
null
&&
!
result
.
startsWith
(
startHeader
))
{
if
(
result
.
startsWith
(
"```json"
))
{
result
=
result
.
substring
(
7
,
result
.
length
()
-
3
);
}
else
if
(
result
.
startsWith
(
"```"
))
{
result
=
result
.
substring
(
3
,
result
.
length
()
-
3
);
}
else
if
(
result
.
contains
(
startHeader
)){
result
=
result
.
substring
(
result
.
indexOf
(
startHeader
));
}
}
result
=
result
.
replaceAll
(
"```json"
,
""
).
replaceAll
(
"```"
,
""
);
if
(
llmConfig
.
getColumnCode
().
equals
(
AnalysisColumnEnum
.
IMPACT_ASSESSMENT
.
getCode
()))
{
EventLlmConfig
detailConfig
=
eventLlmConfigService
.
getConfig
(
event
.
getId
(),
AnalysisColumnEnum
.
IMPACT_ASSESSMENT_DETAIL
.
getCode
());
List
<
JSONObject
>
impactList
=
JSON
.
parseArray
(
result
,
JSONObject
.
class
);
...
...
@@ -321,7 +340,7 @@ public class AnalysisServiceImpl implements AnalysisService {
params
.
put
(
"eventName"
,
event
.
getEventName
());
params
.
put
(
"eventSummary"
,
event
.
getEventDescribe
());
params
.
put
(
"impactOutline"
,
impact
);
String
impactDetail
=
llmService
.
model
(
detailConfig
.
getLlmName
(),
detailConfig
.
getLlmPrompt
(),
params
.
toJSONString
());
String
impactDetail
=
llmService
.
model
(
detailConfig
.
getLlmName
(),
null
,
detailConfig
.
getLlmPrompt
(),
params
.
toJSONString
());
impact
.
put
(
"impactDetail"
,
impactDetail
);
}
result
=
JSON
.
toJSONString
(
impactList
);
...
...
src/main/java/com/zzsn/event/task/NetWorkEventTask.java
浏览文件 @
88773e55
...
...
@@ -71,7 +71,7 @@ public class NetWorkEventTask {
public
void
test
(
Integer
type
)
{
List
<
EventNetwork
>
networkList
=
getNetWordEventList
(
type
);
String
response
=
llmService
.
model
(
null
,
PROMPT
,
JSONObject
.
toJSONString
(
networkList
));
String
response
=
llmService
.
model
(
null
,
null
,
PROMPT
,
JSONObject
.
toJSONString
(
networkList
));
if
(
response
.
contains
(
"```json"
))
{
response
=
response
.
substring
(
response
.
indexOf
(
"```json"
)
+
7
,
response
.
lastIndexOf
(
"```"
));
}
...
...
@@ -109,7 +109,7 @@ public class NetWorkEventTask {
}
if
(
CollectionUtils
.
isNotEmpty
(
finalList
))
{
finalList
.
forEach
(
network
->
network
.
setLatest
(
1
));
String
response
=
llmService
.
model
(
null
,
PROMPT
,
JSONObject
.
toJSONString
(
finalList
));
String
response
=
llmService
.
model
(
null
,
null
,
PROMPT
,
JSONObject
.
toJSONString
(
finalList
));
if
(
StringUtils
.
isNotEmpty
(
response
))
{
try
{
if
(
response
.
contains
(
"```json"
))
{
...
...
src/main/resources/application-dev.yml
浏览文件 @
88773e55
...
...
@@ -183,3 +183,28 @@ caiji:
data-permit
:
dataPermitGetQueryEntityTest
:
http://1.95.77.159:10089/permission/
dataPermitGetQueryEntityProd
:
http://1.95.14.24:8060/
model
:
default-modelType
:
zhipu
configs
:
-
modelType
:
zhipu
modelTypeName
:
智谱
url
:
https://open.bigmodel.cn/api/paas/v4/chat/completions
api-key
:
c5a53bd5f95a4e37a8997deb5d0c6031.orXyRRPNvZiqRaxF
default-model
:
glm-4-flash
#免费
web-search
:
true
-
modelType
:
qwen
modelTypeName
:
千问
url
:
https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
api-key
:
sk-01ee9a6efa394178993a950b768e3753
default-model
:
qwen-plus
#收费
-
modelType
:
deepseek
modelTypeName
:
deepseek
url
:
https://api.deepseek.com/v1/chat/completions
api-key
:
sk-656a8ec451dc47aaad3dacf24fe36f20
default-model
:
deepseek-chat
#收费
-
modelType
:
doubao
modelTypeName
:
豆包
url
:
https://ark.cn-beijing.volces.com/api/v3/chat/completions
api-key
:
ab54c534-4f3c-41b9-9b27-132cb7954b6f
default-model
:
doubao-1-5-pro-32k-250115
# Doubao-1.5-pro-32k #收费
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论