fix
This commit is contained in:
parent
eaa7df3bae
commit
0dec0c9fcf
@ -86,16 +86,15 @@ read_body(Req, AccData) ->
|
|||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
%% 向用户推送数据
|
%% 向用户推送数据
|
||||||
handle_request("POST", "/api/push", #{<<"env">> := <<"prod">>}, Notifications) ->
|
handle_request("POST", "/api/push", GetParams, Notifications) ->
|
||||||
{ok, Pid} = dimension_apn_worker:start_link(apns_prod),
|
Profile = case maps:get(<<"env">>, GetParams, <<"prod">>) of
|
||||||
|
<<"prod">> ->
|
||||||
|
apns_prod;
|
||||||
|
<<"dev">> ->
|
||||||
|
apns_dev
|
||||||
|
end,
|
||||||
|
{ok, Pid} = dimension_apn_worker:start_link(Profile),
|
||||||
dimension_apn_worker:push(Pid, Notifications),
|
dimension_apn_worker:push(Pid, Notifications),
|
||||||
|
|
||||||
{ok, 200, dimension_utils:json_data(<<"success">>)};
|
|
||||||
|
|
||||||
handle_request("POST", "/api/push", _, Notifications) ->
|
|
||||||
{ok, Pid} = dimension_apn_worker:start_link(apns_dev),
|
|
||||||
dimension_apn_worker:push(Pid, Notifications),
|
|
||||||
|
|
||||||
{ok, 200, dimension_utils:json_data(<<"success">>)};
|
{ok, 200, dimension_utils:json_data(<<"success">>)};
|
||||||
|
|
||||||
handle_request(_, Path, _, _) ->
|
handle_request(_, Path, _, _) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user