class UploadController {
    @Autowired
    private FileTool fileTool;

    @WebAspect
    @Operation(summary = "上传文件", description = "上传文件到服务器")
    @Parameters(value = {
            @Parameter(name = "file", description = "文件"),
            @Parameter(name = "type", description = "文件类型(只能为keepFiles、imageFiles、recordFiles、logFiles、packageFiles)"),
    })
    @PostMapping
    public RespModel<String> uploadFiles(@RequestParam(name = "file") MultipartFile file,
                                         @RequestParam(name = "type") String type) throws IOException {<FILL_FUNCTION_BODY>}

    @WebAspect
    @Operation(summary = "上传文件v2", description = "上传文件到服务器")
    @Parameters(value = {
            @Parameter(name = "file", description = "文件"),
            @Parameter(name = "type", description = "文件类型(只能为keepFiles、imageFiles、recordFiles、logFiles、packageFiles)"),
    })
    @PostMapping("/v2")
    public RespModel<String> uploadFilesV2(@RequestParam(name = "file") MultipartFile file,
                                           @RequestParam(name = "type") String type) throws IOException {
        String url = fileTool.uploadV2(type, file);
        if (url != null) {
            return new RespModel(RespEnum.UPLOAD_OK, url);
        } else {
            return new RespModel(RespEnum.UPLOAD_FAIL);
        }
    }

    @WebAspect
    @Operation(summary = "上传文件（录像分段上传）", description = "上传文件到服务器")
    @Parameters(value = {
            @Parameter(name = "file", description = "文件"),
            @Parameter(name = "uuid", description = "文件uuid"),
            @Parameter(name = "index", description = "当前index"),
            @Parameter(name = "total", description = "index总数"),
    })
    @PostMapping(value = "/recordFiles")
    public RespModel<String> uploadRecord(@RequestParam(name = "file") MultipartFile file,
                                          @RequestParam(name = "uuid") String uuid,
                                          @RequestParam(name = "index") int index,
                                          @RequestParam(name = "total") int total) throws IOException {
        //先创建对应uuid的文件夹
        File uuidFolder = new File("recordFiles" + File.separator + uuid);
        if (!uuidFolder.exists()) {
            uuidFolder.mkdirs();
        }
        String fileName = file.getOriginalFilename();
        String newName = fileName.substring(0, fileName.indexOf(".mp4")) + "-" + index + ".mp4";
        File local = new File(uuidFolder.getPath() + File.separator + newName);
        RespModel<String> responseModel;
        try {
            file.transferTo(local.getAbsoluteFile());
            responseModel = new RespModel<>(RespEnum.UPLOAD_OK);
        } catch (FileAlreadyExistsException e) {
            responseModel = new RespModel<>(RespEnum.UPLOAD_FAIL);
        }
        //如果当前是最后一个，就开始合并录像文件
        if (index == total - 1) {
            responseModel.setData(fileTool.merge(uuid, file.getOriginalFilename(), total));
        }
        return responseModel;
    }
}

        String url = fileTool.upload(type, file);
        if (url != null) {
            return new RespModel(RespEnum.UPLOAD_OK, url);
        } else {
            return new RespModel(RespEnum.UPLOAD_FAIL);
        }
    
<no_super_class>