todo
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 28s
Docker Build & Deploy / Deploy to Production (push) Successful in 8s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s

This commit is contained in:
SunCheng
2026-02-02 16:59:24 +08:00
parent 6abc5f8b6d
commit 338bac20ce
9 changed files with 819 additions and 106 deletions

View File

@@ -1,4 +1,6 @@
namespace WebApi.Controllers;
using Service.AI;
namespace WebApi.Controllers;
[ApiController]
[Route("api/[controller]/[action]")]
@@ -224,7 +226,7 @@ public class TransactionCategoryController(
4. 使用单色fill=""currentColor""
5. 简洁的设计,适合作为应用图标";
var userPrompt = $"为分类"{category.Name}"{(category.Type == TransactionType.Expense ? "" : category.Type == TransactionType.Income ? "" : "")}生成一个SVG图标";
var userPrompt = $"为分类\"{category.Name}\"{(category.Type == TransactionType.Expense ? "" : category.Type == TransactionType.Income ? "" : "")}生成一个SVG图标";
var svgContent = await openAiService.ChatAsync(systemPrompt, userPrompt, timeoutSeconds: 30);
if (string.IsNullOrWhiteSpace(svgContent))
@@ -261,7 +263,7 @@ public class TransactionCategoryController(
return "更新分类图标失败".Fail<string>();
}
return svg.Ok();
return svg.Ok<string>();
}
catch (Exception ex)
{