diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-12-22 16:32:31 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-12-22 16:32:31 +0100 |
| commit | f5374b0b3543b0bd7d280f71ed8bf5175bad3834 (patch) | |
| tree | 492974dc682d333c592a1807125d14dfc5dc1980 /code/api/Services | |
| parent | 7b715eb1883c9caf7d4b5143b8f7720dd663acd8 (diff) | |
| download | storage-f5374b0b3543b0bd7d280f71ed8bf5175bad3834.tar.xz storage-f5374b0b3543b0bd7d280f71ed8bf5175bad3834.zip | |
feat: !WIP initial tree-building logic
Diffstat (limited to 'code/api/Services')
| -rw-r--r-- | code/api/Services/Admin/UserService.cs | 1 | ||||
| -rw-r--r-- | code/api/Services/System/StorageService.cs | 23 |
2 files changed, 23 insertions, 1 deletions
diff --git a/code/api/Services/Admin/UserService.cs b/code/api/Services/Admin/UserService.cs index faa67c0..f149d73 100644 --- a/code/api/Services/Admin/UserService.cs +++ b/code/api/Services/Admin/UserService.cs @@ -1,4 +1,3 @@ -using System.Security.Claims; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; diff --git a/code/api/Services/System/StorageService.cs b/code/api/Services/System/StorageService.cs new file mode 100644 index 0000000..adbb883 --- /dev/null +++ b/code/api/Services/System/StorageService.cs @@ -0,0 +1,23 @@ +using MR.AspNetCore.Pagination; +using MR.EntityFrameworkCore.KeysetPagination; + +namespace I2R.Storage.Api.Services.System; + +public class StorageService +{ + private readonly AppDatabase _database; + private readonly ILogger<StorageService> _logger; + + public StorageService(AppDatabase database, ILogger<StorageService> logger) { + _database = database; + _logger = logger; + } + + public async Task<KeysetPaginationResult<FileSystemEntry>> GetFileSystemEntriesAsync(Guid parent = default) { + var keysetQuery = _database.Folders + .Include(c => c.Files) + .ConditionalWhere(() => parent != default, folder => folder.ParentId == parent) + .Select(p => new FileSystemEntry() { }); + return default; + } +}
\ No newline at end of file |
