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()
|
new License()
|
||||||
.name("MIT")
|
.name("MIT")
|
||||||
.url(
|
.url(
|
||||||
"https://raw.githubusercontent.com/Stirling-Tools/Stirling-PDF/refs/heads/main/LICENSE")
|
"https://raw.githubusercontent.com/Stirling-Tools/Stirling-PDF/refs/heads/main/LICENSE"))
|
||||||
.identifier("MIT"))
|
|
||||||
.termsOfService("https://www.stirlingpdf.com/terms")
|
.termsOfService("https://www.stirlingpdf.com/terms")
|
||||||
.contact(
|
.contact(
|
||||||
new Contact()
|
new Contact()
|
||||||
@ -73,4 +72,5 @@ public class OpenApiConfig {
|
|||||||
.addSecurityItem(new SecurityRequirement().addList("apiKey"));
|
.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
|
@RestController
|
||||||
@RequestMapping("/api/v1/misc")
|
@RequestMapping("/api/v1/misc")
|
||||||
@Tag(name = "Misc", description = "Miscellaneous PDF APIs")
|
@Tag(name = "Misc", description = "Miscellaneous APIs")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ScannerEffectController {
|
public class ScannerEffectController {
|
||||||
|
@ -141,10 +141,7 @@ public class CertSignController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@AutoJobPostMapping(
|
@AutoJobPostMapping(
|
||||||
consumes = {
|
consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
|
||||||
MediaType.MULTIPART_FORM_DATA_VALUE,
|
|
||||||
MediaType.APPLICATION_FORM_URLENCODED_VALUE
|
|
||||||
},
|
|
||||||
value = "/cert-sign")
|
value = "/cert-sign")
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "Sign PDF with a Digital Certificate",
|
summary = "Sign PDF with a Digital Certificate",
|
||||||
|
@ -58,12 +58,13 @@ public class RedactController {
|
|||||||
|
|
||||||
@AutoJobPostMapping(value = "/redact", consumes = "multipart/form-data")
|
@AutoJobPostMapping(value = "/redact", consumes = "multipart/form-data")
|
||||||
@Operation(
|
@Operation(
|
||||||
|
operationId = "redactPdfManual",
|
||||||
summary = "Redacts areas and pages in a PDF document",
|
summary = "Redacts areas and pages in a PDF document",
|
||||||
description =
|
description =
|
||||||
"This operation takes an input PDF file with a list of areas, page"
|
"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,"
|
+ " number(s)/range(s)/function(s) to redact. Input:PDF, Output:PDF,"
|
||||||
+ " Type:SISO")
|
+ " Type:SISO")
|
||||||
public ResponseEntity<byte[]> redactPDF(@ModelAttribute ManualRedactPdfRequest request)
|
public ResponseEntity<byte[]> redactPdfManual(@ModelAttribute ManualRedactPdfRequest request)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
MultipartFile file = request.getFileInput();
|
MultipartFile file = request.getFileInput();
|
||||||
List<RedactionArea> redactionAreas = request.getRedactions();
|
List<RedactionArea> redactionAreas = request.getRedactions();
|
||||||
@ -192,6 +193,7 @@ public class RedactController {
|
|||||||
|
|
||||||
@AutoJobPostMapping(value = "/auto-redact", consumes = "multipart/form-data")
|
@AutoJobPostMapping(value = "/auto-redact", consumes = "multipart/form-data")
|
||||||
@Operation(
|
@Operation(
|
||||||
|
operationId = "redactPdfAuto",
|
||||||
summary = "Redacts listOfText in a PDF document",
|
summary = "Redacts listOfText in a PDF document",
|
||||||
description =
|
description =
|
||||||
"This operation takes an input PDF file and redacts the provided listOfText."
|
"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;
|
import stirling.software.common.util.CheckProgramInstall;
|
||||||
|
|
||||||
// @Controller // Disabled - Backend-only mode, no Thymeleaf UI
|
// @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
|
@RequiredArgsConstructor
|
||||||
public class OtherWebController {
|
public class OtherWebController {
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public class ServerCertificateController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/upload")
|
@PostMapping(value = "/upload", consumes = "multipart/form-data")
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "Upload server certificate",
|
summary = "Upload server certificate",
|
||||||
description =
|
description =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user