implement fix

This commit is contained in:
2026-02-11 21:10:33 +01:00
parent 802d8d26be
commit 4d85175fe1
5 changed files with 18 additions and 18 deletions

View File

@@ -8,9 +8,6 @@ namespace AipsCore.Application.Models.Whiteboard.Command.CreateWhiteboard;
public record CreateWhiteboardCommand(
string OwnerId,
string Title,
DateTime CreatedAt,
DateTime DeletedAt,
int MaxParticipants,
WhiteboardJoinPolicy JoinPolicy,
WhiteboardState State)
WhiteboardJoinPolicy JoinPolicy)
: ICommand<WhiteboardId>;

View File

@@ -24,11 +24,8 @@ public class CreateWhiteboardCommandHandler : ICommandHandler<CreateWhiteboardCo
command.OwnerId,
whiteboardCode.CodeValue,
command.Title,
command.CreatedAt,
command.DeletedAt,
command.MaxParticipants,
command.JoinPolicy,
command.State);
command.JoinPolicy);
await _whiteboardRepository.SaveAsync(whiteboard, cancellationToken);
await _unitOfWork.SaveChangesAsync(cancellationToken);

View File

@@ -24,12 +24,12 @@ public partial class Whiteboard : DomainModel<WhiteboardId>
}
membership = WhiteboardMembership.WhiteboardMembership.Create(
this.Id.ToString(),
user.Id.ToString(),
this.Id.IdValue,
user.Id.IdValue,
false,
false,
this.GetCanJoin(),
DateTime.Now
DateTime.UtcNow
);
await membershipRepository.AddAsync(membership, cancellationToken);

View File

@@ -95,18 +95,15 @@ public partial class Whiteboard : DomainModel<WhiteboardId>
string ownerId,
string code,
string title,
DateTime createdAt,
DateTime? deletedAt,
int maxParticipants,
WhiteboardJoinPolicy joinPolicy,
WhiteboardState state)
WhiteboardJoinPolicy joinPolicy)
{
var whiteboardId = WhiteboardId.Any();
var whiteboardOwnerId = new UserId(ownerId);
var whiteboardCode = new WhiteboardCode(code);
var whiteboardTitle = new WhiteboardTitle(title);
var whiteboardCreatedAt = new WhiteboardCreatedAt(createdAt);
var whiteboardDeletedAt = new WhiteboardDeletedAt(deletedAt);
var whiteboardCreatedAt = new WhiteboardCreatedAt(DateTime.UtcNow);
var whiteboardDeletedAt = new WhiteboardDeletedAt(null);
var whiteboardMaxParticipants = new WhiteboardMaxParticipants(maxParticipants);
return new Whiteboard(
@@ -118,6 +115,6 @@ public partial class Whiteboard : DomainModel<WhiteboardId>
whiteboardDeletedAt,
whiteboardMaxParticipants,
joinPolicy,
state);
WhiteboardState.Active);
}
}

View File

@@ -1,4 +1,5 @@
using AipsCore.Application.Abstract;
using AipsCore.Application.Models.Whiteboard.Command.AddUserToWhiteboard;
using AipsCore.Application.Models.Whiteboard.Command.CreateWhiteboard;
using Microsoft.AspNetCore.Mvc;
@@ -14,4 +15,12 @@ public class WhiteboardController : ControllerBase
var whiteboardId = await dispatcher.Execute(command, cancellationToken);
return Ok(whiteboardId.IdValue);
}
[HttpPost("adduser")]
public async Task<IActionResult> AddUser(AddUserToWhiteboardCommand command, IDispatcher dispatcher,
CancellationToken cancellationToken)
{
await dispatcher.Execute(command, cancellationToken);
return Ok();
}
}