提交 dab8ee02 编写于 作者: 小傅哥's avatar 小傅哥

feat:功能配置和测试

上级 8e5e791b
......@@ -3,15 +3,18 @@ server:
application:
name: xfg-dev-tech-zookeeper
# zookeeper 自定义链接配置
zookeeper:
# ChatGLM SDK Config
chatglm:
sdk:
config:
connect-string: 192.168.1.103:2181
base-sleep-time-ms: 1000
max-retries: 3
session-timeout-ms: 18000
connection-timeout-ms: 30000
# 状态;true = 开启、false 关闭
enabled: true
# 官网地址
api-host: https://open.bigmodel.cn/
# 官网申请 https://open.bigmodel.cn/usercenter/apikeys
api-secret-key: 4e087e4135306ef4a676f0cce3c****.sg*****I
# 知识星球 Cookie 你需要获取你的 cookie 登录
cookie: zsxq_access_token=86******3C-941D-817CA1303C87_9D76*****
# 日志
logging:
......
......@@ -34,6 +34,9 @@ import java.io.IOException;
@Slf4j
public class HttpClientTest {
// F12 点接口,看标头里的信息 https://wx.zsxq.com/dweb2/index/group/28885518425541
private final String cookie = "zsxq_access_token=86EB233E***** 替换为你的";
@Test
public void test_httpClient_comments(){
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
......@@ -45,7 +48,7 @@ public class HttpClientTest {
httpPost.setHeader("accept-language", "zh-CN,zh;q=0.9,en;q=0.8");
httpPost.setHeader("authority", "api.zsxq.com");
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("origin", "https://wx.zsxq.com");
httpPost.setHeader("referer", "https://wx.zsxq.com/");
......@@ -87,7 +90,7 @@ public class HttpClientTest {
get.addHeader("accept", "application/json, text/plain, */*");
get.addHeader("accept-language", "zh-CN,zh;q=0.9,en;q=0.8");
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("origin", "https://wx.zsxq.com");
get.addHeader("referer", "https://wx.zsxq.com/");
......
......@@ -45,7 +45,7 @@ public class ZSXQJob {
@Autowired(required = false)
private OpenAiSession openAiSession;
private final Set<Long> topicIds = new HashSet<>();
private volatile Set<Long> topicIds = new HashSet<>();
@Value("${chatglm.sdk.config.cookie}")
private String cookie;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册