From 2c37c19cc9e14667048162a0f024f75656a46e26 Mon Sep 17 00:00:00 2001 From: Yutou <583819556@qq.com> Date: Mon, 6 May 2024 10:51:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E7=99=BE=E5=BA=A6key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yutou/qqbot/QQBotApplication.java | 2 +- src/main/java/com/yutou/qqbot/QQBotController.java | 6 ------ src/main/java/com/yutou/qqbot/utlis/BaiduGPTManager.java | 6 +++--- src/main/java/com/yutou/qqbot/utlis/BangumiTools.java | 2 -- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/yutou/qqbot/QQBotApplication.java b/src/main/java/com/yutou/qqbot/QQBotApplication.java index 87a9dda..f98246a 100644 --- a/src/main/java/com/yutou/qqbot/QQBotApplication.java +++ b/src/main/java/com/yutou/qqbot/QQBotApplication.java @@ -10,7 +10,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class QQBotApplication { - public static final String version = "QQBot v.1.7.1"; + public static final String version = "QQBot v.1.7.2"; public static void main(String[] args) { System.out.println("version = " + version); diff --git a/src/main/java/com/yutou/qqbot/QQBotController.java b/src/main/java/com/yutou/qqbot/QQBotController.java index 1d63eb7..2d76914 100644 --- a/src/main/java/com/yutou/qqbot/QQBotController.java +++ b/src/main/java/com/yutou/qqbot/QQBotController.java @@ -50,11 +50,6 @@ public class QQBotController { @ResponseBody @RequestMapping("/napcat/qq/bot.do") public String qq_bot(HttpServletRequest request, HttpServletResponse response) { - // 处理请求 - Set strings = request.getParameterMap().keySet(); - for (String key : strings) { - System.out.println(key + ":" + request.getParameter(key)); - } ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { BufferedInputStream stream = new BufferedInputStream(request.getInputStream()); @@ -65,7 +60,6 @@ public class QQBotController { outputStream.flush(); } String str = outputStream.toString(StandardCharsets.UTF_8); - System.out.println("str = " + str); MessageEvent event = MessageEvent.parseHandle(str); long qqNumber = event.isGroup() ? event.getGroupId() : event.getUserId(); diff --git a/src/main/java/com/yutou/qqbot/utlis/BaiduGPTManager.java b/src/main/java/com/yutou/qqbot/utlis/BaiduGPTManager.java index 142f0cf..dd9fb0f 100644 --- a/src/main/java/com/yutou/qqbot/utlis/BaiduGPTManager.java +++ b/src/main/java/com/yutou/qqbot/utlis/BaiduGPTManager.java @@ -17,9 +17,9 @@ public class BaiduGPTManager { //4.0 private static final String url_4_0 = "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro"; private static String url = url_3_5; - private static final String AppID = "36678599"; - private static final String ApiKey = "eyHo6K2ILBm7if78701Az1eT"; - private static final String SecretKey = "U4vXt8AOTk9FgB0Omft5IOh6vwhzoDgZ"; + private static final String AppID = ConfigTools.load(ConfigTools.CONFIG,"baidu.gpt.appid", String.class); + private static final String ApiKey =ConfigTools.load(ConfigTools.CONFIG,"baidu.gpt.apikey", String.class); + private static final String SecretKey =ConfigTools.load(ConfigTools.CONFIG,"baidu.gpt.SecretKey", String.class); private final Map> msgMap; private BaiduGPTManager() { diff --git a/src/main/java/com/yutou/qqbot/utlis/BangumiTools.java b/src/main/java/com/yutou/qqbot/utlis/BangumiTools.java index 02e2b74..1ad0d99 100644 --- a/src/main/java/com/yutou/qqbot/utlis/BangumiTools.java +++ b/src/main/java/com/yutou/qqbot/utlis/BangumiTools.java @@ -3,8 +3,6 @@ package com.yutou.qqbot.utlis; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; -import com.yutou.qqbot.QQBotManager; -import com.yutou.qqbot.models.Model; import java.net.URLEncoder; import java.nio.charset.StandardCharsets;