Ver Fonte

Merge branch 'master' of http://git.greentech.org/gaoyagang/gt-common

zhangqian há 1 ano atrás
pai
commit
012e967392

+ 29 - 27
datacenter_client/types.go

@@ -69,33 +69,33 @@ type (
 		ProjectId           int64   `json:"project_id"`
 		DeviceCode          string  `json:"device_code"`
 		WaterTemperature    float64 `json:"water_temperature"`
-		FeedFlow_1St        float64 `json:"feed_flow_1_st"`
-		ConFlow_1St         float64 `json:"con_flow_1_st"`
-		ProductFlow_1St     float64 `json:"product_flow_1_st"`
-		FeedPressure_1St    float64 `json:"feed_pressure_1_st"`
-		ConPressure_1St     float64 `json:"con_pressure_1_st"`
-		ProductPressure_1St float64 `json:"product_pressure_1_st"`
-		Tmp_1St             float64 `json:"tmp_1_st"`
-		Flux_1St            float64 `json:"flux_1_st"`
-		Permeability_1St    float64 `json:"permeability_1_st"`
-		FeedFlow_2Nd        float64 `json:"feed_flow_2_nd"`
-		ConFlow_2Nd         float64 `json:"con_flow_2_nd"`
-		ProductFlow_2Nd     float64 `json:"product_flow_2_nd"`
-		FeedPressure_2Nd    float64 `json:"feed_pressure_2_nd"`
-		ConPressure_2Nd     float64 `json:"con_pressure_2_nd"`
-		ProductPressure_2Nd float64 `json:"product_pressure_2_nd"`
-		Tmp_2Nd             float64 `json:"tmp_2_nd"`
-		Flux_2Nd            float64 `json:"flux_2_nd"`
-		Permeability_2Nd    float64 `json:"permeability_2_nd"`
-		FeedFlow_3Th        float64 `json:"feed_flow_3_th"`
-		ConFlow_3Th         float64 `json:"con_flow_3_th"`
-		ProductFlow_3Th     float64 `json:"product_flow_3_th"`
-		FeedPressure_3Th    float64 `json:"feed_pressure_3_th"`
-		ConPressure_3Th     float64 `json:"con_pressure_3_th"`
-		ProductPressure_3Th float64 `json:"product_pressure_3_th"`
-		Tmp_3Th             float64 `json:"tmp_3_th"`
-		Flux_3Th            float64 `json:"flux_3_th"`
-		Permeability_3Th    float64 `json:"permeability_3_th"`
+		FeedFlow_1St        float64 `json:"feed_flow_1st"`
+		ConFlow_1St         float64 `json:"con_flow_1st"`
+		ProductFlow_1St     float64 `json:"product_flow_1st"`
+		FeedPressure_1St    float64 `json:"feed_pressure_1st"`
+		ConPressure_1St     float64 `json:"con_pressure_1st"`
+		ProductPressure_1St float64 `json:"product_pressure_1st"`
+		Tmp_1St             float64 `json:"tmp_1st"`
+		Flux_1St            float64 `json:"flux_1st"`
+		Permeability_1St    float64 `json:"permeability_1st"`
+		FeedFlow_2Nd        float64 `json:"feed_flow_2nd"`
+		ConFlow_2Nd         float64 `json:"con_flow_2nd"`
+		ProductFlow_2Nd     float64 `json:"product_flow_2nd"`
+		FeedPressure_2Nd    float64 `json:"feed_pressure_2nd"`
+		ConPressure_2Nd     float64 `json:"con_pressure_2nd"`
+		ProductPressure_2Nd float64 `json:"product_pressure_2nd"`
+		Tmp_2Nd             float64 `json:"tmp_2nd"`
+		Flux_2Nd            float64 `json:"flux_2nd"`
+		Permeability_2Nd    float64 `json:"permeability_2nd"`
+		FeedFlow_3Th        float64 `json:"feed_flow_3th"`
+		ConFlow_3Th         float64 `json:"con_flow_3th"`
+		ProductFlow_3Th     float64 `json:"product_flow_3th"`
+		FeedPressure_3Th    float64 `json:"feed_pressure_3th"`
+		ConPressure_3Th     float64 `json:"con_pressure_3th"`
+		ProductPressure_3Th float64 `json:"product_pressure_3th"`
+		Tmp_3Th             float64 `json:"tmp_3th"`
+		Flux_3Th            float64 `json:"flux_3th"`
+		Permeability_3Th    float64 `json:"permeability_3th"`
 		FeedWqTurbidity     float64 `json:"feed_wq_turbidity"`
 		FeedWqPh            int64   `json:"feed_wq_ph"`
 		ProductWqPh         int64   `json:"product_wq_ph"`
@@ -112,6 +112,8 @@ type (
 		FeedWqP             float64 `json:"feed_wq_p"`
 		ProductWqP          float64 `json:"product_wq_p"`
 		Step                int64   `json:"step"`
+		FilterTime          float64 `json:"filter_time"`
+		FilterCycle         int64   `json:"filter_cycle"`
 		CTime               string  `json:"c_time"`
 	}
 

+ 2 - 2
datacenter_client/v1/CreateAppInfo_test.go

@@ -9,8 +9,8 @@ import (
 var d = NewDcApi(ClientOptions{
 	HTTPSettings: httplib.HTTPSettings{},
 	ServerIp:     "47.96.12.136:8788",
-	AppName:      "add-test1",
-	AppSecret:    "7395fb0cfasyvasd705a2db44a19851a3dbd77f",
+	AppName:      "simulations",
+	AppSecret:    "e3fc084fda3d2a6628b9ce28abf21243",
 })
 
 func TestDcApi_CreateAppInfo(t *testing.T) {

+ 1 - 1
datacenter_client/v1/GetWorkingChestByCode.go

@@ -7,7 +7,7 @@ import (
 )
 
 func (d *DcApi) GetWorkingChestByCode(params datacenter_client.DcWorkingReq) (*datacenter_client.GetWorkingChestByCodeResp, error) {
-	serviceName := "/working-uf/cycle"
+	serviceName := "/working-chest/info"
 	h := httplib.Get(d.serviceUrl(serviceName))
 	h.Param("project_id", strconv.FormatInt(params.ProjectId, 10))
 	h.Param("device_code", params.DeviceCode)

+ 1 - 1
datacenter_client/v1/GetWorkingPumpByCode.go

@@ -7,7 +7,7 @@ import (
 )
 
 func (d *DcApi) GetWorkingPumpByCode(params datacenter_client.DcWorkingReq) (*datacenter_client.GetWorkingPumpByCodeResp, error) {
-	serviceName := "/working-uf/cycle"
+	serviceName := "/working-pump/info"
 	h := httplib.Get(d.serviceUrl(serviceName))
 	h.Param("project_id", strconv.FormatInt(params.ProjectId, 10))
 	h.Param("device_code", params.DeviceCode)

+ 1 - 1
datacenter_client/v1/GetWorkingRoByCode.go

@@ -7,7 +7,7 @@ import (
 )
 
 func (d *DcApi) GetWorkingRoByCode(params datacenter_client.DcWorkingReq) (*datacenter_client.GetWorkingRoByCodeResp, error) {
-	serviceName := "/working-uf/cycle"
+	serviceName := "/working-ro/info"
 	h := httplib.Get(d.serviceUrl(serviceName))
 	h.Param("project_id", strconv.FormatInt(params.ProjectId, 10))
 	h.Param("device_code", params.DeviceCode)

+ 28 - 0
datacenter_client/v1/GetWorkingRoByCode_test.go

@@ -0,0 +1,28 @@
+package v1
+
+import (
+	"metawant.greentech.com.cn/gaoyagang/gt-common/datacenter_client"
+	"testing"
+)
+
+//var d = NewDcApi(ClientOptions{
+//	HTTPSettings: httplib.HTTPSettings{},
+//	ServerIp:     "47.96.12.136:8788",
+//	AppName:      "add-test1",
+//	AppSecret:    "7395fb0cfasyvasd705a2db44a19851a3dbd77f",
+//})
+
+func TestDcApi_GetWorkingRoByCode(t *testing.T) {
+	res, err := d.GetWorkingRoByCode(datacenter_client.DcWorkingReq{
+		ProjectId:  92,
+		DeviceCode: "RO-5001A",
+		Stime:      "2024-05-21 12:00:00",
+		Etime:      "2024-05-21 14:00:00",
+		Page:       1,
+		PageSize:   60,
+		Order:      "id desc",
+	})
+
+	t.Log(res.Data.List)
+	t.Log(err)
+}