From c2ba8234d0ece4ab186c4816c1d50007ca64c713 Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Wed, 23 Apr 2025 17:04:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E6=8B=BC=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gj/district/FangjiaClientUtils.groovy | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy index fd1066677..f7b23f7f6 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/FangjiaClientUtils.groovy @@ -2,6 +2,9 @@ package com.fangjia.script.gj.district import com.fangjia.core.util.HttpRequest import com.fangjia.script.temp.shenjian.util.HttpUtils +import com.fangjia.script.util.DateUtils +import com.fangjia.script.yinjihaun.util.HttpClient +import com.mongodb.BasicDBObject import net.sf.json.JSONArray import net.sf.json.JSONObject @@ -401,7 +404,7 @@ class FangjiaClientUtils { def content = null def points = [] try { - def url = "http://192.168.0.19:31080/FangJiaNlpService/convert?locations="+URLEncoder.encode(locationstr,"UTF-8")+"&coordsys=${type}" + def url = "http://didata-uat-server.fangjia.com/FangJiaNlpService/convert?locations="+URLEncoder.encode(locationstr,"UTF-8")+"&coordsys=${type}" content = new HttpRequest().newGet(url, null, "utf-8") jsonObj = JSONObject.fromObject(content) @@ -419,4 +422,26 @@ class FangjiaClientUtils { return null; } + static def aiResult(content){ + def headers = [:] + headers.put("accept", "application/json") + headers.put("Content-Type", "application/json") + + def url = "http://didata-cloud-server.fangjia.com/chat/deepseek" + try { + Map params = new HashMap(); + params.put("content", content); + + String result = HttpClient.post(url, params, headers, "utf-8", true) + println result + if (result) { + def json = JSONObject.fromObject(result) + return json + } + } catch (Exception e) { + println e.getMessage() + } + return null + } + }