Browse Source

Merge branch 'fixbug/359-bowen-balance-to-int64'

* fixbug/359-bowen-balance-to-int64:
  fixbug
boweniac 2 days ago
parent
commit
bd7f8032db

+ 1 - 1
desc/wechat/dashboard.api

@@ -64,7 +64,7 @@ type (
         Count string `json:"count"`
         Rate *float32 `json:"rate"`
         Label []string `json:"label"`
-        Val []float64 `json:"val"`
+        Val []string `json:"val"`
         LabelText string `json:"labelText"`
         Tip *string `json:"tip"`
     }

+ 6 - 1
internal/logic/dashboard/get_charts_logic.go

@@ -501,9 +501,14 @@ func (l *GetChartsLogic) GetCharts(req *types.ChartsReq) (resp *types.ChartsResp
 	}
 	accountBalance.Count = 0
 
+	vals := make([]string, 0)
+	for _, val := range consumeCoin.Val {
+		vals = append(vals, fmt.Sprintf("%.6f", val))
+	}
+
 	consumeCoinInt := types.ChartsStr{}
 	consumeCoinInt.Count = fmt.Sprintf("%.6f", consumeCoin.Count)
-	consumeCoinInt.Val = consumeCoin.Val
+	consumeCoinInt.Val = vals
 	consumeCoinInt.Label = consumeCoin.Label
 	consumeCoinInt.LabelText = consumeCoin.LabelText
 

+ 6 - 6
internal/types/types.go

@@ -3623,12 +3623,12 @@ type ChartsMix struct {
 }
 
 type ChartsStr struct {
-	Count     string    `json:"count"`
-	Rate      *float32  `json:"rate"`
-	Label     []string  `json:"label"`
-	Val       []float64 `json:"val"`
-	LabelText string    `json:"labelText"`
-	Tip       *string   `json:"tip"`
+	Count     string   `json:"count"`
+	Rate      *float32 `json:"rate"`
+	Label     []string `json:"label"`
+	Val       []string `json:"val"`
+	LabelText string   `json:"labelText"`
+	Tip       *string  `json:"tip"`
 }
 
 type ChartsInt struct {

+ 2 - 2
internal/utils/compapi/form.go

@@ -47,7 +47,7 @@ func (me *FormClient) BuildRequest(req *types.CompApiReq) error {
 	//先重构message
 	newMessSlice := make([]types.StdCompMessage, 2)
 	newMessSlice[0] = types.StdCompMessage{Role: "system", Content: `# 任务
-请帮助user从通话记录中提取表单值,并返回一个JSON格式的表单值。
+请帮助user从聊天记录中提取表单值,并返回一个JSON格式的表单值。
 
 # 背景信息
 当前时间是:` + nowTime + `
@@ -61,7 +61,7 @@ func (me *FormClient) BuildRequest(req *types.CompApiReq) error {
 * 如表单类型为 date,返回示例:["2025-01-01"]
 * 如没有找到某个表单相关的值,请不要返回该表单`}
 
-	newMessSlice[1] = types.StdCompMessage{Role: "user", Content: `# 表单数据
+	newMessSlice[1] = types.StdCompMessage{Role: "user", Content: `# 待提取表单
 ` + req.Variables["form_data"] + `
 
 # 聊天记录