feat: 添加前端对 SystemPromptTemplate 更新的完整支持

## 修改内容

### 后端 (api/server.go)
- handleGetTraderConfig 返回中添加 system_prompt_template 字段

### 前端类型定义 (web/src/types.ts)
- TraderConfigData 接口添加 system_prompt_template 字段

### 前端更新逻辑 (web/src/components/AITradersPage.tsx)
- handleSaveEditTrader 的更新请求中添加 system_prompt_template

## 完整数据流

```
后端数据库
  ↓ handleGetTraderConfig
前端 TraderConfigData (包含 system_prompt_template)
  ↓ TraderConfigModal (UI 编辑)
前端 UpdateRequest (包含 system_prompt_template)
  ↓ handleUpdateTrader
后端更新数据库
```

现在前后端已完全打通,用户可以在 UI 中编辑系统提示词模板了。
This commit is contained in:
Liu Xiang Qian
2025-11-03 22:19:58 +08:00
parent b0de71bdf5
commit c1f080f59f
3 changed files with 3 additions and 0 deletions

View File

@@ -838,6 +838,7 @@ func (s *Server) handleGetTraderConfig(c *gin.Context) {
"trading_symbols": traderConfig.TradingSymbols,
"custom_prompt": traderConfig.CustomPrompt,
"override_base_prompt": traderConfig.OverrideBasePrompt,
"system_prompt_template": traderConfig.SystemPromptTemplate,
"is_cross_margin": traderConfig.IsCrossMargin,
"use_coin_pool": traderConfig.UseCoinPool,
"use_oi_top": traderConfig.UseOITop,