VirtuosoQ
2024-04-28 476dc3f30c014e0d2ebdc46ce0283ddbfe63eeb8
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
32
33
34
35
36
package com.example.funasr_java_client.Servcvice;
 
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
import java.io.IOException;
import java.util.concurrent.ExecutionException;
 
/**
 *
 * @author Virgil Qiu
 * @since 2024/04/24
 *
 */
@RestController
@RequestMapping("/recognition")
public class RecognitionController {
 
    private final RecognitionService recognitionService;
 
    public RecognitionController(RecognitionService recognitionService) {
        this.recognitionService = recognitionService;
    }
    @PostMapping("/testNIO")
    public String testIO(@RequestParam MultipartFile file) throws IOException, ExecutionException, InterruptedException {
        recognitionService.recognition(file);
        return "测试成功";
    }
 
    @PostMapping("/testIO")
    public String testNIO(@RequestParam MultipartFile file) throws IOException, ExecutionException, InterruptedException {
        recognitionService.recognition(file);
        return "测试成功";
    }
}