mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-06 15:46:03 +02:00
feat: extract channel management to IChannelService and implement CRUD operations
This commit is contained in:
@@ -3,3 +3,20 @@ namespace EchoHub.Core.DTOs;
|
||||
public record ErrorResponse(string Error, string? Detail = null);
|
||||
|
||||
public record PaginatedResponse<T>(List<T> Items, int Total, int Offset, int Limit);
|
||||
|
||||
public enum ChannelError
|
||||
{
|
||||
ValidationFailed,
|
||||
AlreadyExists,
|
||||
NotFound,
|
||||
Forbidden,
|
||||
Protected
|
||||
}
|
||||
|
||||
public record ChannelOperationResult(ChannelDto? Channel, ChannelError? Error, string? ErrorMessage)
|
||||
{
|
||||
public bool IsSuccess => Error is null;
|
||||
|
||||
public static ChannelOperationResult Success(ChannelDto channel) => new(channel, null, null);
|
||||
public static ChannelOperationResult Fail(ChannelError error, string message) => new(null, error, message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user