处理交互逻辑

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