diff --git a/apps/iot/src/http_handlers/device_handler.erl b/apps/iot/src/http_handlers/device_handler.erl index 3c4308c..1707e23 100644 --- a/apps/iot/src/http_handlers/device_handler.erl +++ b/apps/iot/src/http_handlers/device_handler.erl @@ -45,24 +45,6 @@ handle_request("POST", "/device/delete", _, #{<<"host_id">> := HostId, <<"device {ok, 200, iot_util:json_data(<<"success">>)} end; -%% 处理主机的授权的激活 -handle_request("POST", "/device/activate", _, #{<<"host_id">> := HostId, <<"device_uuid">> := DeviceUUID, <<"auth">> := Auth}) - when is_integer(HostId), is_binary(DeviceUUID), is_boolean(Auth) -> - - AliasName = iot_host:get_alias_name(HostId), - case global:whereis_name(AliasName) of - undefined -> - {ok, 200, iot_util:json_error(404, <<"activate device failed">>)}; - HostPid when is_pid(HostPid) -> - case iot_host:activate_device(HostPid, DeviceUUID, Auth) of - ok -> - {ok, 200, iot_util:json_data(<<"success">>)}; - {error, Reason} -> - lager:debug("[device_handler] activate device: ~p, get error: ~p", [DeviceUUID, Reason]), - {ok, 200, iot_util:json_error(404, <<"activate device failed">>)} - end - end; - handle_request(_, Path, _, _) -> Path1 = list_to_binary(Path), {ok, 200, iot_util:json_error(-1, <<"url: ", Path1/binary, " not found">>)}. \ No newline at end of file