PDF-Service-Aufrufe auf versionierte API umgestellt (/api/v1)

Die API-Version steckt in der Basis-URL (PDF_SERVICE_URL, Standard
http://localhost:8084/api/v1); der Client ruft relativ dazu /invoices/sign auf.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 11:55:25 +02:00
co-authored by Claude Fable 5
parent 60aba03633
commit dcf68fede6
4 changed files with 12 additions and 9 deletions
+3 -2
View File
@@ -7,5 +7,6 @@ MONGODB_URI=mongodb://BENUTZER:PASSWORT@localhost:27017/pdf-tool?authSource=admi
# HTTP-Port der Anwendung (Standard: 8083)
SERVER_PORT=8083
# Basis-URL des PDF Service (ZUGFeRD-Umwandlung, Standard: http://localhost:8084)
PDF_SERVICE_URL=http://localhost:8084
# Basis-URL der PDF-Service-API (ZUGFeRD-Umwandlung); die Endpoints
# /invoices/sign und /invoices/validate liegen unterhalb dieser URL.
PDF_SERVICE_URL=http://localhost:8084/api/v1
+3 -2
View File
@@ -41,8 +41,9 @@ java -jar target/pdf-tool-1.0.0-SNAPSHOT.jar
Die ZUGFeRD-Umwandlung (PDF/A-3 + EN16931-XML, Mustangproject) übernimmt das
eigenständige Projekt **PDF Service** (`../PDF Service`, Port 8084). Dieses Tool
rendert die Rechnung aus dem Template und ruft dann dessen REST-API
(`POST /api/invoices/sign`) auf — der Service muss dafür laufen. Die Basis-URL
ist über `PDF_SERVICE_URL` konfigurierbar (Standard `http://localhost:8084`).
(`POST /api/v1/invoices/sign`) auf — der Service muss dafür laufen. Die Basis-URL
der API ist über `PDF_SERVICE_URL` konfigurierbar (Standard
`http://localhost:8084/api/v1`).
## Architektur
@@ -24,7 +24,8 @@ import java.util.Map;
/**
* Client für die REST-API des PDF Service (eigenständiges Projekt), der aus
* einem Rechnungs-PDF und den Metadaten die ZUGFeRD-E-Rechnung als ZIP erzeugt
* ({@code POST /api/invoices/sign}).
* ({@code POST {pdfservice.url}/invoices/sign}, Standard-Basis
* {@code http://localhost:8084/api/v1}).
*/
@Service
public class PdfServiceClient {
@@ -41,7 +42,7 @@ public class PdfServiceClient {
}
public PdfServiceClient(ObjectMapper objectMapper,
@Value("${pdfservice.url:http://localhost:8084}") String baseUrl) {
@Value("${pdfservice.url:http://localhost:8084/api/v1}") String baseUrl) {
this.objectMapper = objectMapper;
this.baseUrl = baseUrl;
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
@@ -85,7 +86,7 @@ public class PdfServiceClient {
ResponseEntity<byte[]> response;
try {
response = restClient.post()
.uri("/api/invoices/sign")
.uri("/invoices/sign")
.contentType(MediaType.MULTIPART_FORM_DATA)
.body(parts)
.retrieve()
+2 -2
View File
@@ -16,8 +16,8 @@ server.servlet.session.cookie.name=PDFTOOL_SESSION
pdftool.version=@project.version@
# PDF Service: erzeugt aus dem gerenderten Rechnungs-PDF die ZUGFeRD-E-Rechnung
# (eigenständiges Projekt "PDF Service", POST /api/invoices/sign)
pdfservice.url=${PDF_SERVICE_URL:http://localhost:8084}
# (eigenständiges Projekt "PDF Service", POST {pdfservice.url}/invoices/sign)
pdfservice.url=${PDF_SERVICE_URL:http://localhost:8084/api/v1}
# Auch normale (Nicht-Multipart-)Requests bis 30 MB zulassen: Canvas-Daten mit
# eingebetteten Bild-Elementen können das Tomcat-Standardlimit von 2 MB