feat: 初始功能

This commit is contained in:
Shiqvlizi Name
2026-05-23 18:16:50 +08:00
parent a5bfd8792e
commit 9a51259e9e
63 changed files with 5377 additions and 1 deletions

71
Models/Document.cs Normal file
View File

@@ -0,0 +1,71 @@
using CloudPrint.Client.Infrastructure;
namespace CloudPrint.Client.Models;
public sealed class CloudPrintDocument : ObservableObject
{
private string _title = string.Empty;
private string _description = string.Empty;
private string _categoryName = "未分类";
private bool _isUploaded;
private string _syncStatus = "本地";
public int Id { get; init; }
public string FileName { get; init; } = string.Empty;
public string FilePath { get; init; } = string.Empty;
public string FileType { get; init; } = string.Empty;
public long FileSize { get; init; }
public string UploaderType { get; init; } = "admin";
public int UploaderId { get; init; }
public int CategoryId { get; init; }
public int PageCount { get; init; }
public DateTime CreatedAt { get; init; } = DateTime.Now;
public string Title
{
get => _title;
set => SetProperty(ref _title, value);
}
public string Description
{
get => _description;
set => SetProperty(ref _description, value);
}
public string CategoryName
{
get => _categoryName;
set => SetProperty(ref _categoryName, value);
}
public bool IsUploaded
{
get => _isUploaded;
set => SetProperty(ref _isUploaded, value);
}
public string SyncStatus
{
get => _syncStatus;
set => SetProperty(ref _syncStatus, value);
}
public string FileSizeText
{
get
{
if (FileSize >= 1024 * 1024)
{
return $"{FileSize / 1024d / 1024d:F2} MB";
}
if (FileSize >= 1024)
{
return $"{FileSize / 1024d:F2} KB";
}
return $"{FileSize} B";
}
}
}