Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
KnowledgePlanet
road-map
xfg-dev-tech-http
提交
dab8ee02
xfg-dev-tech-http
项目概览
KnowledgePlanet
/
road-map
/
xfg-dev-tech-http
通知
42
Star
9
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
xfg-dev-tech-http
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
dab8ee02
编写于
10月 15, 2023
作者:
小傅哥
⛹
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:功能配置和测试
上级
8e5e791b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
16 addition
and
10 deletion
+16
-10
xfg-dev-tech-app/src/main/resources/application-dev.yml
xfg-dev-tech-app/src/main/resources/application-dev.yml
+10
-7
xfg-dev-tech-app/src/test/java/cn/bugstack/xfg/dev/tech/test/HttpClientTest.java
...st/java/cn/bugstack/xfg/dev/tech/test/HttpClientTest.java
+5
-2
xfg-dev-tech-trigger/src/main/java/cn/bugstack/xfg/dev/tech/job/ZSXQJob.java
...r/src/main/java/cn/bugstack/xfg/dev/tech/job/ZSXQJob.java
+1
-1
未找到文件。
xfg-dev-tech-app/src/main/resources/application-dev.yml
浏览文件 @
dab8ee02
...
@@ -3,15 +3,18 @@ server:
...
@@ -3,15 +3,18 @@ server:
application
:
application
:
name
:
xfg-dev-tech-zookeeper
name
:
xfg-dev-tech-zookeeper
#
zookeeper 自定义链接配置
#
ChatGLM SDK Config
zookeeper
:
chatglm
:
sdk
:
sdk
:
config
:
config
:
connect-string
:
192.168.1.103:2181
# 状态;true = 开启、false 关闭
base-sleep-time-ms
:
1000
enabled
:
true
max-retries
:
3
# 官网地址
session-timeout-ms
:
18000
api-host
:
https://open.bigmodel.cn/
connection-timeout-ms
:
30000
# 官网申请 https://open.bigmodel.cn/usercenter/apikeys
api-secret-key
:
4e087e4135306ef4a676f0cce3c****.sg*****I
# 知识星球 Cookie 你需要获取你的 cookie 登录
cookie
:
zsxq_access_token=86******3C-941D-817CA1303C87_9D76*****
# 日志
# 日志
logging
:
logging
:
...
...
xfg-dev-tech-app/src/test/java/cn/bugstack/xfg/dev/tech/test/HttpClientTest.java
浏览文件 @
dab8ee02
...
@@ -34,6 +34,9 @@ import java.io.IOException;
...
@@ -34,6 +34,9 @@ import java.io.IOException;
@Slf4j
@Slf4j
public
class
HttpClientTest
{
public
class
HttpClientTest
{
// F12 点接口,看标头里的信息 https://wx.zsxq.com/dweb2/index/group/28885518425541
private
final
String
cookie
=
"zsxq_access_token=86EB233E***** 替换为你的"
;
@Test
@Test
public
void
test_httpClient_comments
(){
public
void
test_httpClient_comments
(){
CloseableHttpClient
httpClient
=
HttpClientBuilder
.
create
().
build
();
CloseableHttpClient
httpClient
=
HttpClientBuilder
.
create
().
build
();
...
@@ -45,7 +48,7 @@ public class HttpClientTest {
...
@@ -45,7 +48,7 @@ public class HttpClientTest {
httpPost
.
setHeader
(
"accept-language"
,
"zh-CN,zh;q=0.9,en;q=0.8"
);
httpPost
.
setHeader
(
"accept-language"
,
"zh-CN,zh;q=0.9,en;q=0.8"
);
httpPost
.
setHeader
(
"authority"
,
"api.zsxq.com"
);
httpPost
.
setHeader
(
"authority"
,
"api.zsxq.com"
);
httpPost
.
setHeader
(
"content-type"
,
"application/json"
);
httpPost
.
setHeader
(
"content-type"
,
"application/json"
);
httpPost
.
setHeader
(
"cookie"
,
"zsxq_access_token=86EB233E-BBD0-1E3C-941D-817CA1303C87_9D76421394C6F474"
);
httpPost
.
setHeader
(
"cookie"
,
cookie
);
httpPost
.
setHeader
(
"dnt"
,
"1"
);
httpPost
.
setHeader
(
"dnt"
,
"1"
);
httpPost
.
setHeader
(
"origin"
,
"https://wx.zsxq.com"
);
httpPost
.
setHeader
(
"origin"
,
"https://wx.zsxq.com"
);
httpPost
.
setHeader
(
"referer"
,
"https://wx.zsxq.com/"
);
httpPost
.
setHeader
(
"referer"
,
"https://wx.zsxq.com/"
);
...
@@ -87,7 +90,7 @@ public class HttpClientTest {
...
@@ -87,7 +90,7 @@ public class HttpClientTest {
get
.
addHeader
(
"accept"
,
"application/json, text/plain, */*"
);
get
.
addHeader
(
"accept"
,
"application/json, text/plain, */*"
);
get
.
addHeader
(
"accept-language"
,
"zh-CN,zh;q=0.9,en;q=0.8"
);
get
.
addHeader
(
"accept-language"
,
"zh-CN,zh;q=0.9,en;q=0.8"
);
get
.
addHeader
(
"authority"
,
"api.zsxq.com"
);
get
.
addHeader
(
"authority"
,
"api.zsxq.com"
);
get
.
addHeader
(
"cookie"
,
"zsxq_access_token=86EB233E-BBD0-1E3C-941D-817CA1303C87_9D76421394C6F474"
);
get
.
addHeader
(
"cookie"
,
cookie
);
get
.
addHeader
(
"dnt"
,
"1"
);
get
.
addHeader
(
"dnt"
,
"1"
);
get
.
addHeader
(
"origin"
,
"https://wx.zsxq.com"
);
get
.
addHeader
(
"origin"
,
"https://wx.zsxq.com"
);
get
.
addHeader
(
"referer"
,
"https://wx.zsxq.com/"
);
get
.
addHeader
(
"referer"
,
"https://wx.zsxq.com/"
);
...
...
xfg-dev-tech-trigger/src/main/java/cn/bugstack/xfg/dev/tech/job/ZSXQJob.java
浏览文件 @
dab8ee02
...
@@ -45,7 +45,7 @@ public class ZSXQJob {
...
@@ -45,7 +45,7 @@ public class ZSXQJob {
@Autowired
(
required
=
false
)
@Autowired
(
required
=
false
)
private
OpenAiSession
openAiSession
;
private
OpenAiSession
openAiSession
;
private
final
Set
<
Long
>
topicIds
=
new
HashSet
<>();
private
volatile
Set
<
Long
>
topicIds
=
new
HashSet
<>();
@Value
(
"${chatglm.sdk.config.cookie}"
)
@Value
(
"${chatglm.sdk.config.cookie}"
)
private
String
cookie
;
private
String
cookie
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录