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