2026-05-21 16:45:56 +08:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace Avalonia_Services.Services.FileLibrary
|
|
|
|
|
{
|
|
|
|
|
public sealed record AddLibraryRootRequest(
|
|
|
|
|
[property: JsonPropertyName("path")] string? Path,
|
|
|
|
|
[property: JsonPropertyName("displayName")] string? DisplayName = null,
|
|
|
|
|
[property: JsonPropertyName("scanIntervalMinutes")] int? ScanIntervalMinutes = null);
|
|
|
|
|
|
|
|
|
|
public sealed record UpdateLibraryRootRequest(
|
|
|
|
|
[property: JsonPropertyName("id")] int Id,
|
|
|
|
|
[property: JsonPropertyName("isEnabled")] bool IsEnabled);
|
|
|
|
|
|
|
|
|
|
public sealed record ScanLibraryRootRequest(
|
|
|
|
|
[property: JsonPropertyName("id")] int Id);
|
|
|
|
|
|
|
|
|
|
public sealed record DeleteLibraryRootRequest(
|
|
|
|
|
[property: JsonPropertyName("id")] int Id);
|
|
|
|
|
|
2026-05-22 11:18:47 +08:00
|
|
|
public sealed record DirectoryQueryRequest(
|
|
|
|
|
[property: JsonPropertyName("path")] string? Path);
|
|
|
|
|
|
|
|
|
|
public sealed record FileQueryRequest(
|
|
|
|
|
[property: JsonPropertyName("id")] int Id);
|
|
|
|
|
|
|
|
|
|
public sealed record SearchFilesRequest(
|
|
|
|
|
[property: JsonPropertyName("page")] int Page = 1,
|
|
|
|
|
[property: JsonPropertyName("pageSize")] int PageSize = 24,
|
|
|
|
|
[property: JsonPropertyName("mediaType")] string? MediaType = null,
|
|
|
|
|
[property: JsonPropertyName("keyword")] string? Keyword = null,
|
|
|
|
|
[property: JsonPropertyName("rootId")] int RootId = 0);
|
|
|
|
|
|
2026-05-21 16:45:56 +08:00
|
|
|
public sealed record DriveDto(
|
|
|
|
|
string Name,
|
|
|
|
|
string DisplayName,
|
|
|
|
|
string RootDirectory,
|
|
|
|
|
string DriveType,
|
|
|
|
|
long? TotalSize,
|
|
|
|
|
long? AvailableFreeSpace,
|
|
|
|
|
bool IsReady);
|
|
|
|
|
|
|
|
|
|
public sealed record DirectoryDto(
|
|
|
|
|
string Name,
|
|
|
|
|
string FullPath);
|
|
|
|
|
|
|
|
|
|
public sealed record LibraryRootDto(
|
|
|
|
|
int Id,
|
|
|
|
|
string Path,
|
|
|
|
|
string DisplayName,
|
|
|
|
|
bool IsEnabled,
|
|
|
|
|
bool IsAvailable,
|
|
|
|
|
int ScanIntervalMinutes,
|
|
|
|
|
DateTime? LastScanStartedAt,
|
|
|
|
|
DateTime? LastScanCompletedAt,
|
|
|
|
|
string? LastScanError,
|
|
|
|
|
int FileCount);
|
|
|
|
|
|
|
|
|
|
public sealed record FileRecordDto(
|
|
|
|
|
int Id,
|
|
|
|
|
int LibraryRootId,
|
|
|
|
|
string FileName,
|
|
|
|
|
string RelativePath,
|
|
|
|
|
string Extension,
|
|
|
|
|
long SizeBytes,
|
|
|
|
|
DateTime LastWriteTimeUtc,
|
|
|
|
|
string MediaType,
|
|
|
|
|
string ContentType,
|
|
|
|
|
string StreamUrl,
|
|
|
|
|
string? TextUrl,
|
|
|
|
|
bool BrowserPlayable);
|
|
|
|
|
|
|
|
|
|
public sealed record TextPreviewDto(
|
|
|
|
|
int Id,
|
|
|
|
|
string FileName,
|
|
|
|
|
string Content,
|
|
|
|
|
bool Truncated);
|
|
|
|
|
}
|