added search response into searchmodal ui, restructured folders
This commit is contained in:
@@ -64,10 +64,11 @@ public class HomeboxSearchProvider implements SearchProvider {
|
||||
}
|
||||
|
||||
List<SearchResponse> items = hbResponse.items().stream().map(i -> {
|
||||
String id = i.id();
|
||||
String title = i.name();
|
||||
String description = i.description();
|
||||
Map<String, Object> extraSearchResponseData = Map.of("location", i.parent());
|
||||
return new SearchResponse(title, description, extraSearchResponseData);
|
||||
return new SearchResponse(id, title, description, extraSearchResponseData);
|
||||
}).toList();
|
||||
|
||||
log.info("Search results for query '{}': {}", request.query(), items);
|
||||
@@ -79,7 +80,7 @@ public class HomeboxSearchProvider implements SearchProvider {
|
||||
List<HomeboxItem> items) {
|
||||
}
|
||||
|
||||
private record HomeboxItem(String name, String description, HomeboxLocation parent) {
|
||||
private record HomeboxItem(String id, String name, String description, HomeboxLocation parent) {
|
||||
}
|
||||
|
||||
private record HomeboxLocation(String name, String description) {
|
||||
|
||||
@@ -2,7 +2,8 @@ package com.vaessl.app.search;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public record SearchResponse(String title, String description, Map<String, Object> extraData) {
|
||||
public record SearchResponse(String id, String title, String description,
|
||||
Map<String, Object> extraData) {
|
||||
|
||||
public String getExtra(String key) {
|
||||
if (extraData == null) {
|
||||
|
||||
Reference in New Issue
Block a user