This commit is contained in:
孙小云 2025-03-13 10:43:03 +08:00
parent 785a4cd6d9
commit 70c658ea8c
3 changed files with 35 additions and 11 deletions

View File

@ -34,6 +34,9 @@ public class StreamRecordController {
@Autowired @Autowired
IRecordService iRecordService; IRecordService iRecordService;
@GetMapping("start") @GetMapping("start")
public Response<StreamTask> startRecording(@RequestParam String streamUrl) { public Response<StreamTask> startRecording(@RequestParam String streamUrl) {
System.out.println("启动录制 :"+streamUrl); System.out.println("启动录制 :"+streamUrl);

View File

@ -0,0 +1,11 @@
package com.tuoheng.steam.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController()
@RequestMapping("/test")
public class TestController {
}

View File

@ -72,9 +72,14 @@ public class Scheduler {
public void mergeTask() throws Exception { public void mergeTask() throws Exception {
// File file = new File("/Users/sunpeng/workspace/text.txt"); // File file = new File("/Users/sunpeng/workspace/text.txt");
// InputStream inputStream = new FileInputStream(file); // InputStream inputStream = new FileInputStream(file);
// uploadFile2OSS(inputStream,"text.txt",file.length()); // try {
// uploadFile2OSS(inputStream,"text.txt",file.length());
getCredentials(); // }catch (Exception e) {
// logger.error(e.getMessage());
// }
//
//
// getCredentials();
} }
@ -143,14 +148,19 @@ public class Scheduler {
String contentType = getContentType(fileName.substring(fileName.lastIndexOf("."))); // 获取文件类型 String contentType = getContentType(fileName.substring(fileName.lastIndexOf("."))); // 获取文件类型
minioClient.putObject( try {
PutObjectArgs.builder() minioClient.putObject(
.bucket(bucketName) // 存储桶名称 PutObjectArgs.builder()
.object(filedir + "/" + fileName) // 对象名称路径 .bucket(bucketName) // 存储桶名称
.stream(inputStream, streamSize, -1) // 输入流文件大小-1 表示未知大小 .object(filedir + "/" + fileName) // 对象名称路径
.contentType(contentType) // 文件类型 .stream(inputStream, streamSize, -1) // 输入流文件大小-1 表示未知大小
.build() .contentType(contentType) // 文件类型
); .build()
);
}catch (Exception e) {
logger.error(e.getMessage());
}
} }