Fix OpenRouter

This commit is contained in:
2025-02-14 19:00:51 +03:00
parent a4269a5d8c
commit 7e4d6aea19
3 changed files with 3 additions and 42 deletions
@@ -1,4 +1,4 @@
package ru.cathub.telegabot.config;
package ru.cathub.telegabot.configuration;
import lombok.Getter;
import lombok.Setter;
@@ -8,7 +8,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
import ru.cathub.telegabot.config.OpenRouterConfig;
import ru.cathub.telegabot.configuration.OpenRouterConfig;
import ru.cathub.telegabot.exception.OpenRouterException;
import ru.cathub.telegabot.service.OpenRouterService;
@@ -52,7 +52,7 @@ public class OpenRouterServiceImpl implements OpenRouterService {
}
}
private String extractResponse(Map<String, Object> response) {
private String extractResponse(Map<String, Object> response) throws OpenRouterException {
try {
List<Map<String, Object>> choices = (List<Map<String, Object>>) response.get("choices");
Map<String, Object> firstChoice = choices.get(0);
-39
View File
@@ -1,39 +0,0 @@
spring.application.name=TelegaBot
# Telegram configuration
bot.token=5908676914:AAGU9LVyXYZYafpRgwOf1tolk0HGYvcHszY
bot.name=TelegaBot
# Database configuration
spring.jpa.hibernate.ddl-auto=validate
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
spring.flyway.baseline-on-migrate=true
spring.flyway.validate-on-migrate=true
spring.flyway.Schemas=telegabot
# ?????????? SQL-???????
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=false
# ?????????? ????????? ????????
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
logging.level.io.hypersistence.utils.hibernate.query=DEBUG
# ??????????? ????
logging.level.org.springframework.cache=INFO