diff --git a/apiserver/api.go b/apiserver/api.go index cec8f59..e9dcbd3 100644 --- a/apiserver/api.go +++ b/apiserver/api.go @@ -30,7 +30,6 @@ type ConfigurationApiRouter interface { // pass the data to a CustomizationApiServicer to perform the required actions, then write the service results to the http response. type CustomizationApiRouter interface { GetDashboardTemplateByName(http.ResponseWriter, *http.Request) - GetDashboardTemplateNames(http.ResponseWriter, *http.Request) } // SpacesApiRouter defines the required methods for binding the api requests to a responses for the SpacesApi @@ -66,7 +65,6 @@ type ConfigurationApiServicer interface { // and updated with the logic required for the API. type CustomizationApiServicer interface { GetDashboardTemplateByName(context.Context, string, string) (ImplResponse, error) - GetDashboardTemplateNames(context.Context) (ImplResponse, error) } // SpacesApiServicer defines the api actions for the SpacesApi service diff --git a/apiserver/api_customization.go b/apiserver/api_customization.go index 0800005..3f84194 100644 --- a/apiserver/api_customization.go +++ b/apiserver/api_customization.go @@ -55,12 +55,6 @@ func (c *CustomizationApiController) Routes() Routes { "/v1/dashboard-templates/{dashboard-template-name}", c.GetDashboardTemplateByName, }, - { - "GetDashboardTemplateNames", - strings.ToUpper("Get"), - "/v1/dashboard-template-names", - c.GetDashboardTemplateNames, - }, } } @@ -81,16 +75,3 @@ func (c *CustomizationApiController) GetDashboardTemplateByName(w http.ResponseW EncodeJSONResponse(result.Body, &result.Code, w) } - -// GetDashboardTemplateNames - List available dashboard templates -func (c *CustomizationApiController) GetDashboardTemplateNames(w http.ResponseWriter, r *http.Request) { - result, err := c.service.GetDashboardTemplateNames(r.Context()) - // If an error occurred, encode the error with the status code - if err != nil { - c.errorHandler(w, r, err, &result) - return - } - // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, w) - -} diff --git a/apiservices/api_customization_service.go b/apiservices/api_customization_service.go index 5792a52..578e97f 100644 --- a/apiservices/api_customization_service.go +++ b/apiservices/api_customization_service.go @@ -11,9 +11,9 @@ package apiservices import ( "context" - "thingdust/eliona" "net/http" "thingdust/apiserver" + "thingdust/eliona" ) // CustomizationApiService is a service that implements the logic for the CustomizationApiServicer @@ -39,8 +39,3 @@ func (s *CustomizationApiService) GetDashboardTemplateByName(ctx context.Context return apiserver.ImplResponse{Code: http.StatusNotFound}, nil } } - -// GetDashboardTemplateNames - List available dashboard templates -func (s *CustomizationApiService) GetDashboardTemplateNames(ctx context.Context) (apiserver.ImplResponse, error) { - return apiserver.Response(http.StatusOK, []string{"Thingdust"}), nil -} diff --git a/metadata.json b/metadata.json index b539a23..2d2723a 100644 --- a/metadata.json +++ b/metadata.json @@ -7,5 +7,9 @@ "en": "The Thingdust app allows access to data from Thingdust spaces and displays this data on the eliona dashboard.", "de": "Die Thingdust App ermöglicht den Zugriff auf Daten von Thingdust Spaces und stellt die Daten auf der Eliona dashboard dar." }, + "dashboardTemplateNames": [ + "Thingdust" + ], + "documentationUrl": "https://doc.eliona.io/collection/eliona-apps/externe-apps/thingdust", "useEnvironment": [ "CONNECTION_STRING", "API_ENDPOINT", "API_TOKEN" ] } diff --git a/openapi.yaml b/openapi.yaml index d3fcd74..76d7c87 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -142,25 +142,6 @@ paths: type: array items: $ref: '#/components/schemas/Space' - - /dashboard-template-names: - get: - tags: - - Customization - summary: List available dashboard templates - description: Delivers all names for which the app provides dashboard templates. - operationId: getDashboardTemplateNames - responses: - "200": - description: Successfully returned list of template names - content: - application/json: - schema: - description: Names of available dashboard templates - type: array - items: - description: Name of the dashboard template - type: string /dashboard-templates/{dashboard-template-name}: get: