hby100japp功能,语音音量增加

This commit is contained in:
2026-02-06 16:11:38 +08:00
parent f3551be093
commit efad1f5a4b
5 changed files with 165 additions and 10 deletions

View File

@ -68,6 +68,13 @@ public interface ISysOssService {
*/
SysOssVo updateHash(MultipartFile file, String hash);
/**
* 更新文件 hash 值
*
* @param file 文件对象
* @return 匹配的 SysOssVo 列表
*/
SysOssVo updateHash(File file, String hash);
/**
* 上传 MultipartFile 到对象存储服务,并保存文件信息到数据库
*

View File

@ -226,6 +226,22 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
return buildResultEntity(originalfileName, suffix, storage.getConfigKey(), uploadResult, hash);
}
@Override
public SysOssVo updateHash(File file, String hash) {
// 2. 先根据 hash 查库(秒传)
SysOssVo exist = baseMapper.selectByHash(hash);
if (exist != null) {
return exist;
}
String originalfileName = file.getName();
String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length());
OssClient storage = OssFactory.instance();
UploadResult uploadResult = storage.uploadSuffix(file, suffix);
// 保存文件信息
return buildResultEntity(originalfileName, suffix, storage.getConfigKey(), uploadResult, hash);
}
/**
* 上传 MultipartFile 到对象存储服务,并保存文件信息到数据库