!186 文件表建加原文件名称字段original_name,相关代码修改

Merge pull request !186 from 谢谢的谢/master
This commit is contained in:
芋道源码
2022-06-14 23:52:47 +00:00
committed by Gitee
10 changed files with 36 additions and 16 deletions

View File

@ -1,7 +1,5 @@
package cn.iocoder.yudao.module.infra.api.file;
import cn.hutool.core.util.IdUtil;
/**
* 文件 API 接口
*
@ -15,9 +13,9 @@ public interface FileApi {
* @param content 文件内容
* @return 文件路径
*/
default String createFile(byte[] content) throws Exception {
return createFile(IdUtil.fastUUID(), content);
}
default String createFile(byte[] content) throws Exception {
return createFile(null, null, content);
}
/**
* 保存文件,并返回文件的访问路径
@ -26,6 +24,18 @@ public interface FileApi {
* @param content 文件内容
* @return 文件路径
*/
String createFile(String path, byte[] content) throws Exception;
default String createFile(String path, byte[] content) throws Exception {
return createFile(null, path, content);
}
/**
* 保存文件,并返回文件的访问路径
*
* @param name 原文件名称
* @param path 文件路径
* @param content 文件内容
* @return 文件路径
*/
String createFile(String name, String path, byte[] content) throws Exception;
}