-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ new api for current employees (#6)
The new API is written in Kotlin. See https://kotlinlang.org/docs/reference/using-maven.html for more details on the maven configuration introduced to make this work. The new API has better names for fields and includes employees from all countries (instead of just France for the older API). However it does not include employees that are not of type "EMPLOYEE" in Alibeez, which includes top-level executives. The old API is not removed.
- Loading branch information
Showing
7 changed files
with
392 additions
and
56 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.zenika.proxybeez | ||
|
||
import com.zenika.proxybeez.alibeez.v2.AlibeezProperties | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties | ||
import org.springframework.context.annotation.Configuration | ||
|
||
/** | ||
* Since Java sources are compiled before Kotlin sources, | ||
* Java code cannot refer to Kotlin code. This means the | ||
* AlibeezProperties configuration properties class cannot | ||
* be referred to in ProxybeezApp. This is why ProxybeezAppKt | ||
* exists. It's a Spring @Configuration class that can | ||
* refer to Kotlin classes. | ||
*/ | ||
@Configuration | ||
@EnableConfigurationProperties(AlibeezProperties::class) | ||
class ProxybeezAppKt |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/zenika/proxybeez/alibeez/v2/AlibeezProperties.kt
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.zenika.proxybeez.alibeez.v2 | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
|
||
@ConfigurationProperties(prefix = "application.alibeez", ignoreUnknownFields = true) | ||
class AlibeezProperties { | ||
val instances: Map<String, AlibeezInstanceProperties> = mutableMapOf() | ||
} | ||
|
||
class AlibeezInstanceProperties { | ||
lateinit var baseUrl: String | ||
lateinit var key: String | ||
val fields: List<String> = mutableListOf() | ||
val filters: List<String> = mutableListOf() | ||
var defaults: AlibeezInstanceDefaults? = null | ||
} | ||
|
||
class AlibeezInstanceDefaults { | ||
var location: String? = null | ||
var division: String? = null | ||
} |
Oops, something went wrong.