mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 11:00:38 +00:00
Implement jsonRpc command
Co-authored-by: technillogue <technillogue@gmail.com> Closes #668
This commit is contained in:
parent
6c00054407
commit
a8bbdb54d0
20 changed files with 863 additions and 31 deletions
22
src/main/java/org/asamk/signal/commands/JsonRpcCommand.java
Normal file
22
src/main/java/org/asamk/signal/commands/JsonRpcCommand.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
package org.asamk.signal.commands;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.asamk.signal.OutputType;
|
||||
import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface JsonRpcCommand<T> extends Command {
|
||||
|
||||
default TypeReference<T> getRequestType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void handleCommand(T request, Manager m) throws CommandException;
|
||||
|
||||
default Set<OutputType> getSupportedOutputTypes() {
|
||||
return Set.of(OutputType.JSON);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue