WIP: report implementation for varo

This commit is contained in:
2025-06-19 00:40:49 +02:00
parent ccf383cdb5
commit 2824c1053b
8 changed files with 101 additions and 28 deletions

View File

@ -48,6 +48,19 @@ public abstract class HttpRepository extends Repository {
return this.execute(request, outputType);
}
protected <TInput, TOutput> ReqResp<TOutput> put(String command, TInput data, Class<TOutput> outputType) {
return this.put(command, parameters -> {
}, data, outputType);
}
protected <TInput, TOutput> ReqResp<TOutput> put(String command, Consumer<URIBuilder> parameters, TInput data, Class<TOutput> outputType) {
HttpRequest request = this.getRequestBuilder(this.getUri(command, parameters))
.PUT(HttpRequest.BodyPublishers.ofString(this.gson.toJson(data)))
.build();
return this.execute(request, outputType);
}
protected <TOutput> ReqResp<TOutput> get(String command, Class<TOutput> outputType) {
return this.get(command, parameters -> {
}, outputType);