Created
February 26, 2018 03:08
-
-
Save barinek/612fd056b0259bbe8ded3674c1fd11e3 to your computer and use it in GitHub Desktop.
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
open class ProjectClient(val mapper: ObjectMapper, val template: RestTemplate) { | |
open fun getProject(projectId: Long): ProjectInfo? { | |
val endpoint = System.getenv("REGISTRATION_SERVER_ENDPOINT") | |
val response = template.get("$endpoint/project", "application/vnd.appcontinuum.v2+json", BasicNameValuePair("projectId", projectId.toString())) | |
when { | |
response.isBlank() -> return null | |
else -> return mapper.readValue(response, ProjectInfo::class.java) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment