fix fake_locations_code jinzhi
This commit is contained in:
parent
8adff02bd3
commit
edb106907b
@ -189,7 +189,7 @@ format_event(LocationCode, DynamicLocationCode, EventType, #{<<"event_code">> :=
|
||||
|
||||
% <<"occurrenceTime">> => <<"2023-06-10 12:00:00">>,
|
||||
|
||||
LocationCode1 = fake_location_code(EventCode, LocationCode),
|
||||
LocationCode1 = fake_location_code(EventType, LocationCode),
|
||||
DeviceInfo = #{
|
||||
% <<"location">> => LocationCode,
|
||||
<<"location">> => LocationCode1,
|
||||
@ -267,7 +267,8 @@ serialize0([{K, V}|T], Target) ->
|
||||
serialize0(T, [Item|Target]).
|
||||
|
||||
|
||||
fake_location_code(EventCode, LocationCode) when is_binary(EventCode), is_binary(LocationCode) ->
|
||||
-spec fake_location_code(EventType :: integer(), LocationCode :: binary()) -> binary().
|
||||
fake_location_code(EventType, LocationCode) when is_integer(EventType), is_binary(LocationCode) ->
|
||||
% TODO delete
|
||||
FakeLocationCodes = application:get_env(iot, fake_location_codes, []),
|
||||
proplists:get_value(EventCode, FakeLocationCodes, LocationCode).
|
||||
proplists:get_value(EventType, FakeLocationCodes, LocationCode).
|
||||
@ -19,6 +19,19 @@
|
||||
15 => 300
|
||||
}},
|
||||
|
||||
{fake_location_codes, [
|
||||
%% 鼠类监测
|
||||
{11, <<"0508103010001050300001">>},
|
||||
%% 异物占道
|
||||
{13, <<"0512104030001050400003">>},
|
||||
%% 垃圾箱(桶)
|
||||
{14, <<"0507106030001050600003">>},
|
||||
%% 操作区人员着装不规范
|
||||
{12, <<"0500000000001022700537">>},
|
||||
%% 动火离人
|
||||
{15, <<"0500000000001022700538">>}
|
||||
]},
|
||||
|
||||
{api_url, "http://39.98.184.67:8800"},
|
||||
|
||||
{watchdog, [
|
||||
|
||||
@ -20,11 +20,16 @@
|
||||
}},
|
||||
|
||||
{fake_location_codes, [
|
||||
{<<"23103">>, <<"0508103010001050300001">>},
|
||||
{<<"20407">>, <<"0512104030001050400003">>},
|
||||
{<<"10404">>, <<"0507106030001050600003">>},
|
||||
{<<"22503">>, <<"0500000000001022700537">>},
|
||||
{<<"23104">>, <<"0500000000001022700538">>}
|
||||
%% 鼠类监测
|
||||
{11, <<"0508103010001050300001">>},
|
||||
%% 异物占道
|
||||
{13, <<"0512104030001050400003">>},
|
||||
%% 垃圾箱(桶)
|
||||
{14, <<"0507106030001050600003">>},
|
||||
%% 操作区人员着装不规范
|
||||
{12, <<"0500000000001022700537">>},
|
||||
%% 动火离人
|
||||
{15, <<"0500000000001022700538">>}
|
||||
]},
|
||||
|
||||
{watchdog, [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user