mirror of
https://gitee.com/dgiiot/dgiot.git
synced 2024-12-02 20:28:40 +08:00
fix save device errror
This commit is contained in:
parent
e4bf39eaaf
commit
f7d021d20f
@ -33,7 +33,7 @@ init_ets() ->
|
|||||||
save(Device) ->
|
save(Device) ->
|
||||||
DeviceId = maps:get(<<"objectId">>, Device),
|
DeviceId = maps:get(<<"objectId">>, Device),
|
||||||
#{<<"objectId">> := ProductId} = maps:get(<<"product">>, Device),
|
#{<<"objectId">> := ProductId} = maps:get(<<"product">>, Device),
|
||||||
#{<<"latitude">> := Latitude, <<"longitude">> := Logitude} = maps:get(<<"location">>, Device),
|
#{<<"latitude">> := Latitude, <<"longitude">> := Logitude} = maps:get(<<"location">>, Device,#{<<"latitude">> => 0, <<"longitude">> => 0}),
|
||||||
Product = binary_to_atom(ProductId),
|
Product = binary_to_atom(ProductId),
|
||||||
Acl =
|
Acl =
|
||||||
lists:foldl(fun(X, Acc) ->
|
lists:foldl(fun(X, Acc) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user