add send message

This commit is contained in:
2026-09-12 23:53:16 +03:00
parent b5788e14f1
commit 346abc24fe
6 changed files with 42 additions and 10 deletions
@@ -32,9 +32,7 @@ fun Route.setupChat(
val userId = call.obtainUserId()
val info = call.receive<Message>()
if (info.role != ChatRoles.USER) throw BadRequestException("invalid role")
val repository = chatRepositoryFactory.create(userId)
repository.send(info)
val response = processUserMessageUseCase.execute(userId)
val response = processUserMessageUseCase.execute(info, userId)
remoteEventHandler.notify(RemoteEvent.OnChatUpdate(userId))
call.respond(response)
}