This commit is contained in:
fuenmao
2026-08-24 14:26:11 +08:00
parent 01328d567c
commit a51d45372d
54 changed files with 2607 additions and 119 deletions
@@ -1,4 +1,4 @@
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
//
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
// 1.请不要删除和修改根目录下的LICENSE文件。
@@ -100,6 +100,16 @@ public class FileService : DbRepository<SysFile>, IFileService
return null;
}
public async Task<long> StoreGeneratedFile(string engine, string fileName, byte[] content)
{
await using var stream = new MemoryStream(content);
IFormFile file = new FormFile(stream, 0, content.Length, "file", fileName)
{
Headers = new HeaderDictionary(),
ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
};
return await StorageFile(engine, file);
}
#region 方法
/// <summary>
@@ -1,4 +1,4 @@
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
//
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
// 1.请不要删除和修改根目录下的LICENSE文件。
@@ -60,4 +60,5 @@ public interface IFileService : ITransient
/// <param name="file">文件</param>
/// <returns></returns>
Task<long> UploadFile(string engine, IFormFile file);
Task<long> StoreGeneratedFile(string engine, string fileName, byte[] content);
}