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),