This commit is contained in:
anlicheng 2025-08-12 18:06:11 +08:00
parent 923b2c7a9e
commit 15be60ca08

View File

@ -17,6 +17,18 @@
%% helper methods
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% endpoint的运行状态
handle_request("POST", "/endpoint/run_statuses", _, Ids) when is_list(Ids) ->
Statuses = lists:map(fun(Id) ->
case endpoint:get_pid(Id) of
undefined ->
0;
Pid when is_pid(Pid) ->
1
end
end, Ids),
{ok, 200, iot_util:json_data(Statuses)};
handle_request("POST", "/endpoint/start", _, #{<<"id">> := Id}) when is_integer(Id) ->
case endpoint_bo:get_endpoint(Id) of
undefined ->