fix
This commit is contained in:
parent
923b2c7a9e
commit
15be60ca08
@ -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 ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user