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

feat:功能配置和测试

上级 8e5e791b
...@@ -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:
......
...@@ -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/");
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册