- 将 App.vue 拆分为 AdminPage、ClientPage、QrCodeModal 三个独立组件 - 新增 BrowseDirectory 接口,基于 RelativePath 实现层级目录浏览 - 前端新增面包屑导航、文件夹网格、文件列表等目录浏览 UI - 新增对应 CSS 样式(breadcrumb、folder-grid、file-list 等) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
87 lines
2.7 KiB
C#
87 lines
2.7 KiB
C#
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);
|
|
|
|
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);
|
|
|
|
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 BrowseDirectoryRequest(
|
|
[property: JsonPropertyName("rootId")] int RootId = 0,
|
|
[property: JsonPropertyName("path")] string? Path = null);
|
|
|
|
public sealed record BrowseDirectoryResponse(
|
|
string CurrentPath,
|
|
List<string> Subdirectories,
|
|
List<FileRecordDto> Files);
|
|
|
|
public sealed record TextPreviewDto(
|
|
int Id,
|
|
string FileName,
|
|
string Content,
|
|
bool Truncated);
|
|
}
|