From 18f0313d01f3f9c647f1fdca7eea7ae75d3a7bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=AF=9A?= Date: Mon, 5 Jan 2026 15:57:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=9F=E6=88=90SQL?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=AF=AD=E5=8F=A5=E7=9A=84HTML=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=A0=BC=E5=BC=8F=EF=BC=8C=E4=BD=BF=E7=94=A8JSON?= =?UTF-8?q?=E5=BA=8F=E5=88=97=E5=8C=96=E5=8C=85=E8=A3=85=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/SmartHandleService.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Service/SmartHandleService.cs b/Service/SmartHandleService.cs index d1513ae..437dfe4 100644 --- a/Service/SmartHandleService.cs +++ b/Service/SmartHandleService.cs @@ -322,11 +322,14 @@ public class SmartHandleService( logger.LogInformation("AI生成的SQL: {Sql}", sqlText); chunkAction( - $""" -
-            生成的SQL查询语句:
-            {System.Net.WebUtility.HtmlEncode(sqlText)}
-            """
+                JsonSerializer.Serialize(new
+                {
+                    content = $"""
+                    
+                    {System.Net.WebUtility.HtmlEncode(sqlText)}
+                    
+ """ + }) ); // 第二步:执行动态SQL查询