From 0d64f93c397446cd38d3e73eb1f99d52d1908053 Mon Sep 17 00:00:00 2001 From: anlicheng Date: Fri, 15 Sep 2023 16:13:00 +0800 Subject: [PATCH] json with base64 --- apps/iot/src/influxdb/influx_point.erl | 4 ++-- docs/router.md | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 docs/router.md diff --git a/apps/iot/src/influxdb/influx_point.erl b/apps/iot/src/influxdb/influx_point.erl index 8579aec..d0828dd 100644 --- a/apps/iot/src/influxdb/influx_point.erl +++ b/apps/iot/src/influxdb/influx_point.erl @@ -45,8 +45,8 @@ field_val(V) when is_float(V) -> field_val(V) when is_binary(V) -> <<$", V/binary, $">>; field_val(V) when is_list(V); is_map(V) -> - S = jiffy:encode(V, [force_utf8]), - <<$", S/binary, $">>; + S = base64:encode(iolist_to_binary(jiffy:encode(V, [force_utf8]))), + <<$", "base64:", S/binary, $">>; field_val(true) -> <<"true">>; field_val(false) -> diff --git a/docs/router.md b/docs/router.md new file mode 100644 index 0000000..1ae748a --- /dev/null +++ b/docs/router.md @@ -0,0 +1,3 @@ +# 数据路由设计文档 + +