This commit is contained in:
anlicheng 2025-08-04 17:59:18 +08:00
parent eaa7df3bae
commit 0dec0c9fcf

View File

@ -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, _, _) ->