feat: Implement RekapGarduDistribusi resource and related DTOs

- Added RekapGarduDistribusiResource for handling data retrieval and synchronization.
- Created RekapGarduDistribusiDTO to represent the data structure for distribution records.
- Developed RekapGarduDistribusiResponse to encapsulate the response from the external API.
- Introduced RekapGarduDistribusi entity to map to the database table.
- Implemented GarduService for synchronizing data with external API.
- Enhanced error handling and logging during data synchronization.
This commit is contained in:
Eko Haryadi
2025-08-26 16:20:27 +07:00
parent be06f273c5
commit 091106abf4
8 changed files with 20484 additions and 2 deletions

View File

@@ -4,7 +4,6 @@ import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Base64;
import io.quarkus.scheduler.Scheduled;
import jakarta.enterprise.context.ApplicationScoped;
@@ -35,4 +34,16 @@ public class MyScheduledBean {
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Scheduled task executed successfully");
}
@Scheduled(cron = "0 59 23 1 * ?")
void scheduleCronGardu() throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://10.14.212.9:32184/rekapGarduDistribusi/sinkron"))
.GET()
.build();
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Scheduled Rekap Gardu task executed successfully");
}
}