gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libeufin] branch master updated: refactoring


From: gnunet
Subject: [GNUnet-SVN] [libeufin] branch master updated: refactoring
Date: Fri, 27 Sep 2019 20:03:38 +0200

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

dold pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 3393f29  refactoring
3393f29 is described below

commit 3393f292128483eca70b69869e2d872826dd169c
Author: Florian Dold <address@hidden>
AuthorDate: Fri Sep 27 19:55:52 2019 +0200

    refactoring
---
 src/main/kotlin/Main.kt | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt
index 8bc678e..d8a3469 100644
--- a/src/main/kotlin/Main.kt
+++ b/src/main/kotlin/Main.kt
@@ -40,8 +40,8 @@ import java.text.*
 
 fun main() {
 
-    var xmlProcess = XMLTransform()
-    var logger = getLogger()
+    val xmlProcess = XMLTransform()
+    val logger = getLogger()
     dbCreateTables()
 
     val server = embeddedServer(Netty, port = 5000) {
@@ -114,11 +114,17 @@ fun main() {
 
                 logger.info("Querying ID: $id")
 
-                val result = transaction {
-                    BankCustomer.findById(id)
+                val customerInfo = transaction {
+                    val customer = BankCustomer.findById(id) ?: 
return@transaction null
+                    CustomerInfo(
+                        customer.name,
+                        customerEbicsInfo = CustomerEbicsInfo(
+                            customer.ebicsSubscriber.userId.id.value
+                        )
+                    )
                 }
 
-                if (null == result) {
+                if (null == customerInfo) {
                     call.respond(
                         HttpStatusCode.NotFound,
                         SandboxError("id $id not found")
@@ -126,17 +132,7 @@ fun main() {
                     return@get
                 }
 
-                val tmp = CustomerInfo(
-                    result.name,
-                    customerEbicsInfo = CustomerEbicsInfo(
-                        result.ebicsSubscriber.userId.id.value
-                    )
-                )
-
-                call.respond(
-                    HttpStatusCode.OK,
-                    tmp
-                )
+                call.respond(HttpStatusCode.OK, customerInfo)
             }
 
             post("/ebicsweb") {

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



reply via email to

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