From a3425ffc123fb76da640fa054dc447622e996732 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Fri, 14 Nov 2025 23:15:26 +0800 Subject: [PATCH] fix endpoint handler --- apps/iot/src/http_handlers/endpoint_handler.erl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/iot/src/http_handlers/endpoint_handler.erl b/apps/iot/src/http_handlers/endpoint_handler.erl index 85a3e72..9e19ade 100644 --- a/apps/iot/src/http_handlers/endpoint_handler.erl +++ b/apps/iot/src/http_handlers/endpoint_handler.erl @@ -133,23 +133,23 @@ handle_request("POST", "/endpoint/test", _, #{<<"protocol">> := <<"mqtt">>, <<"c case emqtt:start_link(Opts) of {ok, ConnPid} -> - lager:debug("[endpoint_mqtt] start connect, options: ~p", [Opts]), + lager:debug("[endpint_handler] start connect, options: ~p", [Opts]), case catch emqtt:connect(ConnPid, 5000) of {ok, _} -> - lager:debug("[endpoint_mqtt] connect success, pid: ~p", [ConnPid]), + lager:debug("[endpint_handler] connect success, pid: ~p", [ConnPid]), emqtt:stop(ConnPid), {ok, 200, iot_util:json_data(<<"ok">>)}; {error, Reason} -> - lager:warning("[endpoint_mqtt] connect get error: ~p", [Reason]), + lager:warning("[endpint_handler] connect get error: ~p", [Reason]), emqtt:stop(ConnPid), {ok, 200, iot_util:json_error(-1, <<"connect mqtt server failed">>)}; Error -> - lager:warning("[endpoint_mqtt] connect get error: ~p", [Error]), + lager:warning("[endpint_handler] connect get error: ~p", [Error]), emqtt:stop(ConnPid), {ok, 200, iot_util:json_error(-1, <<"connect mqtt server failed">>)} end; Other -> - lager:warning("[endpoint_handler] test connect mqtt with options: ~p, get error: ~p", [Opts, Other]), + lager:warning("[endpint_handler] test connect mqtt with options: ~p, get error: ~p", [Opts, Other]), {ok, 200, iot_util:json_error(-1, <<"connect mqtt server failed">>)} end; {error, Errors} -> @@ -180,11 +180,11 @@ handle_request("POST", "/endpoint/test", _, #{<<"protocol">> := <<"kafka">>, <<" ok = brod:stop_client(ClientId), {ok, 200, iot_util:json_data(<<"ok">>)}; {error, Reason} -> - lager:debug("[endpoint_kafka] start_producer: ~p, get error: ~p", [ClientId, Reason]), + lager:debug("[endpint_handler] start_producer: ~p, get error: ~p", [ClientId, Reason]), {ok, 200, iot_util:json_error(-1, <<"config kafka server failed">>)} end; Error -> - lager:debug("[endpoint_kafka] start_client: ~p, get error: ~p", [ClientId, Error]), + lager:debug("[endpint_handler] start_client: ~p, get error: ~p", [ClientId, Error]), {ok, 200, iot_util:json_error(-1, <<"config kafka server failed">>)} end; {error, Errors} ->