-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21f8b53
commit e78e456
Showing
44 changed files
with
363 additions
and
290 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE vars SYSTEM "https://resources.jetbrains.com/writerside/1.0/vars.dtd"> | ||
<vars> | ||
<var name="current_version" value="0.9.2a"/> | ||
<var name="current_version" value="0.9.3"/> | ||
</vars> |
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
36 changes: 36 additions & 0 deletions
36
...lin/io/github/dehuckakpyt/telegrambot/config/CallbackContentSourceInitializationConfig.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,36 @@ | ||
package io.github.dehuckakpyt.telegrambot.config | ||
|
||
import io.github.dehuckakpyt.telegrambot.config.constant.PropertiesConstant.TELEGRAM_BOT_SOURCE_JPA | ||
import io.github.dehuckakpyt.telegrambot.config.constant.PropertiesConstant.TELEGRAM_BOT_SOURCE_JPA_CALLBACK_CONTENT_SOURCE | ||
import io.github.dehuckakpyt.telegrambot.config.constant.PropertiesConstant.TELEGRAM_BOT_SOURCE_JPA_CALLBACK_CONTENT_SOURCE_PER_USER | ||
import io.github.dehuckakpyt.telegrambot.config.expression.ConfigExpression | ||
import io.github.dehuckakpyt.telegrambot.repository.callback.JpaCallbackContentRepository | ||
import io.github.dehuckakpyt.telegrambot.source.callback.CallbackContentSource | ||
import io.github.dehuckakpyt.telegrambot.source.callback.JpaCallbackContentSource | ||
import org.springframework.beans.factory.annotation.Value | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty | ||
import org.springframework.boot.autoconfigure.domain.EntityScan | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories | ||
|
||
|
||
/** | ||
* Created on 22.06.2024. | ||
* | ||
* @author Denis Matytsin | ||
*/ | ||
@EntityScan(basePackages = ["io.github.dehuckakpyt.telegrambot.model.callback"]) | ||
@EnableJpaRepositories(basePackages = ["io.github.dehuckakpyt.telegrambot.repository.callback"]) | ||
@ConditionalOnProperty(name = [TELEGRAM_BOT_SOURCE_JPA, TELEGRAM_BOT_SOURCE_JPA_CALLBACK_CONTENT_SOURCE], havingValue = "true", matchIfMissing = true) | ||
class CallbackContentSourceInitializationConfig { | ||
|
||
@Bean | ||
//TODO create custom @ConditionalOnMissingBean | ||
@ConditionalOnMissingBean(name = ["callbackContentSourceExpression"], parameterizedContainer = [ConfigExpression::class]) | ||
@ConditionalOnProperty(TELEGRAM_BOT_SOURCE_JPA_CALLBACK_CONTENT_SOURCE, havingValue = "true", matchIfMissing = true) | ||
fun callbackContentSourceExpression( | ||
repository: JpaCallbackContentRepository, | ||
@Value("\${$TELEGRAM_BOT_SOURCE_JPA_CALLBACK_CONTENT_SOURCE_PER_USER}") perUser: Long, | ||
): ConfigExpression<CallbackContentSource> = ConfigExpression { JpaCallbackContentSource(repository, maxCallbackContentsPerUser = perUser) } | ||
} |
31 changes: 31 additions & 0 deletions
31
...c/main/kotlin/io/github/dehuckakpyt/telegrambot/config/ChainSourceInitializationConfig.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,31 @@ | ||
package io.github.dehuckakpyt.telegrambot.config | ||
|
||
import io.github.dehuckakpyt.telegrambot.config.constant.PropertiesConstant.TELEGRAM_BOT_SOURCE_JPA | ||
import io.github.dehuckakpyt.telegrambot.config.constant.PropertiesConstant.TELEGRAM_BOT_SOURCE_JPA_CHAIN_SOURCE | ||
import io.github.dehuckakpyt.telegrambot.config.expression.ConfigExpression | ||
import io.github.dehuckakpyt.telegrambot.repository.chain.JpaChainRepository | ||
import io.github.dehuckakpyt.telegrambot.source.chain.ChainSource | ||
import io.github.dehuckakpyt.telegrambot.source.chain.JpaChainSource | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty | ||
import org.springframework.boot.autoconfigure.domain.EntityScan | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories | ||
|
||
|
||
/** | ||
* Created on 22.06.2024. | ||
* | ||
* @author Denis Matytsin | ||
*/ | ||
@EntityScan(basePackages = ["io.github.dehuckakpyt.telegrambot.model.chain"]) | ||
@EnableJpaRepositories(basePackages = ["io.github.dehuckakpyt.telegrambot.repository.chain"]) | ||
@ConditionalOnProperty(name = [TELEGRAM_BOT_SOURCE_JPA, TELEGRAM_BOT_SOURCE_JPA_CHAIN_SOURCE], havingValue = "true", matchIfMissing = true) | ||
class ChainSourceInitializationConfig { | ||
|
||
@Bean | ||
//TODO create custom @ConditionalOnMissingBean | ||
@ConditionalOnMissingBean(name = ["chainSourceExpression"], parameterizedContainer = [ConfigExpression::class]) | ||
@ConditionalOnProperty(TELEGRAM_BOT_SOURCE_JPA_CHAIN_SOURCE, havingValue = "true", matchIfMissing = true) | ||
fun chainSourceExpression(repository: JpaChainRepository): ConfigExpression<ChainSource> = ConfigExpression { JpaChainSource(repository) } | ||
} |
56 changes: 0 additions & 56 deletions
56
...urce-jpa/src/main/kotlin/io/github/dehuckakpyt/telegrambot/config/DatabaseSourceConfig.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.