fix binlog

This commit is contained in:
anlicheng 2026-02-28 13:49:22 +08:00
parent bcfcbcbd1d
commit fef8247944
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
%%%-------------------------------------------------------------------
%%% @author licheng5
%%% @copyright (C) 2020, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 26. 4 2020 3:36
%%%-------------------------------------------------------------------
-module(binlog_handler).
-author("licheng5").
%% API
-export([handle_request/4]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% helper methods
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View File

@ -38,6 +38,7 @@ start_http_server() ->
Dispatcher = cowboy_router:compile([ Dispatcher = cowboy_router:compile([
{'_', [ {'_', [
{"/api/[...]", http_protocol, [api_handler]}, {"/api/[...]", http_protocol, [api_handler]},
{"/binlog", http_protocol, [binlog_handler]},
{"/network/[...]", http_protocol, [network_handler]}, {"/network/[...]", http_protocol, [network_handler]},
{"/node/[...]", http_protocol, [node_handler]}, {"/node/[...]", http_protocol, [node_handler]},
{"/test/[...]", http_protocol, [test_handler]} {"/test/[...]", http_protocol, [test_handler]}