优化生成SQL查询语句的HTML输出格式,使用JSON序列化包装内容
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 21s
Docker Build & Deploy / Deploy to Production (push) Successful in 6s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s

This commit is contained in:
孙诚
2026-01-05 15:57:22 +08:00
parent 34c6416538
commit 18f0313d01

View File

@@ -322,11 +322,14 @@ public class SmartHandleService(
logger.LogInformation("AI生成的SQL: {Sql}", sqlText);
chunkAction(
$"""
<pre style="max-height: 150px; font-size: 12px; overflow-y: auto; padding: 8px; border: none;">
SQL查询语句
{System.Net.WebUtility.HtmlEncode(sqlText)}
"""
JsonSerializer.Serialize(new
{
content = $"""
<pre style="max-height: 150px; font-size: 12px; overflow-y: auto; padding: 8px; border: none;">
{System.Net.WebUtility.HtmlEncode(sqlText)}
</pre>
"""
})
);
// 第二步执行动态SQL查询