Feature/ implement basic search function #40

Merged
kasun merged 30 commits from feature/Implement-basic-search-function into main 2026-06-25 17:58:40 +02:00
Showing only changes of commit 5b2648d526 - Show all commits
@@ -23,7 +23,8 @@ public class HomeboxConnectionProvider implements ConnectionProvider {
private final ConnectionRepository cRepository;
public HomeboxConnectionProvider(RestClient.Builder restClientBuilder, ConnectionRepository cRepository) {
public HomeboxConnectionProvider(RestClient.Builder restClientBuilder,
ConnectionRepository cRepository) {
this.restClientBuilder = restClientBuilder;
this.cRepository = cRepository;
}
@@ -51,20 +52,16 @@ public class HomeboxConnectionProvider implements ConnectionProvider {
@Override
public ConnectionResponse authenticate(ConnectionRequest request) {
Map<String, Object> homeboxPayload = Map.of("username", request.username(),
"password", request.password(), "stayLoggedIn",
request.stayLoggedIn());
Map<String, Object> homeboxPayload = Map.of("username", request.username(), "password",
request.password(), "stayLoggedIn", request.stayLoggedIn());
HomeboxLoginResponse hbResponse = restClientBuilder.baseUrl(request.appUrl())
.build()
.post()
.uri(HOMEBOX_LOGIN.getValue())
.body(homeboxPayload)
.retrieve()
HomeboxLoginResponse hbResponse = restClientBuilder.baseUrl(request.appUrl()).build().post()
.uri(HOMEBOX_LOGIN.getValue()).body(homeboxPayload).retrieve()
.body(HomeboxLoginResponse.class);
if (hbResponse == null) {
throw new IllegalStateException("Remote API returned an empty body for " + request.appUrl());
throw new IllegalStateException(
"Remote API returned an empty body for " + request.appUrl());
}
Map<String, Object> attachmentToken = new HashMap<>();
@@ -81,7 +78,8 @@ public class HomeboxConnectionProvider implements ConnectionProvider {
}
@Override
public ConnectionEntity connectionToEntity(ConnectionRequest request, ConnectionResponse response) {
public ConnectionEntity connectionToEntity(ConnectionRequest request,
ConnectionResponse response) {
return HomeboxEntity.from(request, response);
}
@@ -106,5 +104,5 @@ public class HomeboxConnectionProvider implements ConnectionProvider {
private record HomeboxLoginResponse(String token, String attachmentToken, Instant expiresAt) {
}
}