fix: align backend APIs and upload flow

This commit is contained in:
2026-09-11 18:18:59 +08:00
parent 32177a7293
commit 898cf5dba0
69 changed files with 1081 additions and 153 deletions
@@ -52,13 +52,16 @@ namespace MessageService.WebApi.Application.Message
{
MessageType.Text => Domain.Entities.Message.BuildTxt(ctx, command.Text!, sequenceId),
MessageType.Image => Domain.Entities.Message.BuildImg(ctx, command.Url!,
command.Width ?? 0, command.Height ?? 0, command.Thumb!, sequenceId),
MessageType.Image => Domain.Entities.Message.BuildImg(ctx, command.Url,
command.Width ?? 0, command.Height ?? 0, command.Thumb!, sequenceId, command.FileId),
MessageType.Video => Domain.Entities.Message.BuildVideo(ctx, command.Url!,
command.Width ?? 0, command.Height ?? 0, command.Thumb!, sequenceId),
MessageType.Video => Domain.Entities.Message.BuildVideo(ctx, command.Url,
command.Width ?? 0, command.Height ?? 0, command.Thumb!, sequenceId, command.FileId),
MessageType.Voice => Domain.Entities.Message.BuildVoice(ctx, command.Url!, command.Duration ?? 0, sequenceId),
MessageType.Voice => Domain.Entities.Message.BuildVoice(ctx, command.Url, command.Duration ?? 0, sequenceId, command.FileId),
MessageType.File => Domain.Entities.Message.BuildFile(ctx, command.FileId!.Value, command.Url,
command.FileName!, command.FileSize!.Value, command.FileFormat!, sequenceId),
_ => null
};
@@ -109,6 +112,11 @@ namespace MessageService.WebApi.Application.Message
public async Task<Result<GetMessagesResponse>> GetMessagesAsync(GetMessageCommand command)
{
if (command.direction is not 0 and not 1 || command.limit is < 1 or > 100)
{
return Result.Fail<GetMessagesResponse>(ResultCode.PARAMETER_ERROR);
}
var conversation = await conversationReposity.FindByIdAsync(command.conversationId);
if(conversation is null || conversation.UserId != command.userId)