camers scan init

This commit is contained in:
Anthony Stirling
2025-06-04 15:45:50 +01:00
parent 488fe253aa
commit a187f0599b
26 changed files with 1963 additions and 9 deletions
@@ -24,7 +24,9 @@ public class CleanUrlInterceptor implements HandlerInterceptor {
"file",
"messageType",
"infoMessage",
"async");
"async",
"session",
"t");
@Override
public boolean preHandle(
@@ -173,6 +173,7 @@ public class EndpointConfiguration {
addEndpointToGroup("Other", "get-info-on-pdf");
addEndpointToGroup("Other", "show-javascript");
addEndpointToGroup("Other", "remove-image-pdf");
addEndpointToGroup("Other", "scan-upload");
// CLI
addEndpointToGroup("CLI", "compress-pdf");
@@ -0,0 +1,24 @@
package stirling.software.SPDF.controller.api.misc;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
/**
* Controller for scan upload functionality - WebRTC version.
*
* This controller is completely empty as all functionality has been moved to WebRTC.
* The image transfer happens directly between browsers without any server involvement.
*/
@RestController
@RequestMapping("/api/v1/misc")
@Tag(name = "Misc", description = "Miscellaneous APIs")
@Hidden
@Slf4j
public class ScanUploadController {
// All functionality has been moved to client-side WebRTC
}
@@ -0,0 +1,49 @@
package stirling.software.SPDF.controller.web;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* Web controller for the scan-upload functionality.
*/
@Controller
@Tag(name = "Scan Upload", description = "Scan Upload Web Interface")
@Slf4j
@RequiredArgsConstructor
public class ScanUploadWebController {
/**
* Serves the scan-upload page for desktop/PC view.
*
* @param model the Spring MVC model
* @return the template name to render
*/
@GetMapping("/scan-upload")
@Hidden
public String scanUploadForm(Model model) {
model.addAttribute("currentPage", "scan-upload");
return "misc/scan-upload";
}
/**
* Serves the mobile page for camera capture and upload.
*
* @param model the Spring MVC model
* @param session the session ID parameter
* @return the template name to render
*/
@GetMapping("/mobile")
@Hidden
public String mobileView(Model model, @RequestParam(name = "session", required = false) String session) {
model.addAttribute("sessionId", session);
return "misc/mobile";
}
}