文件录制

This commit is contained in:
18792927508
2023-10-28 11:50:32 +08:00
parent 6865b437a5
commit d993b57a09
2 changed files with 4 additions and 2 deletions
@@ -51,10 +51,9 @@ public class VideoController extends BaseController {
} }
/** /**
* 根据案件ID查询视频 * 根据案件ID查询视频
* @param * @param caseId 案件id
* @return * @return
*/ */
@Anonymous
@GetMapping("/videoList") @GetMapping("/videoList")
public AjaxResult videoList( @RequestParam Long caseId) { public AjaxResult videoList( @RequestParam Long caseId) {
@@ -215,6 +215,7 @@ public class VideoServiceImpl implements VideoService {
@Transactional @Transactional
public String downloadImage(String fileId,String fileUrl,String roomId) throws IOException { public String downloadImage(String fileId,String fileUrl,String roomId) throws IOException {
String staticAndMksDir = null; String staticAndMksDir = null;
log.info("fileUrl========");
if (fileUrl != null) { if (fileUrl != null) {
//下载时文件名称 //下载时文件名称
String fileName = fileUrl.substring(fileUrl.lastIndexOf("/")); String fileName = fileUrl.substring(fileUrl.lastIndexOf("/"));
@@ -223,6 +224,7 @@ public class VideoServiceImpl implements VideoService {
String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath(); String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath();
staticAndMksDir = Paths.get(absPath).toFile().toString(); staticAndMksDir = Paths.get(absPath).toFile().toString();
HttpUtil.downloadFile(fileUrl, staticAndMksDir ); HttpUtil.downloadFile(fileUrl, staticAndMksDir );
log.info("selectCaseIdByRoomId========");
Long caseId= caseApplicationMapper.selectCaseIdByRoomId(roomId); Long caseId= caseApplicationMapper.selectCaseIdByRoomId(roomId);
String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName); String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
// 存入数据库 // 存入数据库
@@ -231,6 +233,7 @@ public class VideoServiceImpl implements VideoService {
.annexPath(RuoYiConfig.getVideoUploadPath()) .annexPath(RuoYiConfig.getVideoUploadPath())
.annexType(9) .annexType(9)
.build(); .build();
log.info("视频保存========");
caseAttachMapper.save(caseAttach); caseAttachMapper.save(caseAttach);
return annexName; return annexName;
} }