From 80776bcd13779209ca9a9a4ec82f0ba69efeab0f Mon Sep 17 00:00:00 2001 From: zhouwentao <1577701412@qq.com> Date: Sat, 1 Mar 2025 15:15:18 +0800 Subject: [PATCH] updates --- .../java/org/jeecg/modules/yx/util/IpKit.java | 62 +++++++++++-------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/util/IpKit.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/util/IpKit.java index 5440773..48d2687 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/util/IpKit.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/util/IpKit.java @@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject; import org.jeecg.common.util.RestUtil; import javax.servlet.http.HttpServletRequest; +import java.util.Scanner; /** * @Description @@ -20,34 +21,43 @@ public class IpKit { private final static String UNKNOWN = "unknown"; public static void main(String[] args) { - String url = "http://ai.izcsz.com/api/v1/chat/completions"; - String authorization = "Bearer fastgpt-MBOxnysyhuzMMuLijtq1qYQa6dwIo6AsB0lR5L2r5ommMhBrRd0g9OKNwx4E6"; - String contentType = "application/json"; +// String url = "http://ai.izcsz.com/api/v1/chat/completions"; +// String authorization = "Bearer fastgpt-MBOxnysyhuzMMuLijtq1qYQa6dwIo6AsB0lR5L2r5ommMhBrRd0g9OKNwx4E6"; +// String contentType = "application/json"; +// +// JSONObject jsonObject = new JSONObject(); +// jsonObject.put("chatId", "abcd"); +// jsonObject.put("stream", false); +// jsonObject.put("detail", false); +// JSONObject variables = new JSONObject(); +// variables.put("nick", "亮亮"); +// jsonObject.put("variables", variables); +// +// // 创建一个 JSONArray 来包含消息对象 +// JSONArray messagesArray = new JSONArray(); +// JSONObject messageObject = new JSONObject(); +// messageObject.put("content", "坦克700北京多少钱能买"); +// messageObject.put("role", "user"); +// // 将消息对象添加到数组中 +// messagesArray.add(messageObject); +// +// // 将数组赋值给 "messages" 字段 +// jsonObject.put("messages", messagesArray); +// +// JSONObject headerJson = new JSONObject(); +// headerJson.put("Authorization", authorization); +// headerJson.put("Content-Type", contentType); +// JSONObject post = RestUtil.post(url, null, jsonObject,headerJson); +// System.out.println(post); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("chatId", "abcd"); - jsonObject.put("stream", false); - jsonObject.put("detail", false); - JSONObject variables = new JSONObject(); - variables.put("nick", "亮亮"); - jsonObject.put("variables", variables); - // 创建一个 JSONArray 来包含消息对象 - JSONArray messagesArray = new JSONArray(); - JSONObject messageObject = new JSONObject(); - messageObject.put("content", "坦克700北京多少钱能买"); - messageObject.put("role", "user"); - // 将消息对象添加到数组中 - messagesArray.add(messageObject); - - // 将数组赋值给 "messages" 字段 - jsonObject.put("messages", messagesArray); - - JSONObject headerJson = new JSONObject(); - headerJson.put("Authorization", authorization); - headerJson.put("Content-Type", contentType); - JSONObject post = RestUtil.post(url, null, jsonObject,headerJson); - System.out.println(post); + Scanner scan = new Scanner(System.in); + //在此输入您的代码... + String[] strs= scan.next().split(""); // 直接输入后转为字符串数组 + for(int i=strs.length-1;i>0;i++){ + System.out.print(strs[i]); + } + scan.close(); } public static String getRealIp(HttpServletRequest request) {