ajustes url y loggin
This commit is contained in:
@ -8,7 +8,7 @@ WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
# Construir el JAR con Gradle
|
||||
RUN ./gradlew build
|
||||
RUN ./gradlew build -x test
|
||||
|
||||
# Imagen final con solo el JAR
|
||||
FROM eclipse-temurin:17-jdk
|
||||
|
@ -8,6 +8,9 @@ import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import es.imunnic.inversionitasBot.TelegramBot;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@ -15,8 +18,10 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ApiService {
|
||||
@Value("${apiservice.url}")
|
||||
private static String API_BASE_URL;
|
||||
//@Value("${apiservice.url}")
|
||||
private static String API_BASE_URL="http://fastapi_app:8000/news";
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TelegramBot.class);
|
||||
|
||||
// Método genérico para hacer solicitudes GET
|
||||
public static String sendGetRequest(String endpoint) {
|
||||
@ -33,7 +38,7 @@ public class ApiService {
|
||||
}
|
||||
in.close();
|
||||
connection.disconnect();
|
||||
|
||||
logger.info("Mensaje recibido: {}", content.toString());
|
||||
return content.toString();
|
||||
} catch (Exception e) {
|
||||
return "{\"error\": \"Error al obtener datos de la API\"}";
|
||||
|
Reference in New Issue
Block a user