From 83a8882b4ee721ecafd839e271c2b262b03d2b5a Mon Sep 17 00:00:00 2001 From: anlicheng Date: Thu, 17 Aug 2023 20:03:47 +0800 Subject: [PATCH] fix nannong --- apps/iot/src/mocker/iot_mock.erl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/iot/src/mocker/iot_mock.erl b/apps/iot/src/mocker/iot_mock.erl index 2f42314..2b20efe 100644 --- a/apps/iot/src/mocker/iot_mock.erl +++ b/apps/iot/src/mocker/iot_mock.erl @@ -15,6 +15,15 @@ -export([insert_services/1]). -export([insert_endpoints/0, test_http/0, test_mysql/0, test_mqtt/0, test_influxdb/0]). +fun_x(LocationCode, Fields, Timestamp) -> + Data = #{ + <<"version">> => <<"1.0">>, + <<"location_code">> => LocationCode, + <<"ts">> => Timestamp, + <<"properties">> => Fields + }, + {ok, iolist_to_binary(jiffy:encode(Data, [force_utf8]))}. + test_influxdb() -> UUID = <<"device123123">>,