You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by eb...@apache.org on 2020/05/18 11:49:11 UTC

[incubator-streampipes] 02/04: Re-Add http-request for update of labels in database

This is an automated email from the ASF dual-hosted git repository.

ebi pushed a commit to branch STREAMPIPES-79
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit e67c3cb45e734a112aec14aecc46d49066726ac2
Author: Daniel Ebi <eb...@fzi.de>
AuthorDate: Thu May 14 10:17:37 2020 +0200

    Re-Add http-request for update of labels in database
---
 .../streampipes/rest/impl/datalake/DataLakeResourceV3.java    |  1 +
 ui/src/app/core-services/datalake/datalake-rest.service.ts    | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeResourceV3.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeResourceV3.java
index cc767ea..a14a74d 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeResourceV3.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeResourceV3.java
@@ -231,6 +231,7 @@ public class DataLakeResourceV3 extends AbstractRestInterface {
   public Response getImageCoco(@PathParam("route") String fileRoute) throws IOException {
     return ok(dataLakeManagement.getImageCoco(fileRoute));
   }
+  
   @POST
   @Produces(MediaType.TEXT_PLAIN)
   @Path("/data/{index}/{startdate}/{enddate}/labeling")
diff --git a/ui/src/app/core-services/datalake/datalake-rest.service.ts b/ui/src/app/core-services/datalake/datalake-rest.service.ts
index 6dcefa0..371e706 100644
--- a/ui/src/app/core-services/datalake/datalake-rest.service.ts
+++ b/ui/src/app/core-services/datalake/datalake-rest.service.ts
@@ -147,4 +147,13 @@ export class DatalakeRestService {
       return this.http.post(this.dataLakeUrlV3 + '/data/image/' + imageRoute + '/coco', data);
     }
 
-}
\ No newline at end of file
+    saveLabelsInDatabase(index, startDate, endDate, label) {
+        const request = new HttpRequest('POST', this.dataLakeUrlV3 + '/data/' + index + '/' + startDate + '/' +
+            endDate + '/labeling?label=' + label,  {}, {
+            reportProgress: true,
+            responseType: 'text'
+        });
+        return this.http.request(request);
+    }
+
+}