Saving
This commit is contained in:
6
Models/ActionBarFilter.cs
Normal file
6
Models/ActionBarFilter.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace decePubClient.Models;
|
||||
|
||||
public class ActionBarFilter
|
||||
{
|
||||
|
||||
}
|
22
Models/AuthData.cs
Normal file
22
Models/AuthData.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace decePubClient.Models
|
||||
{
|
||||
public class AuthData
|
||||
{
|
||||
public string Token { get; set; }
|
||||
public long? TokenExpiration { get; set; }
|
||||
public string CurrentLanguageCode { get; set; } = "en";
|
||||
public User User { get; set; }
|
||||
|
||||
//public bool UserHasPolicies(params string[] policies)
|
||||
//{
|
||||
// var hasAllPolicies = true;
|
||||
// foreach (var policy in policies)
|
||||
// if (!(User?.Policies?.Any(p => p == policy) ?? false))
|
||||
// {
|
||||
// hasAllPolicies = false;
|
||||
// break;
|
||||
// }
|
||||
// return hasAllPolicies;
|
||||
//}
|
||||
}
|
||||
}
|
39
Models/ClientLogs.cs
Normal file
39
Models/ClientLogs.cs
Normal file
@ -0,0 +1,39 @@
|
||||
namespace decePubClient.Models
|
||||
{
|
||||
public class ClientLogs
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Where { get; set; }
|
||||
public string WarningMessage { get; set; }
|
||||
public ClientLogException Exception { get; set; }
|
||||
public DateTime TimeStamp { get; set; } = DateTime.Now;
|
||||
public string ErrorMessage()
|
||||
{
|
||||
if (Exception.InnerExceptionMessage != null)
|
||||
{
|
||||
return @$"<b>Type</b>: {Exception.Type ?? "N/A"} <b>HelpLink</b>: {Exception.HelpLink ?? "N/A"} <b>HResult</b>: {Exception.HResult ?? "N/A"}<br>
|
||||
<b>Source</b>: {Exception.Source ?? "N/A"} <b>StackTrace</b>: {Exception.StackTrace ?? "N/A"} <b>MemberName</b>: {Exception.TargetSiteName ?? "N/A"}<br>
|
||||
<b>Message</b>: {Exception.Message ?? "N/A"}<br>
|
||||
<b>InnerExceptionMessage</b>:{Exception.InnerExceptionMessage ?? "N/A"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return @$"<b>Type</b>: {Exception.Type ?? "N/A"} <b>HelpLink</b>: {Exception.HelpLink ?? "N/A"} <b>HResult</b>: {Exception.HResult ?? "N/A"}<br>
|
||||
<b>Source</b>: {Exception.Source ?? "N/A"} <b>StackTrace</b>: {Exception.StackTrace ?? "N/A"} <b>MemberName</b>: {Exception.TargetSiteName ?? "N/A"}<br>
|
||||
<b>Message</b>: {Exception.Message ?? "N/A"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ClientLogException
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string HelpLink { get; set; }
|
||||
public string HResult { get; set; }
|
||||
public string Source { get; set; }
|
||||
public string StackTrace { get; set; }
|
||||
public string TargetSiteName { get; set; }
|
||||
public string Message { get; set; }
|
||||
public string InnerExceptionMessage { get; set; }
|
||||
}
|
||||
}
|
13
Models/CustomIPrincipal.cs
Normal file
13
Models/CustomIPrincipal.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace decePubClient.Models
|
||||
{
|
||||
public interface CustomIPrincipal : IPrincipal
|
||||
{
|
||||
string UserId { get; set; }
|
||||
string UserName { get; set; }
|
||||
string DisplayName { get; set; }
|
||||
string PictureUrl { get; set; }
|
||||
string ProfileUrl { get; set; }
|
||||
}
|
||||
}
|
20
Models/CustomPrincipal.cs
Normal file
20
Models/CustomPrincipal.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace decePubClient.Models
|
||||
{
|
||||
public class CustomPrincipal : CustomIPrincipal
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string PictureUrl { get; set; }
|
||||
public string ProfileUrl { get; set; }
|
||||
public bool IsAdmin { get; set; } = false;
|
||||
public IIdentity Identity { get; }
|
||||
|
||||
public CustomPrincipal(string userName, string authType) =>
|
||||
Identity = new GenericIdentity(userName, authType);
|
||||
|
||||
public bool IsInRole(string role) => false;
|
||||
}
|
||||
}
|
6
Models/MessageForm.cs
Normal file
6
Models/MessageForm.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace decePubClient.Models;
|
||||
|
||||
public class MessageForm
|
||||
{
|
||||
|
||||
}
|
16
Models/PublicCacheData.cs
Normal file
16
Models/PublicCacheData.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace decePubClient.Models
|
||||
{
|
||||
public class PublicCacheData
|
||||
{
|
||||
public IReadOnlyList<ViewLanguage> Languages { get; set; } = new List<ViewLanguage>();
|
||||
public string LastPage { get; set; }
|
||||
public IReadOnlyDictionary<string, string> Policies { get; set; } = new ReadOnlyDictionary<string, string>(new Dictionary<string, string>());
|
||||
|
||||
public string CurrentLanguageCode { get; set; } = "en-GB";
|
||||
public bool NativeNotificationsEnabled { get; set; } = false;
|
||||
public short ThemeIndexColour { get; set; } = 25;
|
||||
public bool ThemeIsDarkMode { get; set; } = false;
|
||||
}
|
||||
}
|
6
Models/Types/ContentType.cs
Normal file
6
Models/Types/ContentType.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace decePubClient.Models.Types;
|
||||
|
||||
public class ContentType
|
||||
{
|
||||
|
||||
}
|
10
Models/Types/MediaType.cs
Normal file
10
Models/Types/MediaType.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace decePubClient.Models.Types
|
||||
{
|
||||
public enum MediaType
|
||||
{
|
||||
Images,
|
||||
Video,
|
||||
Audio,
|
||||
Documents
|
||||
}
|
||||
}
|
3
Models/Types/TimeSortingType.cs
Normal file
3
Models/Types/TimeSortingType.cs
Normal file
@ -0,0 +1,3 @@
|
||||
namespace decePubClient.Models.Types;
|
||||
|
||||
public enum TimeSortingType { }
|
9
Models/Types/TimelineType.cs
Normal file
9
Models/Types/TimelineType.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace decePubClient.Models.Types
|
||||
{
|
||||
public enum TimelineType
|
||||
{
|
||||
Home,
|
||||
Local,
|
||||
Federation
|
||||
}
|
||||
}
|
6
Models/UploadMedia.cs
Normal file
6
Models/UploadMedia.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace decePubClient.Models;
|
||||
|
||||
public class UploadMedia
|
||||
{
|
||||
|
||||
}
|
8
Models/ViewLanguage.cs
Normal file
8
Models/ViewLanguage.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace decePubClient.Models
|
||||
{
|
||||
public class ViewLanguage
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string International2Code { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user