mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15:11:10 +00:00
Adds the server-side theme repository and reworks the web theme engine onto it
This commit is contained in:
1 parent
85928f7c3c
commit
bf8faba24d
136 files changed
+6942
-1197
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Themes.Management.Commands.DeleteTheme;
|
||||
using Lumina.Contracts.Requests.Themes;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="DeleteThemeRequest"/>.
|
||||
/// </summary>
|
||||
public static class DeleteThemeRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="DeleteThemeCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static DeleteThemeCommand ToCommand(this DeleteThemeRequest request)
|
||||
{
|
||||
return new DeleteThemeCommand(request.ThemeId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Themes.Management.Queries.GetThemeArchive;
|
||||
using Lumina.Contracts.Requests.Themes;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="GetThemeArchiveRequest"/>.
|
||||
/// </summary>
|
||||
public static class GetThemeArchiveRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="GetThemeArchiveQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted query.</returns>
|
||||
public static GetThemeArchiveQuery ToQuery(this GetThemeArchiveRequest request)
|
||||
{
|
||||
return new GetThemeArchiveQuery(request.ThemeId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Themes.Management.Queries.GetThemeAsset;
|
||||
using Lumina.Contracts.Requests.Themes;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="GetThemeAssetRequest"/>.
|
||||
/// </summary>
|
||||
public static class GetThemeAssetRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="GetThemeAssetQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted query.</returns>
|
||||
public static GetThemeAssetQuery ToQuery(this GetThemeAssetRequest request)
|
||||
{
|
||||
return new GetThemeAssetQuery(request.ThemeId, request.AssetPath);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Themes.Management.Queries.GetThemeTemplate;
|
||||
using Lumina.Contracts.Requests.Themes;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="GetThemeTemplateRequest"/>.
|
||||
/// </summary>
|
||||
public static class GetThemeTemplateRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="GetThemeTemplateQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted query.</returns>
|
||||
public static GetThemeTemplateQuery ToQuery(this GetThemeTemplateRequest request)
|
||||
{
|
||||
return new GetThemeTemplateQuery(request.ThemeId, request.PageKey);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Themes.Management.Commands.InstallTheme;
|
||||
using Lumina.Contracts.Requests.Themes;
|
||||
using System.IO;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="InstallThemeRequest"/>.
|
||||
/// </summary>
|
||||
public static class InstallThemeRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="InstallThemeCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <param name="archive">The ZIP archive stream of the theme pack.</param>
|
||||
/// <param name="fileName">The file name of the uploaded archive.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static InstallThemeCommand ToCommand(this InstallThemeRequest request, Stream? archive, string? fileName)
|
||||
{
|
||||
return new InstallThemeCommand(archive, fileName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Themes.Management.Commands.SetCurrentTheme;
|
||||
using Lumina.Contracts.Requests.Themes;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="SetCurrentThemeRequest"/>.
|
||||
/// </summary>
|
||||
public static class SetCurrentThemeRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="SetCurrentThemeCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static SetCurrentThemeCommand ToCommand(this SetCurrentThemeRequest request)
|
||||
{
|
||||
return new SetCurrentThemeCommand(request.ThemeId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Themes;
|
||||
using Lumina.Contracts.Responses.Themes;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="ThemeEntity"/>.
|
||||
/// </summary>
|
||||
public static class ThemeEntityMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="theme"/> to <see cref="ThemeResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="theme">The repository entity to be converted.</param>
|
||||
/// <returns>The converted response.</returns>
|
||||
public static ThemeResponse ToResponse(this ThemeEntity theme)
|
||||
{
|
||||
return new ThemeResponse(
|
||||
theme.Id,
|
||||
theme.ThemeId,
|
||||
theme.Name,
|
||||
theme.Description,
|
||||
theme.Author,
|
||||
theme.Version,
|
||||
theme.PreviewPath,
|
||||
theme.InstallSource,
|
||||
theme.IsCurrent,
|
||||
theme.InstalledAtUtc);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user