处理交互逻辑

This commit is contained in:
anlicheng 2023-02-18 22:20:56 +08:00
parent cf90f98a9c
commit 376c5a22d4

View File

@ -8,6 +8,7 @@
%%%------------------------------------------------------------------- %%%-------------------------------------------------------------------
-module(iot_mock). -module(iot_mock).
-author("licheng5"). -author("licheng5").
-include("iot.hrl").
%% API %% API
-export([insert_hosts/0]). -export([insert_hosts/0]).
@ -15,9 +16,12 @@
insert_hosts() -> insert_hosts() ->
lists:foreach(fun(Id0) -> lists:foreach(fun(Id0) ->
%Id0 = iot_util:rand_bytes(16), %Id0 = iot_util:rand_bytes(16),
Id = integer_to_binary(Id0), Host = #host{
Name = <<"N1000_0001">>, id = integer_to_binary(Id0),
Model = <<"N1000">>, name = <<"N1000_0001">>,
CellId = <<"公共教学楼"/utf8>>, model = <<"N1000">>,
host_model:insert(Id, Name, Model, CellId) cell_id = <<"公共教学楼"/utf8>>
},
host_model:add_host(Host)
end, lists:seq(1, 100)). end, lists:seq(1, 100)).