From 373522a9761b88f04a69de39c74014c59341c6b1 Mon Sep 17 00:00:00 2001 From: anlicheng Date: Tue, 8 Aug 2023 10:28:18 +0800 Subject: [PATCH] fix --- apps/iot/src/mocker/iot_mock.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/iot/src/mocker/iot_mock.erl b/apps/iot/src/mocker/iot_mock.erl index 77f2099..ee3a802 100644 --- a/apps/iot/src/mocker/iot_mock.erl +++ b/apps/iot/src/mocker/iot_mock.erl @@ -101,7 +101,7 @@ simple_mapper() -> Fields1 = lists:map(fun(#{<<\"key\">> := Key, <<\"value\">> := Val}) -> {Key, Val} end, Fields), Fields2 = maps:from_list(Fields1), Bin = jiffy:encode(Fields2#{<<\"location_code\">> => LocationCode}, [force_utf8]), - iolist_to_binary(Bin) + {ok, iolist_to_binary(Bin)} end.", Mapper = list_to_binary(Mapper0), @@ -113,7 +113,7 @@ mysql_mapper() -> Mapper0 = "fun(LocationCode, Fields, Timestamp) -> Fields1 = lists:map(fun(#{<<\"key\">> := Key, <<\"value\">> := Val}) -> {Key, Val} end, Fields), Content = jiffy:encode(maps:from_list(Fields1), [force_utf8]), - [{<<\"location_code\">>, LocationCode}, {<<\"content\">>, Content}, {<<\"created_ts\">>, Timestamp}] + {ok, [{<<\"location_code\">>, LocationCode}, {<<\"content\">>, Content}, {<<\"created_ts\">>, Timestamp}]} end.", Mapper = list_to_binary(Mapper0),