fix: subscriptions api share param name (#5610)

This commit is contained in:
DDDHuang 2021-08-31 19:04:52 +08:00 committed by GitHub
parent 4c468b383a
commit 00d469976f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -37,6 +37,7 @@
[ {<<"clientid">>, binary} [ {<<"clientid">>, binary}
, {<<"topic">>, binary} , {<<"topic">>, binary}
, {<<"share">>, binary} , {<<"share">>, binary}
, {<<"share_group">>, binary}
, {<<"qos">>, integer} , {<<"qos">>, integer}
, {<<"match_topic">>, binary}]}). , {<<"match_topic">>, binary}]}).
@ -87,10 +88,10 @@ parameters() ->
schema => #{type => integer, enum => [0, 1, 2]} schema => #{type => integer, enum => [0, 1, 2]}
}, },
#{ #{
name => share, name => share_group,
in => query, in => query,
description => <<"Shared subscription">>, description => <<"Shared subscription group name">>,
schema => #{type => boolean} schema => #{type => string}
}, },
#{ #{
name => topic, name => topic,
@ -183,7 +184,7 @@ update_ms(clientid, X, {{Pid, Topic}, Opts}) ->
{{Pid, Topic}, Opts#{subid => X}}; {{Pid, Topic}, Opts#{subid => X}};
update_ms(topic, X, {{Pid, _Topic}, Opts}) -> update_ms(topic, X, {{Pid, _Topic}, Opts}) ->
{{Pid, X}, Opts}; {{Pid, X}, Opts};
update_ms(share, X, {{Pid, Topic}, Opts}) -> update_ms(share_group, X, {{Pid, Topic}, Opts}) ->
{{Pid, Topic}, Opts#{share => X}}; {{Pid, Topic}, Opts#{share => X}};
update_ms(qos, X, {{Pid, Topic}, Opts}) -> update_ms(qos, X, {{Pid, Topic}, Opts}) ->
{{Pid, Topic}, Opts#{qos => X}}. {{Pid, Topic}, Opts#{qos => X}}.