-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2272 from constantine2nd/develop
getRoot endpoint
- Loading branch information
Showing
23 changed files
with
372 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,23 +111,6 @@ trait APIMethods121 { | |
} yield metadata | ||
} | ||
|
||
private def getApiInfoJSON(apiVersion : ApiVersion, apiVersionStatus : String) = { | ||
val apiDetails: JValue = { | ||
|
||
val organisation = APIUtil.getPropsValue("hosted_by.organisation", "TESOBE") | ||
val email = APIUtil.getPropsValue("hosted_by.email", "[email protected]") | ||
val phone = APIUtil.getPropsValue("hosted_by.phone", "+49 (0)30 8145 3994") | ||
val organisationWebsite = APIUtil.getPropsValue("organisation_website", "https://www.tesobe.com") | ||
|
||
val connector = APIUtil.getPropsValue("connector").openOrThrowException("no connector set") | ||
|
||
val hostedBy = new HostedBy(organisation, email, phone, organisationWebsite) | ||
val apiInfoJSON = new APIInfoJSON(apiVersion.vDottedApiVersion, apiVersionStatus, gitCommit, connector, hostedBy) | ||
Extraction.decompose(apiInfoJSON) | ||
} | ||
apiDetails | ||
} | ||
|
||
// helper methods end here | ||
|
||
val Implementations1_2_1 = new Object(){ | ||
|
@@ -161,7 +144,7 @@ trait APIMethods121 { | |
for { | ||
_ <- Future() // Just start async call | ||
} yield { | ||
(getApiInfoJSON(apiVersion,apiVersionStatus), HttpCode.`200`(cc.callContext)) | ||
(JSONFactory.getApiInfoJSON(apiVersion,apiVersionStatus), HttpCode.`200`(cc.callContext)) | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,10 +28,14 @@ package code.api.v1_2_1 | |
|
||
import java.util.Date | ||
|
||
import code.api.util.APIUtil | ||
import net.liftweb.common.{Box, Full} | ||
import code.model._ | ||
import code.api.util.APIUtil._ | ||
import com.openbankproject.commons.model._ | ||
import com.openbankproject.commons.util.ApiVersion | ||
import net.liftweb.json.Extraction | ||
import net.liftweb.json.JsonAST.JValue | ||
|
||
case class APIInfoJSON( | ||
version : String, | ||
|
@@ -358,6 +362,24 @@ case class MakePaymentJson( | |
) | ||
|
||
object JSONFactory{ | ||
|
||
def getApiInfoJSON(apiVersion : ApiVersion, apiVersionStatus : String) = { | ||
val apiDetails: JValue = { | ||
|
||
val organisation = APIUtil.getPropsValue("hosted_by.organisation", "TESOBE") | ||
val email = APIUtil.getPropsValue("hosted_by.email", "[email protected]") | ||
val phone = APIUtil.getPropsValue("hosted_by.phone", "+49 (0)30 8145 3994") | ||
val organisationWebsite = APIUtil.getPropsValue("organisation_website", "https://www.tesobe.com") | ||
|
||
val connector = APIUtil.getPropsValue("connector").openOrThrowException("no connector set") | ||
|
||
val hostedBy = new HostedBy(organisation, email, phone, organisationWebsite) | ||
val apiInfoJSON = new APIInfoJSON(apiVersion.vDottedApiVersion, apiVersionStatus, gitCommit, connector, hostedBy) | ||
Extraction.decompose(apiInfoJSON) | ||
} | ||
apiDetails | ||
} | ||
|
||
def createBankJSON(bank : Bank) : BankJSON = { | ||
new BankJSON( | ||
stringOrNull(bank.bankId.value), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.