Explorar o código

fix: go1.17不支持any, 改成interface

gaoyagang hai 1 ano
pai
achega
835a7f37f5

+ 4 - 4
datacenter_client/client/client_test.go

@@ -21,14 +21,14 @@ func TestCreateDcApiClient(t *testing.T) {
 
 	resp1, err1 := v1.FindWorkingUfByCycle(datacenter_client.FindWorkingUfByCycleReq{
 		ProjectId:       92,
-		DeviceCode:      "UF-4001D",
-		FilterCycle:     16,
+		DeviceCode:      "UF-4001C",
+		FilterCycle:     7,
 		Step:            26,
-		FilterTimeStart: 3046.00,
+		FilterTimeStart: 584.00,
 		FilterTimeEnd:   3546.00,
 		Limit:           5,
 	})
 
-	t.Log(resp1)
+	t.Logf("%#v", resp1)
 	t.Log(err1)
 }

+ 1 - 0
datacenter_client/types.go

@@ -107,6 +107,7 @@ type (
 		ProductPressure  float64
 		Tmp              float64
 		Flux             float64
+		Permeability     float64
 		FeedWqTurbidity  float64
 		FeedWqPh         int64
 		ProductWqPh      int64

+ 1 - 1
datacenter_client/v1/v1.go

@@ -68,7 +68,7 @@ func (d *DcApi) serviceUrl(serviceName string) string {
 }
 
 // 实际执行请求
-func (d *DcApi) call(r *httplib.HTTPRequest, resp any) error {
+func (d *DcApi) call(r *httplib.HTTPRequest, resp interface{}) error {
 	for _, bf := range d.options.DoBefore {
 		if err := bf(r); err != nil {
 			return err