/// <summary>构造函数</summary> public ServerAppDataService(IMongoConfig config, IMongoCollection <TDocument> accessor, IMongoCollection <MongoUploadFile> uploadFilesCollection) { Accessor = accessor; FileFormatExtension.Init(); this.ExtConverterMappers = new Dictionary <string, FileFormatConverters>(); UploadFileHandler = new UploadFileHandler(config, uploadFilesCollection); }
/// <summary>根据DataID或FileID获得相关文件流</summary> public async Task <DownloadResult> DownloadAsync(DownloadRequest request) { TDocument doc = null; if (request.ContentRef.IsNullOrEmpty() && !request.DataId.IsNullOrEmpty()) { doc = await GetAsync(request.DataId); } return(await UploadFileHandler.DownloadAsync(request, doc)); }
/// <summary>上传文件,小资源文件直接上传内容</summary> public async Task <UploadFileResult> UploadFileAsync(UploadFileRequest request) { return(await UploadFileHandler.UploadFileAsync(request)); }