From 534decb43b6a9996fe2027e3f52fe9d1384520f9 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Mon, 21 Apr 2025 09:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E7=AE=A1=E6=8C=87=E6=8C=A5=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=9A=82=E6=97=B6=E4=B8=8D=E6=8E=A8=E9=80=81=2020?= =?UTF-8?q?=C2=A0-=C2=A023106=C2=A0=E5=9E=83=E5=9C=BE=E6=A1=B6=E5=8A=A0?= =?UTF-8?q?=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/iot/src/endpoint/iot_jinzhi_endpoint.erl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl b/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl index 7398611..d9c3b1d 100644 --- a/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl +++ b/apps/iot/src/endpoint/iot_jinzhi_endpoint.erl @@ -2,7 +2,7 @@ %%% @author anlicheng %%% @copyright (C) 2024, %%% @doc -%%% +%%% 监管指挥平台 %%% @end %%% Created : 23. 7月 2024 14:51 %%%------------------------------------------------------------------- @@ -45,7 +45,15 @@ get_pid() -> -spec forward(LocationCode :: binary(), DynamicLocationCode :: binary(), EventType :: integer(), Params :: map()) -> no_return(). forward(LocationCode, DynamicLocationCode, EventType, Params) when is_binary(LocationCode), is_binary(DynamicLocationCode), is_integer(EventType), is_map(Params) -> - gen_server:cast(?MODULE, {forward, LocationCode, DynamicLocationCode, EventType, Params}). + %% 需要暂时不推送的事件类型 + IgnoreEventTypes = [20], + case lists:member(EventType, IgnoreEventTypes) of + true -> + lager:notice("[iot_jinzhi_endpoint] the event type: ~p, params: ~p, ignore", [EventType, Params]), + ok; + false -> + gen_server:cast(?MODULE, {forward, LocationCode, DynamicLocationCode, EventType, Params}) + end. %% @doc Spawns the server and registers the local name (unique) -spec(start_link() -> @@ -194,7 +202,7 @@ format_event(LocationCode, DynamicLocationCode, EventType, #{<<"event_code">> := <<"category">> => EventCode, <<"description">> => Description, <<"occurrenceTime">> => Datetime, - %% 给金智的数据,只番户附件信息里面的第一个附件;多了对方程序报错 + %% 给金智的数据,只给附件信息里面的第一个附件;多了对方程序报错 <<"attachments">> => lists:sublist(Attachments, 1, 1) },