添加项目文件。

This commit is contained in:
Zel
2025-01-22 23:31:03 +08:00
parent 1b8ba6771f
commit 2ae76476fb
894 changed files with 774558 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
using System.ComponentModel.DataAnnotations;
using TightWiki.Models.DataModels;
namespace TightWiki.Models.ViewModels.Profile
{
public partial class AccountProfileAccountViewModel
{
[Display(Name = "Theme")]
public string? Theme { get; set; } = string.Empty;
[Required(ErrorMessage = "UserId is required")]
public Guid UserId { get; set; }
[Display(Name = "Email Address")]
public string EmailAddress { get; set; } = string.Empty;
[Display(Name = "Account Name")]
[Required(ErrorMessage = "Account Name is required")]
public string AccountName { get; set; } = string.Empty;
public string Navigation { get; set; } = string.Empty;
[Display(Name = "First Name")]
public string? FirstName { get; set; }
[Display(Name = "Last Name")]
public string? LastName { get; set; } = string.Empty;
[Display(Name = "Time-Zone")]
[Required(ErrorMessage = "TimeZone is required")]
public string TimeZone { get; set; } = string.Empty;
[Display(Name = "Country")]
[Required(ErrorMessage = "Country is required")]
public string Country { get; set; } = string.Empty;
[Display(Name = "Language")]
[Required(ErrorMessage = "Language is required")]
public string Language { get; set; } = string.Empty;
[Display(Name = "Biography")]
public string? Biography { get; set; } = string.Empty;
[Display(Name = "Email Confirmed?")]
public bool EmailConfirmed { get; set; }
public byte[]? Avatar { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime ModifiedDate { get; set; }
public int PaginationPageSize { get; set; }
public int PaginationPageCount { get; set; }
public string? Role { get; set; } = string.Empty;
public static AccountProfileAccountViewModel FromDataModel(AccountProfile model)
{
return new AccountProfileAccountViewModel
{
Theme = model.Theme,
UserId = model.UserId,
EmailAddress = model.EmailAddress,
AccountName = model.AccountName,
Avatar = model.Avatar,
Biography = model.Biography,
Country = model.Country,
Language = model.Language,
CreatedDate = model.CreatedDate,
EmailConfirmed = model.EmailConfirmed,
FirstName = model.FirstName,
LastName = model.LastName,
ModifiedDate = model.ModifiedDate,
Navigation = model.Navigation,
PaginationPageCount = model.PaginationPageCount,
Role = model.Role,
PaginationPageSize = model.PaginationPageSize,
TimeZone = model.TimeZone
};
}
}
}

View File

@@ -0,0 +1,13 @@
using TightWiki.Library;
namespace TightWiki.Models.ViewModels.Profile
{
public class AccountProfileViewModel : ViewModelBase
{
public List<Theme> Themes { get; set; } = new();
public List<TimeZoneItem> TimeZones { get; set; } = new();
public List<CountryItem> Countries { get; set; } = new();
public List<LanguageItem> Languages { get; set; } = new();
public AccountProfileAccountViewModel AccountProfile { get; set; } = new();
}
}

View File

@@ -0,0 +1,14 @@
using TightWiki.Library;
using TightWiki.Models.DataModels;
namespace TightWiki.Models.ViewModels.Profile
{
public class AccountViewModel : ViewModelBase
{
public List<TimeZoneItem> TimeZones { get; set; } = new();
public List<CountryItem> Countries { get; set; } = new();
public List<LanguageItem> Languages { get; set; } = new();
public List<Role> Roles { get; set; } = new();
public AccountProfile Account { get; set; } = new();
}
}

View File

@@ -0,0 +1,6 @@
namespace TightWiki.Models.ViewModels.Profile
{
public class ConfirmViewModel : ViewModelBase
{
}
}

View File

@@ -0,0 +1,7 @@
namespace TightWiki.Models.ViewModels.Profile
{
public class DeleteAccountViewModel : ViewModelBase
{
public string? AccountName { get; set; }
}
}

View File

@@ -0,0 +1,6 @@
namespace TightWiki.Models.ViewModels.Profile
{
public class DeletedAccountViewModel : ViewModelBase
{
}
}

View File

@@ -0,0 +1,36 @@
using Microsoft.AspNetCore.Mvc.ModelBinding;
using System.ComponentModel.DataAnnotations;
using TightWiki.Models.DataModels;
namespace TightWiki.Models.ViewModels.Profile
{
public class PublicViewModel : ViewModelBase
{
public string Navigation { get; set; } = string.Empty;
public Guid Id { get; set; }
[Display(Name = "Name")]
public string AccountName { get; set; } = string.Empty;
[Display(Name = "Personal Bio")]
public string Biography { get; set; } = string.Empty;
[Display(Name = "Avatar")]
[BindNever]
public byte[]? Avatar { get; set; }
[Required]
[Display(Name = "Country")]
public string Country { get; set; } = string.Empty;
[Required]
[Display(Name = "Language")]
public string Language { get; set; } = string.Empty;
[Required]
[Display(Name = "Time Zone")]
public string TimeZone { get; set; } = string.Empty;
public List<PageRevision> RecentlyModified { get; set; } = new();
}
}