Skip to content

Commit d302a15

Browse files
authored
Merge pull request #28 from Sandro642/fix/mc/logs
Fix/mc/logs
2 parents 2485945 + 5553c7f commit d302a15

5 files changed

Lines changed: 25 additions & 19 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = 'fr.sandro642.github'
8-
version = '0.2.6.1-STABLE'
8+
version = '0.2.6.2-STABLE'
99

1010
tasks.register('printVersion') {
1111
doLast {

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ And if you thought APIs were complicated, think again! With ConnectLib, it's lik
77
---
88

99
```java
10-
Stable Version: 0.2.6.1-STABLE
10+
Stable Version: 0.2.6.2-STABLE
1111
```
1212

1313
---
@@ -16,7 +16,7 @@ Stable Version: 0.2.6.1-STABLE
1616
Support Lib : Java 23
1717

1818
Hook -----------------------|
19-
- Support Minecraft 1.8
19+
- Support Minecraft 1.8 - Latest Version
2020

2121
- Coming Soon.
2222
```
@@ -94,7 +94,7 @@ repositories {
9494

9595
dependencies {
9696

97-
implementation("fr.sandro642.github:ConnectLib:0.2.6.1-STABLE")
97+
implementation("fr.sandro642.github:ConnectLib:0.2.6.2-STABLE")
9898

9999
}
100100

src/main/java/fr/sandro642/github/jobs/JobGetInfos.java

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -233,20 +233,25 @@ public ApiFactory getResponse() {
233233

234234
ApiFactory response;
235235

236-
if (method == MethodType.GET) {
237-
response = apiClient.callAPIGet(route).block();
238-
} else if (method == MethodType.POST) {
239-
response = apiClient.callAPIPost(route, body).block();
240-
} else if (method == MethodType.PUT) {
241-
response = apiClient.callAPIPut(route, body).block();
242-
} else if (method == MethodType.PATCH) {
243-
response = apiClient.callAPIPatch(route, body).block();
244-
} else if (method == MethodType.DELETE) {
245-
response = apiClient.callAPIDelete(route).block();
246-
} else {
247-
ConnectLib.Logger().ERROR("Unsupported method type: " + method);
248-
249-
return null;
236+
switch(method) {
237+
case GET:
238+
response = apiClient.callAPIGet(route).block();
239+
break;
240+
case POST:
241+
response = apiClient.callAPIPost(route, body).block();
242+
break;
243+
case PUT:
244+
response = apiClient.callAPIPut(route, body).block();
245+
break;
246+
case PATCH:
247+
response = apiClient.callAPIPatch(route, body).block();
248+
break;
249+
case DELETE:
250+
response = apiClient.callAPIDelete(route).block();
251+
break;
252+
default:
253+
ConnectLib.Logger().ERROR("Unsupported method type: " + method);
254+
return null;
250255
}
251256

252257
// Nettoie le store après utilisation

src/main/java/fr/sandro642/github/utils/Logs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class Logs {
3030
* Constructor of Logs
3131
* This constructor is private to ensure that the class is a singleton.
3232
*/
33-
private String pathFile;
33+
private static String pathFile;
3434

3535
/**
3636
* Make list for save logs in memory before writing to file.

src/test/java/fr/sandro642/github/test/MainTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import fr.sandro642.github.jobs.misc.ResourceType;
88
import fr.sandro642.github.jobs.misc.VersionType;
99
import fr.sandro642.github.utils.ConvertEnum;
10+
import fr.sandro642.github.utils.YamlUtils;
1011
import org.junit.jupiter.api.Test;
1112

1213
/**

0 commit comments

Comments
 (0)