gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: implement GET nexus/ebics/subscribers/


From: gnunet
Subject: [libeufin] branch master updated: implement GET nexus/ebics/subscribers/{id}
Date: Fri, 08 Nov 2019 13:36:38 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new a602577  implement GET nexus/ebics/subscribers/{id}
a602577 is described below

commit a602577777f2345dd60ef499defde7c08e786d24
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Nov 8 13:36:00 2019 +0100

    implement GET nexus/ebics/subscribers/{id}
---
 nexus/src/main/kotlin/JSON.kt |  7 ++++++-
 nexus/src/main/kotlin/Main.kt | 17 +++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/nexus/src/main/kotlin/JSON.kt b/nexus/src/main/kotlin/JSON.kt
index 4b6c66b..712404d 100644
--- a/nexus/src/main/kotlin/JSON.kt
+++ b/nexus/src/main/kotlin/JSON.kt
@@ -16,7 +16,12 @@ data class EbicsSubscriberInfoRequest(
  * Contain the ID that identifies the new user in the Nexus system.
  */
 data class EbicsSubscriberInfoResponse(
-    val accountID: Number
+    val accountID: Number,
+    val ebicsURL: String,
+    val hostID: String,
+    val partnerID: String,
+    val userID: String,
+    val systemID: String?
 )
 
 /**
diff --git a/nexus/src/main/kotlin/Main.kt b/nexus/src/main/kotlin/Main.kt
index f79efe1..f9fade8 100644
--- a/nexus/src/main/kotlin/Main.kt
+++ b/nexus/src/main/kotlin/Main.kt
@@ -217,6 +217,23 @@ fun main() {
                 return@get
             }
 
+            get("/ebics/subscribers/{id}") {
+                val id = expectId(call.parameters["id"])
+                val response = transaction {
+                    val tmp = EbicsSubscriberEntity.findById(id) ?: throw 
SubscriberNotFoundError(HttpStatusCode.NotFound)
+                    EbicsSubscriberInfoResponse(
+                        accountID = tmp.id.value,
+                        hostID = tmp.hostID,
+                        partnerID = tmp.partnerID,
+                        systemID = tmp.systemID,
+                        ebicsURL = tmp.ebicsURL,
+                        userID = tmp.userID
+                    )
+                }
+                call.respond(HttpStatusCode.OK, response)
+                return@get
+            }
+
             post("/ebics/subscribers") {
                 val body = try {
                     call.receive<EbicsSubscriberInfoRequest>()

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]