Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
aa655624
提交
aa655624
authored
3月 14, 2025
作者:
obcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【采集接口添加密钥】
上级
b80bcd3d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
24 行增加
和
5 行删除
+24
-5
ConfigurationMessageService.java
.../zzsn/event/service/impl/ConfigurationMessageService.java
+24
-5
没有找到文件。
src/main/java/com/zzsn/event/service/impl/ConfigurationMessageService.java
浏览文件 @
aa655624
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
...
...
@@ -123,10 +124,12 @@ public class ConfigurationMessageService {
private
String
allInfosourcebindUrl
;
@Value
(
"${caiji.allKeyWordsBind.url:http://1.95.79.85:8823/baseSourceInfo/api/subject/keywordSave}"
)
private
String
allKeyWordsBindUrl
;
@Value
(
"${caiji.projectCode:zzsn}"
)
@Value
(
"${caiji.projectCode:zzsn
_test
}"
)
private
String
projectCode
;
@Value
(
"${caiji.projectName:克虏宝}"
)
@Value
(
"${caiji.projectName:克虏宝
测试
}"
)
private
String
projectName
;
@Value
(
"${caiji.secretKey:BsEHuAQTifhnMBDni5xjTMkThpmWlNWR3vvYp1rPstQGbE6nmfBX9VhpwrBPWxrU}"
)
private
String
secretKey
;
@Autowired
(
required
=
false
)
private
RemoteModelService
remoteModelService
;
...
...
@@ -330,7 +333,7 @@ public class ConfigurationMessageService {
log
.
info
(
"专题关键词配置通知采集{}-{}"
,
allKeyWordsBindUrl
,
keyWordsParam
);
String
post
=
HttpUtil
.
p
ost
(
allKeyWordsBindUrl
,
keyWordsParam
);
String
post
=
doP
ost
(
allKeyWordsBindUrl
,
keyWordsParam
);
JSONObject
entries
=
JSONUtil
.
parseObj
(
post
);
//获取code状态码
Integer
code
=
entries
.
getInt
(
"code"
);
...
...
@@ -365,7 +368,7 @@ public class ConfigurationMessageService {
}
log
.
info
(
"专题信息源配置通知采集{}-{}"
,
allInfosourcebindUrl
,
getparam
);
String
post
=
HttpUtil
.
p
ost
(
allInfosourcebindUrl
,
getparam
);
String
post
=
doP
ost
(
allInfosourcebindUrl
,
getparam
);
JSONObject
entries
=
JSONUtil
.
parseObj
(
post
);
//获取code状态码
Integer
code
=
entries
.
getInt
(
"code"
);
...
...
@@ -390,7 +393,14 @@ public class ConfigurationMessageService {
param
.
put
(
"keywordSign"
,
byId
.
getId
());
param
.
put
(
"collectWordExp"
,
byId
.
getKeyWord
());
log
.
info
(
"编辑关键词通知采集{}-{}"
,
keyWordsEditUrl
,
JSONUtil
.
toJsonStr
(
param
));
HttpUtil
.
post
(
keyWordsEditUrl
,
JSONUtil
.
toJsonStr
(
param
));
String
post
=
doPost
(
keyWordsEditUrl
,
JSONUtil
.
toJsonStr
(
param
));
JSONObject
entries
=
JSONUtil
.
parseObj
(
post
);
//获取code状态码
Integer
code
=
entries
.
getInt
(
"code"
);
if
(
ObjectUtil
.
isEmpty
(
code
)
||
code
!=
200
)
{
log
.
error
(
"编辑关键词通知采集失败{}"
,
post
);
throw
new
RuntimeException
(
"编辑关键词通知采集失败"
);
}
}
//获取专题绑定的所有信息源id
...
...
@@ -574,6 +584,15 @@ public class ConfigurationMessageService {
}
private
String
doPost
(
String
urlString
,
String
body
){
HttpRequest
post
=
HttpUtil
.
createPost
(
urlString
);
post
.
body
(
body
);
post
.
header
(
"Content-Type"
,
"application/json"
);
post
.
header
(
"authkey"
,
secretKey
);
return
post
.
execute
().
body
();
}
//日期往前推 num 个月
public
static
LocalDateTime
getPreviousMonths
(
LocalDateTime
date
,
int
num
)
{
return
date
.
minusMonths
(
num
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论