From 376c5a22d4f8da1e26d53d4e10943dea059cb0f6 Mon Sep 17 00:00:00 2001 From: anlicheng Date: Sat, 18 Feb 2023 22:20:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BA=A4=E4=BA=92=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/iot/src/iot_mock.erl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/iot/src/iot_mock.erl b/apps/iot/src/iot_mock.erl index 98ed593..d18f6f2 100644 --- a/apps/iot/src/iot_mock.erl +++ b/apps/iot/src/iot_mock.erl @@ -8,6 +8,7 @@ %%%------------------------------------------------------------------- -module(iot_mock). -author("licheng5"). +-include("iot.hrl"). %% API -export([insert_hosts/0]). @@ -15,9 +16,12 @@ insert_hosts() -> lists:foreach(fun(Id0) -> %Id0 = iot_util:rand_bytes(16), - Id = integer_to_binary(Id0), - Name = <<"N1000_0001">>, - Model = <<"N1000">>, - CellId = <<"公共教学楼"/utf8>>, - host_model:insert(Id, Name, Model, CellId) + Host = #host{ + id = integer_to_binary(Id0), + name = <<"N1000_0001">>, + model = <<"N1000">>, + cell_id = <<"公共教学楼"/utf8>> + }, + + host_model:add_host(Host) end, lists:seq(1, 100)). \ No newline at end of file