feat: 优化
This commit is contained in:
@@ -72,4 +72,11 @@ public interface FileApi {
|
||||
*/
|
||||
String getMasterFileDomain();
|
||||
|
||||
/**
|
||||
* 根据OSS URL删除文件
|
||||
*
|
||||
* @param ossUrl OSS文件完整URL
|
||||
*/
|
||||
void deleteFileByUrl(@NotEmpty(message = "URL 不能为空") String ossUrl);
|
||||
|
||||
}
|
||||
|
||||
@@ -49,4 +49,13 @@ public class FileApiImpl implements FileApi {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFileByUrl(String ossUrl) {
|
||||
try {
|
||||
fileService.deleteFileByUrl(ossUrl);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("删除文件失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user