fix url
This commit is contained in:
parent
5a95d64c0e
commit
66f58d3e91
@ -37,7 +37,7 @@ init(Req0, Opts) ->
|
||||
end.
|
||||
|
||||
%% 场地信息
|
||||
handle_request("POST", "/storeInfo", ReqBody) when is_binary(ReqBody) ->
|
||||
handle_request("POST", "/api/device_info/storeInfo", ReqBody) when is_binary(ReqBody) ->
|
||||
#{<<"storeInfos">> := StoreInfos} = jiffy:decode(ReqBody, [return_maps]),
|
||||
lager:debug("[api_handler] get storeInfo: ~p", [StoreInfos]),
|
||||
|
||||
@ -46,7 +46,7 @@ handle_request("POST", "/storeInfo", ReqBody) when is_binary(ReqBody) ->
|
||||
{ok, 200, json_reply(true, <<"接收成功"/utf8>>)};
|
||||
|
||||
%% 设备信息
|
||||
handle_request("POST", "/equip", ReqBody) ->
|
||||
handle_request("POST", "/api/device_info/equip", ReqBody) ->
|
||||
#{<<"equips">> := Equips} = jiffy:decode(ReqBody, [return_maps]),
|
||||
lager:debug("[api_handler] get equips: ~p", [Equips]),
|
||||
|
||||
@ -55,7 +55,7 @@ handle_request("POST", "/equip", ReqBody) ->
|
||||
{ok, 200, json_reply(true, <<"接收成功"/utf8>>)};
|
||||
|
||||
%% 设备离线,在线状态
|
||||
handle_request("POST", "/online", ReqBody) ->
|
||||
handle_request("POST", "/api/device_info/online", ReqBody) ->
|
||||
#{<<"equipStatus">> := Equips} = jiffy:decode(ReqBody, [return_maps]),
|
||||
lager:debug("[api_handler] get online: ~p", [Equips]),
|
||||
|
||||
@ -64,7 +64,7 @@ handle_request("POST", "/online", ReqBody) ->
|
||||
{ok, 200, json_reply(true, <<"接收成功"/utf8>>)};
|
||||
|
||||
%% 设备运行状态
|
||||
handle_request("POST", "/runStatus", ReqBody) ->
|
||||
handle_request("POST", "/api/device_info/runStatus", ReqBody) ->
|
||||
#{<<"equipRunStatus">> := EquipRunStatus} = jiffy:decode(ReqBody, [return_maps]),
|
||||
lager:debug("[api_handler] get equipRunStatus: ~p", [EquipRunStatus]),
|
||||
|
||||
@ -73,7 +73,7 @@ handle_request("POST", "/runStatus", ReqBody) ->
|
||||
{ok, 200, json_reply(true, <<"接收成功"/utf8>>)};
|
||||
|
||||
%% 订单信息推送
|
||||
handle_request("POST", "/order", ReqBody) ->
|
||||
handle_request("POST", "/api/device_info/order", ReqBody) ->
|
||||
%#{<<"equipRunStatus">> := EquipRunStatus} = jiffy:decode(ReqBody, [return_maps]),
|
||||
lager:debug("[api_handler] get order: ~p", [ReqBody]),
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ start_http_server() ->
|
||||
|
||||
Dispatcher = cowboy_router:compile([
|
||||
{'_', [
|
||||
{"/[...]", api_handler, []}
|
||||
{"/api/[...]", api_handler, []}
|
||||
]}
|
||||
]),
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user