文件上传接口保留path参数,方便覆盖文件

This commit is contained in:
谢华宁
2022-05-31 22:26:26 +08:00
parent 20411fa6b5
commit 250db847f6
7 changed files with 29 additions and 12 deletions

View File

@ -14,16 +14,28 @@ public interface FileApi {
* @return 文件路径
*/
default String createFile(byte[] content) throws Exception {
return createFile(null, content);
return createFile(null, null, content);
}
/**
* 保存文件,并返回文件的访问路径
*
* @param path 文件路径
* @param content 文件内容
* @return 文件路径
*/
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, byte[] content) throws Exception;
String createFile(String name, String path, byte[] content) throws Exception;
}