Bläddra i källkod

Merge remote-tracking branch 'origin/master'

gaoyagang 1 år sedan
förälder
incheckning
20c190c3d3
2 ändrade filer med 17 tillägg och 15 borttagningar
  1. 14 14
      datacenter_client/types.go
  2. 3 1
      datacenter_client/v1/GetItemHistoryList.go

+ 14 - 14
datacenter_client/types.go

@@ -195,13 +195,15 @@ type (
 	}
 
 	ItemHistoryListReq struct {
-		ProjectId int
-		ItemName  string
-		Stime     string
-		Etime     string
-		Size      int
-		Interval  string // 时间单位 minute,h,day,s
-		Aggregator string // 聚合方式 min,max,avg,sum,realtime, new
+		ProjectId  int
+		ItemName   string
+		Stime      string
+		Etime      string
+		Size       int
+		Interval   string  // 时间单位 minute,h,day,s
+		Aggregator string  // 聚合方式 min,max,avg,sum,realtime, new
+		MaxVal     float64 `json:"max_val"`
+		MinVal     float64 `json:"min_val"`
 	}
 )
 
@@ -264,9 +266,9 @@ type (
 	}
 
 	ItemHistoryListResp struct {
-		Name   string `json:"name"`
-		Htime  string `json:"htime_at"`
-		Val    float64 `json:"val"`
+		Name  string  `json:"name"`
+		Htime string  `json:"htime_at"`
+		Val   float64 `json:"val"`
 	}
 
 	ItemHistoryListRespList struct {
@@ -285,12 +287,10 @@ type (
 	}
 
 	ItemHistoryListBody struct {
-		Code int                 `json:"code"`
-		Msg  string              `json:"msg"`
+		Code int                     `json:"code"`
+		Msg  string                  `json:"msg"`
 		Data ItemHistoryListRespList `json:"data"`
 	}
-
-
 )
 
 type (

+ 3 - 1
datacenter_client/v1/GetItemHistoryList.go

@@ -18,6 +18,8 @@ func (d *DcApi) GetItemHistoryList(req datacenter_client.ItemHistoryListReq) (re
 	h.Param("size", fmt.Sprintf("%d", req.Size))
 	h.Param("interval", req.Interval)
 	h.Param("aggregator", req.Aggregator)
+	h.Param("max_val", fmt.Sprintf("%f", req.MaxVal))
+	h.Param("min_val", fmt.Sprintf("%f", req.MinVal))
 
 	result := &datacenter_client.ItemHistoryListBody{}
 	err = d.call(h, result)
@@ -31,4 +33,4 @@ func (d *DcApi) GetItemHistoryList(req datacenter_client.ItemHistoryListReq) (re
 	}
 	resp = result.Data.List
 	return
-}
+}