Implemented theme crud and basic theme loading
This commit is contained in:
23
Moonlight.Shared/Http/Requests/Themes/CreateThemeDto.cs
Normal file
23
Moonlight.Shared/Http/Requests/Themes/CreateThemeDto.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Moonlight.Shared.Http.Requests.Themes;
|
||||
|
||||
public class CreateThemeDto
|
||||
{
|
||||
[Required]
|
||||
[MaxLength(30)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(30)]
|
||||
public string Version { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(30)]
|
||||
public string Author { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(20_000)]
|
||||
public string CssContent { get; set; }
|
||||
}
|
||||
23
Moonlight.Shared/Http/Requests/Themes/UpdateThemeDto.cs
Normal file
23
Moonlight.Shared/Http/Requests/Themes/UpdateThemeDto.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Moonlight.Shared.Http.Requests.Themes;
|
||||
|
||||
public class UpdateThemeDto
|
||||
{
|
||||
[Required]
|
||||
[MaxLength(30)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(30)]
|
||||
public string Version { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(30)]
|
||||
public string Author { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(20_000)]
|
||||
public string CssContent { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Frontend;
|
||||
|
||||
public record FrontendConfigDto(string Name, string? ThemeCss);
|
||||
3
Moonlight.Shared/Http/Responses/Themes/ThemeDto.cs
Normal file
3
Moonlight.Shared/Http/Responses/Themes/ThemeDto.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Themes;
|
||||
|
||||
public record ThemeDto(int Id, string Name, string Author, string Version, string CssContent, bool IsEnabled);
|
||||
@@ -1,32 +1,48 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Moonlight.Shared.Http.Requests.ApiKeys;
|
||||
using Moonlight.Shared.Http.Requests.Roles;
|
||||
using Moonlight.Shared.Http.Requests.Themes;
|
||||
using Moonlight.Shared.Http.Requests.Users;
|
||||
using Moonlight.Shared.Http.Responses;
|
||||
using Moonlight.Shared.Http.Responses.Admin;
|
||||
using Moonlight.Shared.Http.Responses.ApiKeys;
|
||||
using Moonlight.Shared.Http.Responses.Auth;
|
||||
using Moonlight.Shared.Http.Responses.Themes;
|
||||
using Moonlight.Shared.Http.Responses.Users;
|
||||
|
||||
namespace Moonlight.Shared.Http;
|
||||
|
||||
// Users
|
||||
[JsonSerializable(typeof(CreateUserDto))]
|
||||
[JsonSerializable(typeof(UpdateUserDto))]
|
||||
[JsonSerializable(typeof(PagedData<UserDto>))]
|
||||
[JsonSerializable(typeof(UserDto))]
|
||||
|
||||
// Auth
|
||||
[JsonSerializable(typeof(ClaimDto[]))]
|
||||
[JsonSerializable(typeof(SchemeDto[]))]
|
||||
|
||||
// System
|
||||
[JsonSerializable(typeof(DiagnoseResultDto[]))]
|
||||
[JsonSerializable(typeof(UserDto))]
|
||||
[JsonSerializable(typeof(SystemInfoDto))]
|
||||
[JsonSerializable(typeof(PagedData<UserDto>))]
|
||||
[JsonSerializable(typeof(PagedData<RoleDto>))]
|
||||
[JsonSerializable(typeof(RoleDto))]
|
||||
|
||||
// Roles
|
||||
[JsonSerializable(typeof(CreateRoleDto))]
|
||||
[JsonSerializable(typeof(UpdateRoleDto))]
|
||||
[JsonSerializable(typeof(PagedData<RoleDto>))]
|
||||
[JsonSerializable(typeof(RoleDto))]
|
||||
|
||||
// API Keys
|
||||
[JsonSerializable(typeof(CreateApiKeyDto))]
|
||||
[JsonSerializable(typeof(UpdateApiKeyDto))]
|
||||
[JsonSerializable(typeof(UpdateApiKeyDto))]
|
||||
[JsonSerializable(typeof(PagedData<ApiKeyDto>))]
|
||||
[JsonSerializable(typeof(ApiKeyDto))]
|
||||
|
||||
// Themes
|
||||
[JsonSerializable(typeof(CreateThemeDto))]
|
||||
[JsonSerializable(typeof(UpdateThemeDto))]
|
||||
[JsonSerializable(typeof(PagedData<ThemeDto>))]
|
||||
[JsonSerializable(typeof(ThemeDto))]
|
||||
public partial class SerializationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user