Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-xzb1

This commit is contained in:
xzb 2022-10-09 13:34:55 +08:00
commit 23b169bb3b
3 changed files with 13 additions and 0 deletions

View File

@ -23,6 +23,11 @@ public class MinioController {
return minioService.preSignedObjectUrl(directory, fileName, method); return minioService.preSignedObjectUrl(directory, fileName, method);
} }
@GetMapping("/downloadUrl")
public String downloadUrl(String directory, String fileName) {
return minioService.downloadObjectUrl(directory, fileName);
}
@PostMapping("/file/save") @PostMapping("/file/save")
public void saveFile(@RequestAttribute AccountVO user, @RequestBody MinioFileInfo fileInfo) { public void saveFile(@RequestAttribute AccountVO user, @RequestBody MinioFileInfo fileInfo) {
minioService.saveFileInfo(user, fileInfo); minioService.saveFileInfo(user, fileInfo);

View File

@ -34,4 +34,6 @@ public interface MinioService {
* 更新文件信息 * 更新文件信息
*/ */
void update(MinioFileInfo fileInfo); void update(MinioFileInfo fileInfo);
String downloadObjectUrl(String directory, String fileName);
} }

View File

@ -80,4 +80,10 @@ public class MinioServiceImpl implements MinioService {
public void update(MinioFileInfo fileInfo) { public void update(MinioFileInfo fileInfo) {
minioFileInfoDao.updateByPrimaryKeySelective(fileInfo); minioFileInfoDao.updateByPrimaryKeySelective(fileInfo);
} }
@Override
public String downloadObjectUrl(String directory, String fileName) {
MinioClientUtil minioClientUtil = createMinioClientUtil(directory);
return minioClientUtil.getDownLoadPath(fileName);
}
} }