diff --git a/src/main/java/ru/cathub/telegabot/configuration/OpenRouterConfig.java b/src/main/java/ru/cathub/telegabot/configuration/OpenRouterConfig.java index cde4ee8..93df144 100644 --- a/src/main/java/ru/cathub/telegabot/configuration/OpenRouterConfig.java +++ b/src/main/java/ru/cathub/telegabot/configuration/OpenRouterConfig.java @@ -4,7 +4,9 @@ import lombok.Getter; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestTemplate; @Configuration @EnableConfigurationProperties diff --git a/src/main/resources/application-secrets.properties b/src/main/resources/application-secrets.properties index e69de29..6c7fa22 100644 --- a/src/main/resources/application-secrets.properties +++ b/src/main/resources/application-secrets.properties @@ -0,0 +1,12 @@ + +# Telegram configuration +bot.token=${BOT_TOKEN} +bot.name=${BOT_NAME} + +# Database configuration +spring.datasource.url=${DB_URL} +spring.datasource.username=${DB_USER} +spring.datasource.password=${DB_PASSWORD} + +# OpenRouter AI +openrouter.api.key=${OPENROUTER_API_KEY} \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 28e85b4..195e0e3 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,5 @@ spring.application.name=TelegaBot # Telegram configuration -bot.token=5908676914:AAGU9LVyXYZYafpRgwOf1tolk0HGYvcHszY -bot.name=TelegaBot # Database configuration @@ -11,11 +9,6 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.datasource.driver-class-name=org.postgresql.Driver spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect - -spring.datasource.url=jdbc:postgresql://192.168.0.10:5432/telegabot -spring.datasource.username=postgres -spring.datasource.password=Vftrixpo05 - # Flyway Configuration spring.flyway.enabled=true spring.flyway.locations=classpath:db/migration @@ -40,6 +33,5 @@ logging.level.org.springframework.cache=INFO # OpenRouter AI openrouter.api.url=https://openrouter.ai/api/v1 -openrouter.api.model=gryphe/mythomax-l2-13b +openrouter.api.model=deepseek/deepseek-r1-distill-qwen-32b # Для безопасности лучше установить через переменную окружения: -openrouter.api.key=${OPENROUTER_API_KEY} diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index 488b8ae..61573aa 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -1,4 +1,4 @@ openrouter.api.url=https://openrouter.ai/api/v1 -openrouter.api.model=gryphe/mythomax-l2-13b +openrouter.api.model=google/gemini-2.0-flash-001 # Ключ должен быть установлен через переменную окружения OPENROUTER_API_KEY -openrouter.api.key=${OPENROUTER_API_KEY} +openrouter.api.key=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