-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: возможность запуска приложения без интеграции со сторонн…
…ими API
- Loading branch information
Showing
15 changed files
with
73 additions
and
23 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
5 changes: 4 additions & 1 deletion
5
src/main/kotlin/com/github/djaler/evilbot/clients/FixerClient.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
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
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/com/github/djaler/evilbot/config/fixer/FixerApiCondition.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,11 @@ | ||
package com.github.djaler.evilbot.config.fixer | ||
|
||
import org.springframework.context.annotation.Condition | ||
import org.springframework.context.annotation.ConditionContext | ||
import org.springframework.core.type.AnnotatedTypeMetadata | ||
|
||
class FixerApiCondition : Condition { | ||
override fun matches(context: ConditionContext, metadata: AnnotatedTypeMetadata): Boolean { | ||
return context.environment.getProperty("fixer.api.key", "").isNotBlank() | ||
} | ||
} |
8 changes: 2 additions & 6 deletions
8
...aler/evilbot/config/FixerApiProperties.kt → ...vilbot/config/fixer/FixerApiProperties.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 |
---|---|---|
@@ -1,15 +1,11 @@ | ||
package com.github.djaler.evilbot.config | ||
package com.github.djaler.evilbot.config.fixer | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
import org.springframework.boot.context.properties.ConstructorBinding | ||
import org.springframework.validation.annotation.Validated | ||
import javax.validation.constraints.NotBlank | ||
|
||
|
||
@ConfigurationProperties(prefix = "fixer.api") | ||
@ConstructorBinding | ||
@Validated | ||
data class FixerApiProperties( | ||
@field:NotBlank | ||
val key: String | ||
val key: String = "" | ||
) |
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/com/github/djaler/evilbot/config/locationiq/LocationiqApiCondition.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,11 @@ | ||
package com.github.djaler.evilbot.config.locationiq | ||
|
||
import org.springframework.context.annotation.Condition | ||
import org.springframework.context.annotation.ConditionContext | ||
import org.springframework.core.type.AnnotatedTypeMetadata | ||
|
||
class LocationiqApiCondition : Condition { | ||
override fun matches(context: ConditionContext, metadata: AnnotatedTypeMetadata): Boolean { | ||
return context.environment.getProperty("locationiq.api.key", "").isNotBlank() | ||
} | ||
} |
8 changes: 2 additions & 6 deletions
8
...evilbot/config/LocationiqApiProperties.kt → ...fig/locationiq/LocationiqApiProperties.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 |
---|---|---|
@@ -1,15 +1,11 @@ | ||
package com.github.djaler.evilbot.config | ||
package com.github.djaler.evilbot.config.locationiq | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
import org.springframework.boot.context.properties.ConstructorBinding | ||
import org.springframework.validation.annotation.Validated | ||
import javax.validation.constraints.NotBlank | ||
|
||
|
||
@ConfigurationProperties(prefix = "locationiq.api") | ||
@ConstructorBinding | ||
@Validated | ||
data class LocationiqApiProperties( | ||
@field:NotBlank | ||
val key: String | ||
val key: String = "" | ||
) |
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/com/github/djaler/evilbot/config/vkcloud/VKCloudApiCondition.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,11 @@ | ||
package com.github.djaler.evilbot.config.vkcloud | ||
|
||
import org.springframework.context.annotation.Condition | ||
import org.springframework.context.annotation.ConditionContext | ||
import org.springframework.core.type.AnnotatedTypeMetadata | ||
|
||
class VKCloudApiCondition : Condition { | ||
override fun matches(context: ConditionContext, metadata: AnnotatedTypeMetadata): Boolean { | ||
return context.environment.getProperty("vk.api.key", "").isNotBlank() | ||
} | ||
} |
10 changes: 3 additions & 7 deletions
10
...er/evilbot/config/VKCloudApiProperties.kt → ...ot/config/vkcloud/VKCloudApiProperties.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 |
---|---|---|
@@ -1,14 +1,10 @@ | ||
package com.github.djaler.evilbot.config | ||
package com.github.djaler.evilbot.config.vkcloud | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
import org.springframework.boot.context.properties.ConstructorBinding | ||
import org.springframework.validation.annotation.Validated | ||
import javax.validation.constraints.NotBlank | ||
|
||
@ConfigurationProperties(prefix = "vk.api") | ||
@ConstructorBinding | ||
@Validated | ||
data class VKCloudApiProperties( | ||
@field:NotBlank | ||
val key: String | ||
) | ||
val key: String = "" | ||
) |
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
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/com/github/djaler/evilbot/service/CurrencyService.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
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/com/github/djaler/evilbot/service/TimeService.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