Refactored response and request models to dto naming. Adjusted mapper naming
This commit is contained in:
@@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Moonlight.Shared.Http.Requests.Roles;
|
||||
|
||||
public class CreateRoleRequest
|
||||
public class CreateRoleDto
|
||||
{
|
||||
[Required] [MaxLength(15)] public string Name { get; set; }
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Moonlight.Shared.Http.Requests.Roles;
|
||||
|
||||
public class UpdateRoleRequest
|
||||
public class UpdateRoleDto
|
||||
{
|
||||
[Required] [MaxLength(15)] public string Name { get; set; }
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Moonlight.Shared.Http.Requests.Users;
|
||||
|
||||
public class CreateUserRequest
|
||||
public class CreateUserDto
|
||||
{
|
||||
[Required]
|
||||
[MinLength(3)]
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Moonlight.Shared.Http.Requests.Users;
|
||||
|
||||
public class UpdateUserRequest
|
||||
public class UpdateUserDto
|
||||
{
|
||||
[Required]
|
||||
[MinLength(3)]
|
||||
10
Moonlight.Shared/Http/Responses/Admin/DiagnoseResultDto.cs
Normal file
10
Moonlight.Shared/Http/Responses/Admin/DiagnoseResultDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Admin;
|
||||
|
||||
public record DiagnoseResultDto(DiagnoseLevel Level, string Title, string[] Tags, string? Message, string? StackStrace, string? SolutionUrl, string? ReportUrl);
|
||||
|
||||
public enum DiagnoseLevel
|
||||
{
|
||||
Error = 0,
|
||||
Warning = 1,
|
||||
Healthy = 2
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Admin;
|
||||
|
||||
public record DiagnoseResultResponse(DiagnoseLevel Level, string Title, string[] Tags, string? Message, string? StackStrace, string? SolutionUrl, string? ReportUrl);
|
||||
|
||||
public enum DiagnoseLevel
|
||||
{
|
||||
Error = 0,
|
||||
Warning = 1,
|
||||
Healthy = 2
|
||||
}
|
||||
3
Moonlight.Shared/Http/Responses/Admin/RoleDto.cs
Normal file
3
Moonlight.Shared/Http/Responses/Admin/RoleDto.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Admin;
|
||||
|
||||
public record RoleDto(int Id, string Name, string Description, string[] Permissions, int MemberCount, DateTimeOffset CreatedAt, DateTimeOffset UpdatedAt);
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Admin;
|
||||
|
||||
public record RoleResponse(int Id, string Name, string Description, string[] Permissions, int MemberCount, DateTimeOffset CreatedAt, DateTimeOffset UpdatedAt);
|
||||
3
Moonlight.Shared/Http/Responses/Admin/SystemInfoDto.cs
Normal file
3
Moonlight.Shared/Http/Responses/Admin/SystemInfoDto.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Admin;
|
||||
|
||||
public record SystemInfoDto(double CpuUsage, long MemoryUsage, string OperatingSystem, TimeSpan Uptime, string VersionName, bool IsUpToDate);
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Admin;
|
||||
|
||||
public record SystemInfoResponse(double CpuUsage, long MemoryUsage, string OperatingSystem, TimeSpan Uptime, string VersionName, bool IsUpToDate);
|
||||
3
Moonlight.Shared/Http/Responses/Auth/ClaimDto.cs
Normal file
3
Moonlight.Shared/Http/Responses/Auth/ClaimDto.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Auth;
|
||||
|
||||
public record ClaimDto(string Type, string Value);
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Auth;
|
||||
|
||||
public record ClaimResponse(string Type, string Value);
|
||||
3
Moonlight.Shared/Http/Responses/Auth/SchemeDto.cs
Normal file
3
Moonlight.Shared/Http/Responses/Auth/SchemeDto.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Auth;
|
||||
|
||||
public record SchemeDto(string Name, string DisplayName);
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Auth;
|
||||
|
||||
public record SchemeResponse(string Name, string DisplayName);
|
||||
3
Moonlight.Shared/Http/Responses/Users/UserDto.cs
Normal file
3
Moonlight.Shared/Http/Responses/Users/UserDto.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Users;
|
||||
|
||||
public record UserDto(int Id, string Username, string Email, DateTimeOffset CreatedAt, DateTimeOffset UpdatedAt);
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Moonlight.Shared.Http.Responses.Users;
|
||||
|
||||
public record UserResponse(int Id, string Username, string Email, DateTimeOffset CreatedAt, DateTimeOffset UpdatedAt);
|
||||
@@ -8,18 +8,18 @@ using Moonlight.Shared.Http.Responses.Users;
|
||||
|
||||
namespace Moonlight.Shared.Http;
|
||||
|
||||
[JsonSerializable(typeof(CreateUserRequest))]
|
||||
[JsonSerializable(typeof(UpdateUserRequest))]
|
||||
[JsonSerializable(typeof(ClaimResponse[]))]
|
||||
[JsonSerializable(typeof(SchemeResponse[]))]
|
||||
[JsonSerializable(typeof(DiagnoseResultResponse[]))]
|
||||
[JsonSerializable(typeof(UserResponse))]
|
||||
[JsonSerializable(typeof(SystemInfoResponse))]
|
||||
[JsonSerializable(typeof(PagedData<UserResponse>))]
|
||||
[JsonSerializable(typeof(PagedData<RoleResponse>))]
|
||||
[JsonSerializable(typeof(RoleResponse))]
|
||||
[JsonSerializable(typeof(CreateRoleRequest))]
|
||||
[JsonSerializable(typeof(UpdateRoleRequest))]
|
||||
[JsonSerializable(typeof(CreateUserDto))]
|
||||
[JsonSerializable(typeof(UpdateUserDto))]
|
||||
[JsonSerializable(typeof(ClaimDto[]))]
|
||||
[JsonSerializable(typeof(SchemeDto[]))]
|
||||
[JsonSerializable(typeof(DiagnoseResultDto[]))]
|
||||
[JsonSerializable(typeof(UserDto))]
|
||||
[JsonSerializable(typeof(SystemInfoDto))]
|
||||
[JsonSerializable(typeof(PagedData<UserDto>))]
|
||||
[JsonSerializable(typeof(PagedData<RoleDto>))]
|
||||
[JsonSerializable(typeof(RoleDto))]
|
||||
[JsonSerializable(typeof(CreateRoleDto))]
|
||||
[JsonSerializable(typeof(UpdateRoleDto))]
|
||||
public partial class SerializationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user