mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-18 09:29:24 +00:00
API cleanup
This commit is contained in:
parent
019fe714c5
commit
2c2cc9e46e
@ -42,8 +42,7 @@ public class OpenApiConfig {
|
||||
new License()
|
||||
.name("MIT")
|
||||
.url(
|
||||
"https://raw.githubusercontent.com/Stirling-Tools/Stirling-PDF/refs/heads/main/LICENSE")
|
||||
.identifier("MIT"))
|
||||
"https://raw.githubusercontent.com/Stirling-Tools/Stirling-PDF/refs/heads/main/LICENSE"))
|
||||
.termsOfService("https://www.stirlingpdf.com/terms")
|
||||
.contact(
|
||||
new Contact()
|
||||
@ -73,4 +72,5 @@ public class OpenApiConfig {
|
||||
.addSecurityItem(new SecurityRequirement().addList("apiKey"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
package stirling.software.SPDF.config;
|
||||
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class SpringDocConfig {
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi pdfProcessingApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("pdf-processing")
|
||||
.displayName("PDF Processing API")
|
||||
.pathsToMatch("/api/v1/**")
|
||||
.pathsToExclude("/api/v1/admin/**", "/api/v1/user/**", "/api/v1/settings/**", "/api/v1/ui-data/**", "/api/v1/info/**", "/api/v1/general/job/**", "/api/v1/general/files/**")
|
||||
.addOpenApiCustomizer(openApi -> {
|
||||
openApi.info(openApi.getInfo()
|
||||
.title("Stirling PDF - Processing API")
|
||||
.description("API documentation for PDF processing operations including conversion, manipulation, security, and utility functions."));
|
||||
})
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi adminApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("admin")
|
||||
.displayName("Admin & Management API")
|
||||
.pathsToMatch("/api/v1/admin/**", "/api/v1/user/**", "/api/v1/settings/**")
|
||||
.addOpenApiCustomizer(openApi -> {
|
||||
openApi.info(openApi.getInfo()
|
||||
.title("Stirling PDF - Admin API")
|
||||
.description("API documentation for administrative functions, user management, settings, and system configuration."));
|
||||
})
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi systemApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("system")
|
||||
.displayName("System & UI API")
|
||||
.pathsToMatch("/api/v1/ui-data/**", "/api/v1/info/**", "/api/v1/general/job/**", "/api/v1/general/files/**")
|
||||
.addOpenApiCustomizer(openApi -> {
|
||||
openApi.info(openApi.getInfo()
|
||||
.title("Stirling PDF - System API")
|
||||
.description("API documentation for system information, UI data, and general utility endpoints."));
|
||||
})
|
||||
.build();
|
||||
}
|
||||
}
|
@ -39,7 +39,7 @@ import stirling.software.common.util.WebResponseUtils;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/misc")
|
||||
@Tag(name = "Misc", description = "Miscellaneous PDF APIs")
|
||||
@Tag(name = "Misc", description = "Miscellaneous APIs")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ScannerEffectController {
|
||||
|
@ -141,10 +141,7 @@ public class CertSignController {
|
||||
}
|
||||
|
||||
@AutoJobPostMapping(
|
||||
consumes = {
|
||||
MediaType.MULTIPART_FORM_DATA_VALUE,
|
||||
MediaType.APPLICATION_FORM_URLENCODED_VALUE
|
||||
},
|
||||
consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
|
||||
value = "/cert-sign")
|
||||
@Operation(
|
||||
summary = "Sign PDF with a Digital Certificate",
|
||||
|
@ -58,12 +58,13 @@ public class RedactController {
|
||||
|
||||
@AutoJobPostMapping(value = "/redact", consumes = "multipart/form-data")
|
||||
@Operation(
|
||||
operationId = "redactPdfManual",
|
||||
summary = "Redacts areas and pages in a PDF document",
|
||||
description =
|
||||
"This operation takes an input PDF file with a list of areas, page"
|
||||
+ " number(s)/range(s)/function(s) to redact. Input:PDF, Output:PDF,"
|
||||
+ " Type:SISO")
|
||||
public ResponseEntity<byte[]> redactPDF(@ModelAttribute ManualRedactPdfRequest request)
|
||||
public ResponseEntity<byte[]> redactPdfManual(@ModelAttribute ManualRedactPdfRequest request)
|
||||
throws IOException {
|
||||
MultipartFile file = request.getFileInput();
|
||||
List<RedactionArea> redactionAreas = request.getRedactions();
|
||||
@ -192,6 +193,7 @@ public class RedactController {
|
||||
|
||||
@AutoJobPostMapping(value = "/auto-redact", consumes = "multipart/form-data")
|
||||
@Operation(
|
||||
operationId = "redactPdfAuto",
|
||||
summary = "Redacts listOfText in a PDF document",
|
||||
description =
|
||||
"This operation takes an input PDF file and redacts the provided listOfText."
|
||||
|
@ -17,7 +17,7 @@ import stirling.software.common.model.ApplicationProperties;
|
||||
import stirling.software.common.util.CheckProgramInstall;
|
||||
|
||||
// @Controller // Disabled - Backend-only mode, no Thymeleaf UI
|
||||
@Tag(name = "Misc", description = "Miscellaneous APIs")
|
||||
// @Tag(name = "Misc", description = "Miscellaneous APIs") // Disabled - not a controller
|
||||
@RequiredArgsConstructor
|
||||
public class OtherWebController {
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class ServerCertificateController {
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/upload")
|
||||
@PostMapping(value = "/upload", consumes = "multipart/form-data")
|
||||
@Operation(
|
||||
summary = "Upload server certificate",
|
||||
description =
|
||||
|
Loading…
x
Reference in New Issue
Block a user