Spaces:
Sleeping
Sleeping
File size: 1,097 Bytes
37decb3 fc9a733 37decb3 fc9a733 37decb3 fc9a733 37decb3 0048178 37decb3 fc9a733 37decb3 fc9a733 37decb3 fc9a733 37decb3 0048178 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
package com.cs102.attendance.controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.cs102.attendance.service.FastApiCallerService;
@RestController
@CrossOrigin(origins = "https://cs-102-vert.vercel.app/")
public class FastApiCallerController {
private final FastApiCallerService fastApiCallerService;
public FastApiCallerController(FastApiCallerService fastApiCallerService) {
this.fastApiCallerService = fastApiCallerService;
}
@PostMapping("/call-face-recognition")
public String callFaceRecognition(@RequestParam("image") MultipartFile imageFile) {
try {
return fastApiCallerService.callFaceRecognitionWithImage(imageFile);
} catch (Exception e) {
e.printStackTrace();
return "Error processing image: " + e.getMessage();
}
}
}
|