fix: elvis warning

This commit is contained in:
Zhongwen Deng 2022-03-08 14:50:10 +08:00
parent ef5fcd388b
commit 512a5c3b8e
2 changed files with 7 additions and 6 deletions

View File

@ -22,8 +22,6 @@
-include_lib("emqx/include/emqx.hrl").
-include_lib("eunit/include/eunit.hrl").
-define(TRIE, emqx_trie).
all() ->
[{group, compact},
{group, not_compact}

View File

@ -35,7 +35,7 @@ paths() ->
schema("/mqtt/topic_rewrite") ->
#{
operationId => topic_rewrite,
'operationId' => topic_rewrite,
get => #{
tags => ?API_TAG_MQTT,
description => <<"List rewrite topic.">>,
@ -47,11 +47,13 @@ schema("/mqtt/topic_rewrite") ->
put => #{
description => <<"Update rewrite topic">>,
tags => ?API_TAG_MQTT,
requestBody => hoconsc:mk(hoconsc:array(hoconsc:ref(emqx_modules_schema, "rewrite")),#{}),
'requestBody' => hoconsc:mk(hoconsc:array(
hoconsc:ref(emqx_modules_schema, "rewrite")),#{}),
responses => #{
200 => hoconsc:mk(hoconsc:array(hoconsc:ref(emqx_modules_schema, "rewrite")),
#{desc => <<"Update rewrite topic success.">>}),
413 => emqx_dashboard_swagger:error_codes([?EXCEED_LIMIT], <<"Rules count exceed max limit">>)
413 => emqx_dashboard_swagger:error_codes([?EXCEED_LIMIT],
<<"Rules count exceed max limit">>)
}
}
}.
@ -65,6 +67,7 @@ topic_rewrite(put, #{body := Body}) ->
ok = emqx_rewrite:update(Body),
{200, emqx_rewrite:list()};
_ ->
Message = iolist_to_binary(io_lib:format("Max rewrite rules count is ~p", [?MAX_RULES_LIMIT])),
Message = iolist_to_binary(
io_lib:format("Max rewrite rules count is ~p", [?MAX_RULES_LIMIT])),
{413, #{code => ?EXCEED_LIMIT, message => Message}}
end.