From 7939f25e5703d205133e820b1db487c366819c3a Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Wed, 26 Mar 2025 11:51:24 +0800 Subject: [PATCH] remove jinzhi fake_location_code --- apps/iot/src/endpoint/iot_jinzhi_endpoint.erl | 15 +++------------ config/sys-dev.config | 13 ------------- config/sys-prod.config | 13 ------------- 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl b/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl index e478fd3..7398611 100644 --- a/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl +++ b/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl @@ -189,10 +189,8 @@ format_event(LocationCode, DynamicLocationCode, EventType, #{<<"event_code">> := % <<"occurrenceTime">> => <<"2023-06-10 12:00:00">>, - LocationCode1 = fake_location_code(EventType, LocationCode), DeviceInfo = #{ - % <<"location">> => LocationCode, - <<"location">> => LocationCode1, + <<"location">> => LocationCode, <<"category">> => EventCode, <<"description">> => Description, <<"occurrenceTime">> => Datetime, @@ -203,7 +201,7 @@ format_event(LocationCode, DynamicLocationCode, EventType, #{<<"event_code">> := ReqData = #{ <<"sign">> => sign(DeviceInfo, PriKey), <<"sysId">> => ?SYS_ID, - <<"taskId">> => generate_task_id(LocationCode1, EventCode), + <<"taskId">> => generate_task_id(LocationCode, EventCode), <<"count">> => 1, <<"deviceInfo">> => DeviceInfo }, @@ -264,11 +262,4 @@ serialize0([{K, V}|T], Target) -> <<$[, V0/binary, $]>> end, Item = <<$", K/binary, $", $:, V1/binary>>, - serialize0(T, [Item|Target]). - - --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(EventType, FakeLocationCodes, LocationCode). \ No newline at end of file + serialize0(T, [Item|Target]). \ No newline at end of file diff --git a/config/sys-dev.config b/config/sys-dev.config index be418d4..2e8851f 100644 --- a/config/sys-dev.config +++ b/config/sys-dev.config @@ -19,19 +19,6 @@ 15 => 300 }}, - {fake_location_codes, [ - %% 鼠类监测 - {11, <<"0508103010001050300001">>}, - %% 异物占道 - {13, <<"0512104030001050400003">>}, - %% 垃圾箱(桶) - {14, <<"0507106030001050600003">>}, - %% 操作区人员着装不规范 - {12, <<"0500000000001022700537">>}, - %% 动火离人 - {15, <<"0500000000001022700538">>} - ]}, - {api_url, "http://39.98.184.67:8800"}, {watchdog, [ diff --git a/config/sys-prod.config b/config/sys-prod.config index d024674..cc51b3e 100644 --- a/config/sys-prod.config +++ b/config/sys-prod.config @@ -19,19 +19,6 @@ 15 => 300 }}, - {fake_location_codes, [ - %% 鼠类监测 - {11, <<"0508103010001050300001">>}, - %% 异物占道 - {13, <<"0512104030001050400003">>}, - %% 垃圾箱(桶) - {14, <<"0507106030001050600003">>}, - %% 操作区人员着装不规范 - {12, <<"0500000000001022700537">>}, - %% 动火离人 - {15, <<"0500000000001022700538">>} - ]}, - {watchdog, [ {pri_key, "jinzhi_watchdog_pri.key"}, {url, "http://172.30.37.242:8080/hqtaskcenterapp/sys/taskCenter/taskReceive/sendNotice.do"},