mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 11:00:38 +00:00
Add JsonRpcMultiCommand
This commit is contained in:
parent
64af4914ee
commit
9c67aabebb
8 changed files with 90 additions and 26 deletions
|
@ -4,8 +4,8 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
|||
|
||||
import net.sourceforge.argparse4j.inf.Namespace;
|
||||
|
||||
import org.asamk.signal.JsonWriter;
|
||||
import org.asamk.signal.OutputType;
|
||||
import org.asamk.signal.OutputWriter;
|
||||
import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
|
||||
|
@ -19,10 +19,10 @@ public interface JsonRpcLocalCommand extends JsonRpcSingleCommand<Map<String, Ob
|
|||
}
|
||||
|
||||
default void handleCommand(
|
||||
Map<String, Object> request, Manager m, OutputWriter outputWriter
|
||||
Map<String, Object> request, Manager m, JsonWriter jsonWriter
|
||||
) throws CommandException {
|
||||
Namespace commandNamespace = new JsonRpcNamespace(request == null ? Map.of() : request);
|
||||
handleCommand(commandNamespace, m, outputWriter);
|
||||
handleCommand(commandNamespace, m, jsonWriter);
|
||||
}
|
||||
|
||||
default List<OutputType> getSupportedOutputTypes() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue