package testUnit import ( "goInOut/adaptors" "log" "testing" ) func Test_江苏质感_应变(t *testing.T) { Msg := ` { "dtuInfo": { "id": 0, "code": "COM3" }, "sensorData": { "id": 25, "name": "m1c1", "module": "1", "channel": "1", "factorType": 23, "productCode": "MD-BM15", "structId": 0, "data": { "RawValues": [ 880.05609130859375, 17.250148773193359, 426.63839721679687 ], "ThemeValues": [ 1.254 ] }, "time": "2022-01-06T14:30:00.000" } } ` adp := adaptors.Adaptor_TYCJ_JSNCGLQL{ IdMap: map[string]string{ "m1c1": "JY-HSD-G05-001-01", "m1c2": "LHTDQ-RSG-L04-001-03", }, } bytes := adp.Transform(Msg) log.Println(bytes) }