Commit db9a8642 authored by Ali Saeed's avatar Ali Saeed

testing from postman

parent 9dbbef7d
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-cloud.version>2022.0.4</spring-cloud.version> <spring-cloud.version>2022.0.0</spring-cloud.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
......
...@@ -21,6 +21,7 @@ public class ExternalAPI { ...@@ -21,6 +21,7 @@ public class ExternalAPI {
" \"prompt\": \"generate just one random json object contains these attributes: value, status, description, userID, invoiceID. where status is false and value is double and invoiceId is " + invoiceId + ", please just return this object without any words else\"\n" + " \"prompt\": \"generate just one random json object contains these attributes: value, status, description, userID, invoiceID. where status is false and value is double and invoiceId is " + invoiceId + ", please just return this object without any words else\"\n" +
"}"; "}";
String response = sendRequestToAPI(prompt); String response = sendRequestToAPI(prompt);
System.out.println(response.toString());
String jsonString = ""; String jsonString = "";
int firstIndex = response.toString().indexOf("{"); int firstIndex = response.toString().indexOf("{");
int endIndex = response.toString().indexOf("}"); int endIndex = response.toString().indexOf("}");
...@@ -41,6 +42,7 @@ public class ExternalAPI { ...@@ -41,6 +42,7 @@ public class ExternalAPI {
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
String jsonString = ""; String jsonString = "";
int firstIndex = response.toString().indexOf("["); int firstIndex = response.toString().indexOf("[");
int endIndex = response.toString().indexOf("]"); int endIndex = response.toString().indexOf("]");
...@@ -113,6 +115,7 @@ public class ExternalAPI { ...@@ -113,6 +115,7 @@ public class ExternalAPI {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
} }
connection.disconnect(); connection.disconnect();
System.out.println(response.toString());
return response.toString(); return response.toString();
} }
......
spring.application.name=invoicing-service
server.port=8081 server.port=8081
eureka.client.serviceUrl.defaultZone= ${EUREKA_URL:http://localhost:8761/eureka/}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,14 +8,13 @@ ...@@ -8,14 +8,13 @@
<version>3.0.1</version> <version>3.0.1</version>
<relativePath/> <relativePath/>
</parent> </parent>
<artifactId>service-discovery</artifactId> <artifactId>service-discovery</artifactId>
<name>service-discovery</name> <name>service-discovery</name>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-cloud.version>2020.0.4</spring-cloud.version> <spring-cloud.version>2022.0.0</spring-cloud.version>
</properties> </properties>
<dependencies> <dependencies>
...@@ -27,7 +26,6 @@ ...@@ -27,7 +26,6 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<version>2.5.5</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -58,7 +56,6 @@ ...@@ -58,7 +56,6 @@
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="CONSOLE"/> <!-- Add the console appender reference -->
</logger> </logger>
<root level="error"> <root level="DEBUG">
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="CONSOLE"/> <!-- Add the console appender reference -->
</root> </root>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="CONSOLE"/> <!-- Add the console appender reference -->
</logger> </logger>
<root level="error"> <root level="DEBUG">
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference --> <appender-ref ref="CONSOLE"/> <!-- Add the console appender reference -->
</root> </root>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-cloud.version>2022.0.4</spring-cloud.version> <spring-cloud.version>2022.0.0</spring-cloud.version>
</properties> </properties>
<dependencies> <dependencies>
......
spring.application.name=users-service
server.port=8080 server.port=8080
eureka.client.serviceUrl.defaultZone= ${EUREKA_URL:http://localhost:8761/eureka/}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment