|
|
@@ -28,6 +28,12 @@ public class LocalFileClient extends AbstractFileClient<LocalFileClientConfig> {
|
|
|
|
|
|
@Override
|
|
|
public String upload(byte[] content, String path, String type) {
|
|
|
+ // 本地存储时,按日期进行分文件夹存储
|
|
|
+ LocalDate today = LocalDate.now();
|
|
|
+ DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy/MM/dd/");
|
|
|
+ String directory = today.format(pattern);
|
|
|
+ path = directory + path;
|
|
|
+
|
|
|
// 执行写入
|
|
|
String filePath = getFilePath(path);
|
|
|
FileUtil.writeBytes(content, filePath);
|