boweniac 2 gün önce
ebeveyn
işleme
ce73a3d577

+ 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

@@ -500,9 +500,14 @@ func (l *GetChartsLogic) GetCharts(req *types.ChartsReq) (resp *types.ChartsResp
 		}
 	}
 
+	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 {