%%%------------------------------------------------------------------- %%% @author licheng5 %%% @copyright (C) 2020, %%% @doc %%% %%% @end %%% Created : 26. 4月 2020 3:36 下午 %%%------------------------------------------------------------------- -module(binlog_handler). -author("licheng5"). %% API -export([handle_request/4]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% helper methods %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 重新加载对应的主机信息 -spec handle_request(Method :: string(), Path :: string(), GetParams :: map(), PostParams :: map()) -> {ok, StatusCode :: non_neg_integer(), Body :: iodata()}. handle_request("POST", "/binlog", _, PostParams) -> logger:debug("[binlog_handler] get post params: ~p", [PostParams]), {ok, 200, sdlan_util:json_data(<<"ok">>)}; handle_request(_, Path, _, _) -> Path1 = list_to_binary(Path), {ok, 200, sdlan_util:json_error(-1, <<"url: ", Path1/binary, " not found">>)}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% helper methods %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%